Home Assistant Community

Automation toubles, they did work now they dont

#1

Can anybody help please. Running latest HASSIO and use manual config in automations.yaml

having trouble with the following automation. thanks

- alias: "TedTV"
  trigger:
    - platform: state
      entity_id: input_boolean.tedtv
      to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.20146435807d3a4a790c
    - service: media_player.turn_on
      data:
        entity_id: media_player.living_room
    - service: media_player.select_source
      data:
        entity_id: media_player.living_room
        source: av2
    - service: switch.turn_on
      entity_id: switch.sony_tv
#2

What exactly do you mean by this? What trouble are you having? Does it not work at all? Does it run, but do the wrong thing? Does it not validate? Does it work if you trigger it manually, but does not trigger automatically?

1 Like
#3

ta for the head sup :wink:

Triggering the input boolean, did used to trigger the automation (automation is enabled/on). Then it began to only partially work switch.sony_tv worked ok, but the media player switch didnt. Now nothing works. I also had a Broadlink RMMini command in the mix but removed that, as it didnt work either.

I can trigger the entities manually no problem.

thanks]

#4

Ok, so I would first verify that the automation is indeed being triggered, as a sanity check. This is simple to check, if you go to the dev-state page (<>) and go to your automation, you can see the last triggered time.

There’s no chance that this automation has a duplicate alias of another automation, right?

Once you know 100% that the input boolean is triggering the automation: You said that you can trigger each individual action on it’s own. Is that using the same format as you use in the automation? For example, go to the dev-service page, and manually trigger each action using the service data the same as in you automation. IE

Service: switch.turn_on
Service Data: 
{
  "entity_id": "switch.20146435807d3a4a790c"
}

Then

Service: media_player.turn_on
Service Data: 
{
  "entity_id": "media_player.living_room"
}

Then

Service: media_player.select_source
Service Data: 
{
  "entity_id": "media_player.living_room", 
  "source": "av2"
}

Etc

If every one of those actions works correctly, with the same service data in your automation, then there’s something else screwy. You can try to delete all but 1 action from that automation, and make sure that each action by itself works, then build it back up to all of them, and see where it fails.