Difference between revisions of "Towel rails logic"
Line 1: | Line 1: | ||
The towel rails can be scheduled (scheduler) or turned ON and OFF by the measurement of excess solar power. During the day is the incoming solar is greater than 800 watts for 1 minute then all of the rails are turned on directly, using the | The towel rails can be scheduled (scheduler) or turned ON and OFF by the measurement of excess solar power. During the day is the incoming solar is greater than 800 watts for 1 minute then all of the rails are turned on directly, using the input_boolean turn_on command. There are two boolean's per rail, one for solar and one for the scheduler. | ||
<pre> | <pre> | ||
alias: Heated rails on | alias: Heated rails on | ||
Line 10: | Line 10: | ||
condition: [] | condition: [] | ||
action: | action: | ||
- service: | - service: input_boolean.turn_on | ||
target: | target: | ||
entity_id: | entity_id: | ||
- | - input_boolean.master_bath_towel_solar | ||
- | - input_boolean.rachel_bathroom_towel_solar | ||
- | - input_boolean.girls_towel_rail_solar | ||
- | - input_boolean.laundry_towel_solar | ||
data: {} | data: {} | ||
mode: single | |||
</pre> | |||
mode: single</pre> | |||
The solar system does not turn off rails if they are scheduled ON, instead it just turns of the solar input_booleans for all rails | |||
<pre> | <pre> | ||
Line 35: | Line 33: | ||
condition: [] | condition: [] | ||
action: | action: | ||
- | - service: input_boolean.turn_off | ||
target: | |||
entity_id: | |||
- input_boolean.master_bath_towel_solar | |||
- input_boolean.rachel_bathroom_towel_solar | |||
- input_boolean.girls_towel_rail_solar | |||
- input_boolean.laundry_towel_solar | |||
data: {} | |||
data: | |||
mode: single | mode: single | ||
</pre> | </pre> | ||
Finally boolean logic is applied. Using an OR gate, if either solar or scheduler wants the rails on they are turned ON. There is separate ON and OFF logic for each towel rail: | |||
<pre> | |||
alias: Girls rail ON | |||
description: "" | |||
trigger: | |||
- platform: state | |||
entity_id: | |||
- input_boolean.girls_towel_rail | |||
- input_boolean.girls_towel_rail_solar | |||
condition: | |||
- condition: or | |||
conditions: | |||
- condition: state | |||
entity_id: input_boolean.girls_towel_rail | |||
state: "on" | |||
- condition: state | |||
entity_id: input_boolean.girls_towel_rail_solar | |||
state: "on" | |||
action: | |||
- service: switch.turn_on | |||
data: {} | |||
target: | |||
entity_id: switch.girls_towel_rail | |||
mode: single | |||
</pre> | |||
and Using an AND gate, if both solar or scheduler wants the rails off they are turned OFF. | |||
<pre> | <pre> | ||
alias: | alias: Girls rail OFF | ||
description: | description: "" | ||
trigger: | trigger: | ||
- platform: state | - platform: state | ||
entity_id: | entity_id: | ||
- input_boolean. | - input_boolean.girls_towel_rail | ||
- input_boolean. | - input_boolean.girls_towel_rail_solar | ||
- input_boolean. | condition: | ||
- input_boolean. | - condition: and | ||
conditions: | |||
- condition: state | |||
entity_id: input_boolean.girls_towel_rail | |||
state: "off" | |||
- condition: state | |||
entity_id: input_boolean.girls_towel_rail_solar | |||
state: "off" | |||
action: | action: | ||
- service: switch. | - service: switch.turn_off | ||
data: | data: {} | ||
target: | |||
entity_id: switch.girls_towel_rail | |||
mode: single</pre> | |||
mode: single | |||
</pre> |
Revision as of 10:50, 8 November 2023
The towel rails can be scheduled (scheduler) or turned ON and OFF by the measurement of excess solar power. During the day is the incoming solar is greater than 800 watts for 1 minute then all of the rails are turned on directly, using the input_boolean turn_on command. There are two boolean's per rail, one for solar and one for the scheduler.
alias: Heated rails on description: "" trigger: - platform: numeric_state entity_id: sensor.grid_feed_in above: "800" for: "00:01:00" condition: [] action: - service: input_boolean.turn_on target: entity_id: - input_boolean.master_bath_towel_solar - input_boolean.rachel_bathroom_towel_solar - input_boolean.girls_towel_rail_solar - input_boolean.laundry_towel_solar data: {} mode: single
The solar system does not turn off rails if they are scheduled ON, instead it just turns of the solar input_booleans for all rails
alias: Heated rails OFF description: "" trigger: - platform: numeric_state entity_id: sensor.meter_power_a above: "-100" for: "00:00:30" condition: [] action: - service: input_boolean.turn_off target: entity_id: - input_boolean.master_bath_towel_solar - input_boolean.rachel_bathroom_towel_solar - input_boolean.girls_towel_rail_solar - input_boolean.laundry_towel_solar data: {} mode: single
Finally boolean logic is applied. Using an OR gate, if either solar or scheduler wants the rails on they are turned ON. There is separate ON and OFF logic for each towel rail:
alias: Girls rail ON description: "" trigger: - platform: state entity_id: - input_boolean.girls_towel_rail - input_boolean.girls_towel_rail_solar condition: - condition: or conditions: - condition: state entity_id: input_boolean.girls_towel_rail state: "on" - condition: state entity_id: input_boolean.girls_towel_rail_solar state: "on" action: - service: switch.turn_on data: {} target: entity_id: switch.girls_towel_rail mode: single
and Using an AND gate, if both solar or scheduler wants the rails off they are turned OFF.
alias: Girls rail OFF description: "" trigger: - platform: state entity_id: - input_boolean.girls_towel_rail - input_boolean.girls_towel_rail_solar condition: - condition: and conditions: - condition: state entity_id: input_boolean.girls_towel_rail state: "off" - condition: state entity_id: input_boolean.girls_towel_rail_solar state: "off" action: - service: switch.turn_off data: {} target: entity_id: switch.girls_towel_rail mode: single