I’m trying to use an input boolean to control a reminder which is to occur every night. It’s not working unless I comment out the condition test for the input boolean.
I’ve double checked and the binary sensor is in the correct state, so I’m confused as to why it’s not working. The way I checked the boolean was via the states panel. I also did the following from the template editor and it was showing as true:
I’ve already tried all those suggestions except the double quotes around “on”. I’ll build a set of test cases today to see if I can get any further idea as to what’s happening.
Try the following, I added initial_state: ‘on’ to your automations as sometimes HA turns the automation off during startup. Also it doesn’t matter if you use single or double quotes as long as they are paired together.
input_boolean:
repeat_reminder:
name: Repeat Electric Blanket Reminder
initial: off
automation:
- alias: 'Electric Blanket Enable Input Boolean'
initial_state: 'on'
trigger:
platform: time
at: '20:58:00'
action:
service: input_boolean.turn_on
entity_id: input_boolean.repeat_reminder
- alias: 'Electric Blanket Reminder'
initial_state: 'on'
trigger:
platform: time_pattern
hours: '21'
minutes: '/5'
condition:
condition: state
entity_id: input_boolean.repeat_reminder
state: 'on'
action:
service: tts.google_translate_say
entity_id: group.google_home_devices_all
data:
message: "It's cold outside. Time to turn on the electric blankets and close the bedroom curtains."
I spent a lot of time on this. Even pulled the relevant entities out of the database as I wasn’t trusting the state panel. In the issue I opened, I listed some test cases that trigger with the identical condition to the time_pattern condition.
There was another issue opened along similar lines some time ago, but the op did not provide some information that was requested and it was closed, so I think this issue might have been around for a while
I completely forgot about that particular Issue (21547)! I had tested the scenario (repeat every 5 minutes within a specified hour) but could not replicate the reported bug. Definitely an elusive one!
This was tricky to reproduce because the bug only showed when restarting Home Assistant and hours did not match … and of course, most people testing will just put in the current hour because they are impatient.
When Pete made a test at 17:31 and it triggered at 18:35, I suddenly knew where to look. Good job!