Hi folks,
I’ve got 6kw of solar panels, a 5kw inverter, and an enphase system for monitoring. For about 5 months I’ve been using the enphase monitoring to drive some theoretically energy efficient automations in my home. These automations do three things: turn on heating, dehumidification or cooling to automatically soak up excess solar; run ceiling fans automatically to circulate air when there is excess solar; recommend actions like opening windows.
This has been nice, and the house has been more subjectively comfortable while power costs have stayed affordable. But it hasn’t been possible to really measure if I’m making a saving. So I’m doing a randomised trial. Every day at midnight the input boolean that toggles HVAC and recommendations being automated is randomly toggled, and the automation that controls ceiling fans is separately toggled. I want to compare the effects of those separately:
- id: energy_tests
alias: "Perform energy tests"
trigger:
- at: '00:00:00'
platform: time
condition: []
action:
- service: automation.turn_{{ ['on','off'] | random }}
data:
entity_id: automation.control_air_circulation
- service: input_boolean.turn_{{ ['on','off'] | random }}
data:
entity_id: input_boolean.climate_control_alerts
In order to track the results of this experiment I needed to come up with an SQL query that will group my consumption, import and export of energy by day, and mark whether the fans or HVAC/recommendations were automated that day. This is the SQL query that performs that:
SELECT DATE(FROM_UNIXTIME(last_updated_ts)) AS `Day`,
CAST(MAX(IF(entity_id = 'sensor.enphase_lifetime_energy_consumption',state,NULL)) AS INT)-CAST(MIN(IF(entity_id = 'sensor.enphase_lifetime_energy_consumption',state,NULL)) AS INT) AS `Consumed`,
CAST((MAX(IF(entity_id = 'sensor.grid_export_energy',state,NULL))-MIN(IF(entity_id='sensor.grid_export_energy',state,NULL)))*1000 AS INT) AS 'Exported',
CAST((MAX(IF(entity_id = 'sensor.grid_import_energy',state,NULL))-MIN(IF(entity_id='sensor.grid_import_energy',state,NULL)))*1000 AS INT) AS 'Imported',
SUM(CASE WHEN entity_id='automation.control_air_circulation' AND state = 'on' THEN 1 WHEN entity_id='automation.control_air_circulation' AND state='off' THEN -1 ELSE 0 END) AS `Fans`,
SUM(CASE WHEN entity_id='input_boolean.climate_control_alerts' AND state = 'on' THEN 1 WHEN entity_id='input_boolean.climate_control_alerts' AND state='off' THEN -1 ELSE 0 END) AS `Climate automation`
FROM states
WHERE states.entity_id IN ('automation.control_air_circulation','input_boolean.climate_control_alerts','sensor.enphase_lifetime_energy_consumption','sensor.grid_import_energy','sensor.grid_export_energy')
AND last_updated_ts > UNIX_TIMESTAMP('2023-3-6') AND state !='unavailable'
GROUP BY Day;
The SQL query could do with some improving. The current configuration means days when the fans run the “fans” column will be a value > 0 (each time the automation trigges counts 1). The day it gets turned off the value becomes -1 and if it is off multiple days in a row the value is 0 after the initial day. Similarly, the Climate automation column will be either 1, 0, or -1. 1 is a day it was turned on after being off; -1 is a day it was turned off after being on; 0 is a day it was the same state as the day before. I’d rather each of these columns were just 1 or 0 for on or off - but I couldn’t figure out how to accomplish that.
Anyway, I’ll come back with some results when I have collected enough data for them to be meaningful. Just thought I’d share in case it was a useful idea to anyone else.
It’s currently hot weather where I live, so currently dehumidifying and AC is needed most days. I have my doubts that my fans running automatically when no-one is in a room is useful in this weather, but I want to find out. I’ve read that, In theory, this can save energy in winter - I guess by evening up the temperature gradient between floor and ceiling.