Using an automation to see whether my pumps need to be on in the first place, based on a template sensor:
sensor:
platform: template
sensors:
vijverpomp:
friendly_name_template: >
{{states('sensor.temp_current')|float}}°C - Vijverpompen {{'moeten: ' if
is_state('sensor.vijverpomp','Aan') else 'mogen: '}}
value_template: >
{{'Aan' if (states('sensor.temp_current')|float > 6 and
is_state('binary_sensor.outside_daylight_sensor','on')) else 'Uit'}}
icon_template: >
{% if is_state('sensor.vijverpomp','Uit') %} mdi:engine-off-outline
{% else %} mdi:engine-outline
{% endif %}
and automartion:
- alias: Vijverpompen
id: Vijverpompen
trigger:
platform: state
entity_id: sensor.vijverpomp
condition:
- condition: numeric_state
entity_id: sensor.temp_current
above: 5
below: 7
- >
{{trigger.to_state.state != trigger.from_state.state}}
- >
{{trigger.to_state.state in ['Aan','Uit']}}
- >
{{(now() -
states.sensor.vijverpomp.last_changed|default(0)).total_seconds() > 3600}}
- condition: state
entity_id: input_boolean.notify_utility
state: 'on'
action:
service: notify.system
data:
title: Vijverpomp
message: >
Vijverpompen {{'moeten aan' if is_state('sensor.vijverpomp','Aan') else 'mogen uit'}}
I currently do this manualy.
Installing a Fibaro double switch should allow me to do this automatically, and I was wondering if there would be a’best solution’ for this, some sort of default alternating switching.
Thing is I am not sure if I should trigger on the same triggers as above, or the sensor, or maybe sensor.date, to have the pumps change daily.
action:
service: switch.toggle
entity_id: switch.pump_left, switch.pump_right
should do it, if and when the condition is set they don’t have the same state
a simple binary sensor might help:
binary_sensor:
platform: template
sensors:
vijverpomp:
value_template: >
{{states('sensor.temp_current')|float > 6 and
is_state('binary_sensor.outside_daylight_sensor','on')}}
# delay_off:
# minutes: 60
so, both switches should be on if the binary_sensor is ‘on’ (both containing conditions are met).
Switches should alternate during daylight == ‘off’, (even though the temp is above 6 degrees, think spring and summer evenings) or when the temp is below degrees (think winter). This period will vary of course, from a single summers eve, to a long period of cold temp in winter.
Not sure a While construct would work (consider system restarts…), and this might very well be the first situation in my config where a manual switch is easier than figuring out the automation…
please let me know your thoughts?
thanks!