Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created October 21, 2020 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bessarabov/b088cb9161deb018c2e0e864842f3d38 to your computer and use it in GitHub Desktop.
Save bessarabov/b088cb9161deb018c2e0e864842f3d38 to your computer and use it in GitHub Desktop.
binary_sensor:
- platform: template
sensors:
boiler_is_operating_normally:
value_template: "{{ states('sensor.bw_shp8_boiler_power') | int > 1 }}"
utility_meter:
hourly_energy_boiler:
source: sensor.bw_shp8_boiler_total_daily_energy
cycle: hourly
daily_energy_boiler:
source: sensor.bw_shp8_boiler_total_daily_energy
cycle: daily
monthly_energy_boiler:
source: sensor.bw_shp8_boiler_total_daily_energy
cycle: monthly
automation:
- alias: Turn boiler on
trigger:
- platform: time_pattern
minutes: "/6"
condition:
- condition: state
entity_id: switch.bw_shp8_boiler_relay
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.bw_shp8_boiler_relay
- alias: Check boiler is working
trigger:
- platform: state
entity_id: binary_sensor.boiler_is_operating_normally
- platform: time_pattern
minutes: "25"
condition:
- condition: state
entity_id: binary_sensor.boiler_is_operating_normally
state: 'off'
action:
service: notify.bessarabov
data:
message: "boiler is not working normally"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment