HI,
I have prepared following script to automate my humidifier in a room.
- alias: turn on humidifier when humidity lower than 45
trigger:
- platform: numeric_state
entity_id: sensor.humidity_158d0001100418
below: 45
value_template: '{{ state.state }}'
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: time
after: '15:00:00'
before: '07:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: time
weekday:
- sat
- sun
- condition: state
entity_id: binary_sensor.door_window_sensor_158d000130e59b
state: 'off'
action:
service: switch.turn_on
entity_id: switch.plug_158d00012a0d00
The goal is to switch on a plug once humidity fals below 45% and the window is closed and (it is a weekend or weekday after 3pm and before 7am)
There is no error reported by HA yet the rule does not trigger. May I ask for review of the script if there is anything I should fix? I think (but not certain) that once humidity on a sensor goes from above to below on a state update, the rule triggers. When I restart HA and humidity is below 45, the rule also triggers however no action when running for some time.
I am using Xiaomi windowr open sensor, humidity sensor and a plug.
Thank you for help