AutomationDataset/MonoksideC/MonoksideC_automations.yaml

57 lines
1.5 KiB
YAML

- alias: Shower - Reset Counters
description: Reset session duration and water used to zero when a new shower session
starts.
triggers:
- trigger: state
entity_id:
- binary_sensor.shower_active
from: 'off'
to: 'on'
conditions: []
actions:
- action: input_number.set_value
target:
entity_id: input_number.shower_water_total
data:
value: 0
- action: input_number.set_value
data:
value: 0
target:
entity_id: input_number.shower_duration
mode: single
- alias: Shower - Track Session Length
description: ''
triggers:
- trigger: time_pattern
seconds: /1
conditions:
- condition: state
entity_id: binary_sensor.shower_active
state: 'on'
actions:
- action: input_number.increment
target:
entity_id: input_number.shower_duration
data: {}
mode: single
- alias: Shower - Track Water
description: Use current flow rate to calculate total water used.
triggers:
- trigger: time_pattern
seconds: /1
conditions:
- condition: state
entity_id: binary_sensor.shower_active
state: 'on'
actions:
- action: input_number.set_value
target:
entity_id: input_number.shower_water_total
data:
value: "{{ (\n states('input_number.shower_water_total') | float \n\
\ + ((states('sensor.esphome_shower_temp_hot_water_flow') | float\
\ \n + states('sensor.esphome_shower_temp_cold_water_flow') | float)\
\ / 60)\n ) | round(2) }}\n"
mode: single