Automations for Input Boolean switches not working

I have quite a few Input Boolean switches with automations attached to them for when they’re switched on or off.

In the past they’ve all worked fine, but they all stopped working a few weeks ago. I run Home Assistant via Docker which automatically updates itself, so I wondered if there was a breaking change in a recent update that’s stopped them working. I’ve looked through the release notes but couldn’t find anything.

Here’s some typical automations that used to work fine, but no longer work

input_boolean:
  living_room_late_evening:
    name: 'Late Evening'
    icon: mdi:weather-night


automation:
  - alias: 'Living Room Late Evening on'
    trigger:
      - platform: state
        entity_id: input_boolean.late_evening
        to: 'on'
    action:
      - service: scene.turn_on
        entity_id: scene.living_room_lights_on

  - alias: 'Living Room Late Evening off'
    trigger:
      - platform: state
        entity_id: input_boolean.living_room_late_evening
        to: 'off'
    action:
      - service: scene.turn_on
        entity_id: scene.living_room_lights_off

Does anyone know why they've stopped working?

I’ve got around ten input booleans and I’m on v74.0 and they all work fine in my automations.

1 Like

Thanks. I might try a new install of HA and recreate the automations. Maybe that would sort it out :slightly_smiling_face:

Shouldn’t the following match? Or do you have another input_boolean?

entity_id: input_boolean.late_evening

and

entity_id: input_boolean.living_room_late_evening

1 Like

Yeah, that was a typo. I checked the code of all of my Input Boolean automations, and it looks fine (to me), plus they all used to work fine.

Have you determined whether it’s the trigger or the action that doesn’t work? E.g., have you tried to manually trigger the automations to see if the action works? And when you change the input_boolean, have you looked in the log to see if the automation was triggered (or looked at the last_triggered attribute of the automation)?

No, I’m away at the moment. I’ll look at that when I get back in a few weeks. Thanks.

I don’t know if it will help or not, but I put a post up last week about troubles I was having with Google Calendar based lights using input_boolean’s. I ended up resolving it my self, but it might help to compare your setup to what I have done.

How are you triggering your input_boolean’s?

RESOLVED - Google Calendar based lights

Thanks, I’ll take a look when I get back.

I have automations attached to some Input Boolean switches. Switching on triggers one automation, switching off triggers another.

I’m guessing you are running into an issue when the input boolean is on, and the automation is sending an ‘on’ to the input boolean. At that point in time, nothing will happen due to the fact that HA suppresses 'turn_on’s for input booeans when the input boolean is on.

Swap your input booleans for template switches that reference an input boolean and everything should work at all times. It’s sounds stupid but it will always fire offs and on’s regardless of the switches state.

Next hide the input_boolean from your interface and only use the switch. The input boolean will still store the on/off state of your scene. The switch will behave like a normal switch where the state comes from the input boolean, and the on’s/off’s aren’t suppressed based on the state.

Get rid of your automation too.

input_boolean:
  living_room_late_evening:
    name: 'Late Evening'
    icon: mdi:weather-night
switch:
  - platform: template
    switches:
      living_room_late_evening:
        value_template: "{{ is_state('input_boolean.living_room_late_evening', 'on') }}"
        turn_on:
          - service: scene.turn_on
            entity_id: scene.living_room_lights_on
          - service: input_boolean.turn_on
            entity_id: input_boolean.living_room_late_evening
        turn_on:
          - service: scene.turn_on
            entity_id: scene.living_room_lights_off
          - service: input_boolean.turn_off
            entity_id: input_boolean.living_room_late_evening
2 Likes

Thanks, this looks like a good solution. I’ll give this a try in a couple of weeks when I get back :+1:t3:

I’m back now and have created template switches instead of automations of for the input boolean switches.

So far it’s working much better, thanks!

1 Like

Is the second turn_on: you mean typo it should be turn_off: ?

No, you can’t turn off scenes