Input Boolean not Toggling On

Can anyone tell me why this isn’t working? I’ve tried all all sorts of things to try and remedy but I can’t seem to get it to trigger on it’s own. I’ve double checked the state value in the developer panel and current state is ‘tomorrow’. Thoughts?

id: '1632836761462'
alias: Boolean Switch - Bins Tomorrow
description: Toggle the Boolean Switch
trigger:
  - platform: state
    entity_id: sensor.trash_day_2
    id: bins1
    to: tomorrow
condition:
  - condition: state
    entity_id: input_boolean.trash_tomorrow
    state: 'off'
action:
  - service: homeassistant.toggle
    target:
      entity_id: input_boolean.trash_tomorrow
mode: single

It has to change from something else to tomorrow to trigger. If it was already tomorrow when you wrote the automation it won’t trigger.

1 Like

Gotcha. Thanks! That might also explain why it didn’t fire this morning since I had it time bound to send the notification in early evening.

I’ll try changing the variable to test it tomorrow (when state = ‘today’)… I’ve never needed to use delay so is this syntax right?

alias: Boolean Switch - Bins Tomorrow
description: Toggle the Boolean Switch
trigger:
  - platform: state
    entity_id: sensor.trash_day_2
    id: bins1
    to: tomorrow
condition:
  - condition: state
    entity_id: input_boolean.trash_tomorrow
    state: 'off'
action:
  - delay:
      hours: 15
      minutes: 0
      seconds: 0
      milliseconds: 0
  - service: homeassistant.toggle
    target:
      entity_id: input_boolean.trash_tomorrow
mode: single

It is but you may want to avoid a delay this long as the delay won’t stay if HA is restarted or in fact if automations are reloaded.

1 Like

A better option may be to use a time trigger at 15:00 and check to see if the trash is due tomorrow in the conditions.

1 Like

You are a GENIUS! I can’t believe I didn’t think of that sooner. Thanks so much for helping out!

2 Likes