energy consumed

This commit is contained in:
Dona Maria Absi
2025-03-15 02:24:56 +03:00
parent a6c1e62d7c
commit fdb95e9919

View File

@ -1,4 +1,5 @@
SELECT event_time::date,
EXTRACT(HOUR FROM event_time) AS hour,
device_id ,
space_device_uuid as space_id,
sum(value::integer) as total_energy_consummed
@ -7,7 +8,6 @@ LEFT JOIN "device-status-log"
ON device.uuid = "device-status-log".device_id
LEFT JOIN product
ON product.uuid = device.product_device_uuid
where product.name='Power Clamp'
and code in ('EnergyConsumed','EnergyConsumedA','EnergyConsumedB','EnergyConsumedC')
group by 1,2,3
ORDER BY 1,2
where code ='EnergyConsumed'
group by 1,2,3,4
ORDER BY 1,3,2