I’ve tried this for a while now, if the temp goes below 2C between 9pm and 6am I want the input_boolean to be set to on.
The way it works now is that if it’s above 2C at 9pm and then goes below 2C before 6am it work’s as it should. But if it’s already cold outside it doesn’t see the “below 2C” change.
- id: '1581627412807'
alias: Car Heater if I'm home mon-fri. (Below 2C 21:00-06:00)
description: ''
trigger:
- at: 05:30
platform: time
condition:
- condition: state
entity_id: person.per_kristian
state: home
- condition: state
entity_id: input_boolean.below_2c
state: 'on'
action:
- entity_id: switch.osramsmartplugbasement
service: switch.turn_on
- delay: 02:00:00
- entity_id: switch.osramsmartplugbasement
service: switch.turn_off
- id: '1581627833924'
alias: Turn on input.boolean if outside temperature goes below 2C 21:00-06:00
description: ''
trigger:
- platform: template
value_template: '{{(states.sensor.outside_temperature.state | int) <= (2 | int)}}'
condition:
- after: '21:00:00'
before: 05:59:59
condition: time
action:
- entity_id: input_boolean.below_2c
service: input_boolean.turn_on