mirror of
https://github.com/SyncrowIOT/data.git
synced 2025-07-15 17:47:39 +00:00
energy consumed
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
SELECT event_time::date,
|
SELECT event_time::date,
|
||||||
|
EXTRACT(HOUR FROM event_time) AS hour,
|
||||||
device_id ,
|
device_id ,
|
||||||
space_device_uuid as space_id,
|
space_device_uuid as space_id,
|
||||||
sum(value::integer) as total_energy_consummed
|
sum(value::integer) as total_energy_consummed
|
||||||
@ -7,7 +8,6 @@ LEFT JOIN "device-status-log"
|
|||||||
ON device.uuid = "device-status-log".device_id
|
ON device.uuid = "device-status-log".device_id
|
||||||
LEFT JOIN product
|
LEFT JOIN product
|
||||||
ON product.uuid = device.product_device_uuid
|
ON product.uuid = device.product_device_uuid
|
||||||
where product.name='Power Clamp'
|
where code ='EnergyConsumed'
|
||||||
and code in ('EnergyConsumed','EnergyConsumedA','EnergyConsumedB','EnergyConsumedC')
|
group by 1,2,3,4
|
||||||
group by 1,2,3
|
ORDER BY 1,3,2
|
||||||
ORDER BY 1,2
|
|
||||||
|
Reference in New Issue
Block a user