I created some rules to automate turn on and turn off of air conditioners based on solar panel production.
I’m using Daikin binding for conditioners and SolarEdge binding for photovoltaic.
To turn on conditioner I check every 5 seconds if i’m exporting more than 1kW then turn it on.
This is the rule code:
triggers:
- id: "5"
configuration:
cronExpression: 0/5 * * * * ? *
type: timer.GenericCronTrigger
conditions:
- inputs: {}
id: "2"
configuration:
itemName: SolarEdge_Live_Export
state: "1"
operator: ">"
type: core.ItemStateCondition
- inputs: {}
id: "1"
configuration:
itemName: Condizionatore_Power
state: OFF
operator: =
type: core.ItemStateCondition
actions:
- inputs: {}
id: "4"
configuration:
itemName: Condizionatore_Power
command: ON
type: core.ItemCommandAction
Then to turn them off I check every 5 seconds if import of electricity it’s >0, with this rule:
triggers:
- id: "1"
configuration:
cronExpression: 0/5 * * * * ? *
type: timer.GenericCronTrigger
conditions:
- inputs: {}
id: "3"
configuration:
itemName: SolarEdge_Live_Import
state: "0"
operator: ">"
type: core.ItemStateCondition
- inputs: {}
id: "4"
configuration:
itemName: Condizionatore_Power
state: ON
operator: =
type: core.ItemStateCondition
actions:
- inputs: {}
id: "5"
configuration:
itemName: Condizionatore_Power
command: OFF
type: core.ItemCommandAction
This work as expected, but after some days of use I found out a thing I didn’t considered.
There’s a lot of situation that can cause the air conditioner turn off and on repeatedly, for example in a partially cloudy day where solar panels production can vary a lot during the day.
Or also when turning on high comsumption appliance for few time (for example a microwave for 30 seconds).
I want to avoid turn off units just for 30 seconds or less.
I already thought of increasing the 5 seconds interval to something more like 1 minute, but it’s not the solution, because also if the rule it’s less frequent, it could happen that it run during a very short period where the production of the panels is low, causing an unnecessary shutdown.
Instead of checking the value in that moment, there’s a way to check if the value kept a value greater than 0 for a certain period (for example 5 minutes), and after that time turn of the conditioners??