Spaces:
Runtime error
Runtime error
File size: 479 Bytes
1129495 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | SELECT
a.name AS asset_name,
ad.timestamp + INTERVAL '3 hours' AS local_time,
(ad.value::jsonb - 'Timestamp' - 'timestamp') AS sensor_data
FROM openremote.asset a
JOIN openremote.asset_datapoint ad
ON a.id = ad.entity_id
WHERE a.id = (
SELECT id
FROM openremote.asset
WHERE REPLACE(LOWER(name), ' ', '') = REPLACE(LOWER('ColdRoom1'), ' ', '')
ORDER BY version DESC
LIMIT 1
)
AND ad.attribute_name ILIKE 'data'
ORDER BY ad.timestamp DESC
LIMIT 10 |