Trouble with simple switch triggered Automation

Hello,

I’m building an Automation that will trigger on button presses on a Lutron pico remote. The automation will then Activate a Scene based on which button was pressed. When I use the blue “Press” links on the Pico device page in HA everything works, however when I actually press the buttons it doesn’t work.

The green-boxed event happens with the HA UI “Press”, the Pico remote does not cause that event.

I believe part of the problem is that my Automation is using an Entity State trigger that doesn’t happen when the physical button is pressed. I posted about this earlier. I’m using an Entity State Trigger because I’ve read this is a best practice to make future device replacement less of a headache (i.e., Don’t use Device IDs in automations). I don’t want to just give in and use a Device trigger, I’m hoping that I’m doing something wrong and someone here knows what it is! :wink:

Below is the YAML of my Automation:

alias: Control Media Room Lighting
description: ""
triggers:
  - trigger: state
    entity_id:
      - button.basement_sitting_area_theater_light_control_on
    id: "on"
  - trigger: state
    entity_id:
      - button.basement_sitting_area_theater_light_control_off
    id: "off"
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - "on"
        sequence:
          - action: scene.turn_on
            metadata: {}
            target:
              entity_id: scene.movie_time_2
            data:
              transition: 10
      - conditions:
          - condition: trigger
            id:
              - "off"
        sequence:
          - action: scene.turn_on
            metadata: {}
            target:
              entity_id: scene.movie_over_2
            data:
              transition: 20
mode: single

If you don’t want to use a Device trigger, you will need to use an Event trigger. While I don’t generally recommend using Device triggers, if they give you access to the desired event they’re probably fine for this use case. Event triggers can be a pain to work with too, it’s just a different kind of pain.


There is also a custom integration that you might want to take a look at:

1 Like

Man, that first link you provided “Lutron Caseta Pico Remote Events” got me excited because it sounded exactly like what I’m dealing with, but it’s actually not.

I’m not understanding why there are different entities available in a Device Trigger than there is a State Trigger. For example, on a Device trigger I have all these Entities:

The ones marked in Red are also the “Controls” I see on the Pico Device page. What does that mean? What determines what Entities are shown in the Control card on the Device page? Are those custom binary state entities that are created by the Lutron Integration?

Continuing… with a State trigger I only see those same two entities. Why aren’t all the entities listed on the previous screen shot available?

There aren’t. Those other options you see in the Device trigger are not attached to any entity. They represent Events that the device posts to the Event bus.

One of the main purposes behind Device triggers was to make it easier for new users to trigger off those events without having to take the deep dive into the intricacies of Event triggers.

HA Docs - Integrations - Lutron - Pico Remotes

Thanks for sticking with me. Is it possible you have a slight typo in the above? Maybe “Those entries you see in the Device trigger are not attached to any entity device”? If not, then surprise-surprise… I’m still confused. This has been a humbling experience. I’v been a software engineer for decades and usually get comfortable with technical concepts pretty easily, but this HA stuff is kicking my butt!

I would say Device triggers do seem easier, for sure… they feel natural and what I would expected when building and working with devices like this. But I’m stuck on the issue of replacing hardware and making that process as smooth as I can, which I understand means avoid referencing Devices in automations as much as possible. A quandry…

No.

They are attached to a device… the remote.

Unlike entity-based triggers, these triggers based directly on events will still need to be manually updated if you replace the device. There’s going to maintenance no matter which option you choose… so no real quandary.

If physical button presses raised the same state triggers as the “soft” button presses in HA the below would work and replacing a Pico device would be a matter of assigning the same entity IDs to it. At least that’s my understanding.
Anyway, I do appreciate your effort it working with me on this. I still don’t understand what the heck these “things” are that are listed on the Control card and in the State Trigger but I’ll keep reading and trying and hopefully it will click at some point.

I have to ask just one more question: What is this thing? Is it an Entity?



Yes both button.basement_sitting_area_theater_light_control_on and button.basement_sitting_area_theater_light_control_off are button entities… otherwise they wouldn’t be available to use in State triggers, since only entities have states.