Skip to content

Instantly share code, notes, and snippets.

@bawejakunal
Last active May 11, 2020 05:35
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 bawejakunal/b170e088720068b39d465dded2512c08 to your computer and use it in GitHub Desktop.
Save bawejakunal/b170e088720068b39d465dded2512c08 to your computer and use it in GitHub Desktop.
- id: '1585424767193' # automation unique identifier
alias: Heater Automation
description: Turn on/off Heater based on temperature changes
trigger:
- below: '22.0' # temperature in celsiues
entity_id: sensor.aeon_labs_zw100_multisensor_6_temperature # sensor measuring temperature
for: 00:05:00 # duration in HH:MM:SS format
platform: numeric_state
- above: '23.9' # state change to trigger the automation
entity_id: sensor.aeon_labs_zw100_multisensor_6_temperature
for: 00:05:00
platform: numeric_state
condition: []
action:
- entity_id: switch.heater # switch that should be acted upon
# action taken on entity based on reportedstate changes is selected in service_template
service_template: "{% if states('sensor.aeon_labs_zw100_multisensor_6_temperature')\
\ | float < 22.0 and is_state('switch.heater', 'off')%}\n switch.turn_on\n\
{% elif states('sensor.aeon_labs_zw100_multisensor_6_temperature') | float >=\
\ 24 %}\n switch.turn_off\n{% endif %}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment