Created
January 28, 2023 22:14
-
-
Save gyoza/55ad99a35a6bc8699cd697d74ca358ba to your computer and use it in GitHub Desktop.
home-automation script: check outside humidity and turn on fresh_air fan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sequence: | |
- if: | |
- condition: template | |
value_template: >- | |
{{ | |
int(states('sensor.openweathermap_humidity')|regex_replace(find='%', | |
replace='', ignorecase=False)) > 25}} | |
- condition: template | |
value_template: >- | |
{{ | |
int(states('sensor.openweathermap_temperature')|regex_replace(find='°F', | |
replace='', ignorecase=False)) < 80 }} | |
- condition: template | |
value_template: >- | |
{{ | |
int(states('sensor.openweathermap_temperature')|regex_replace(find='°F', | |
replace='', ignorecase=False)) > 25 }} | |
then: | |
- type: turn_on | |
device_id: xxx | |
entity_id: switch.fresh_air | |
domain: switch | |
else: | |
- type: turn_off | |
device_id: xxx | |
entity_id: switch.fresh_air | |
domain: switch | |
alias: Outside Humidity Detection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment