HA using for automation entity ID vs entity string? Some devices not showing / missing?!?

what about buttons. Single/double/hold click. They dont have states. How would you do it there?

You could just use a state trigger, rather than a numeric state.

However, reagardless of whether or not its preferred to use or avoid devices, I would reiterate that this does look like a bug and should probably be fixed.

I should also note that this affects automation actions as well, not just triggers. The devices just don’t show up correctly.

1 Like

Yeah, since it was working before 2023.7 I see no reason why would not be working now. Hopefully this gets to the developers and gets fixed in 2023.7.2-3 :slight_smile:

buttons use events if they don’t have a device associated or if you don’t want to use a device trigger :wink:.

you can still use a state trigger for a button because the main state is a timestamp.

trigger:
  - platform: state
    entity_id: button.my_button

Ah ok. I was thinking of a real physical button and not a button entity.

and I think the OP was also based on:

1 Like

Yeah, those are probably ZHA events which would be an event trigger (I would guess), I use Z2M which is a diff event.

However events might be changing in the future to make them easier. So the trigger type may change to state if the current discussions are implemented. (event triggers will still work too)

Everyone, I had reported the issue and was told it will be fixed in 2023.7.3 so wait for it :slight_smile:

Unfortunately 2023.7.3 hasn’t fixed the device search issue.
When searching for the word ‘kitch’ I get this:

And the two suggested devices aren’t anything to do with my kitch(en).

However, if I simply type the letter ‘e’, I can see them:

UPDATE:- looks like the version targeting the fix is 2023.8

Yes, apparently you are correct. There is no fix in2023.7.3 but it will be in 2023.8 for everyone who is waiting. Thanks for the information.

1 Like

Did this get solved?

I’m wondering if I’m having similar issues:

When building automations within the UI, the UI uses device entities (not state entities), so when I’m finished building the automation and then look at the yaml code, it shows a string id as the device entity id Rather than the written out text device entity id.

I’m trying to follow this discussion because it was recommended to use states instead of devices but that seems incorrect since the UI builds everything off of device entities.

I was looking at the yaml code to understand in hopes I could create my first script but doesn’t look feasible.

Thoughts?

You can use entities and states by selecting the correct item in the drop down list.

for triggers and conditions select “state” from the drop down.

for actions select “service” in the drop down.

It al works now, it was fixed!

For inovelli blue zigbee light switches, the button presses are recognized as devices rather than states. But again those entity IDs when looking at yaml code are not shown as friendly names

Button presses are events, devices make the event’s “easier to use” for beginners. You can use event trigger if you are advanced enough to avoid using device based triggers.

The number you see next to the entity_id in a device trigger is the entity registry id. It’s a value that points to the entity, which in turn has an entity_id. It’s so that you can change the entity_id without it impacting your device based triggers. If you use yaml, you don’t need to use that number.

Seems like that defeats the purpose of a user friendly UI if the solution is to edit yaml.
Admittedly, I’m new to HA but it’s overwhelming and daunting for a beginner to always be directed to yaml whenever there is an issue (which seems to be quite frequently).

If yaml doesn’t require the entity id number then the ui shouldn’t either.

There should at least be a place within the UI where I can see what these registry entities are….its completely a mystery when trying to create an automation. Is there a simple table or something?

The pinned topic in configuration covers this.

No, the pinned topic does not cover my question. I understand that you can find entities and their states within developer tools, while the label for the entity is a text label, it’s not the numeric label that I’m seeing that shows up when you go to the YAML code.

The yaml code shows a long number string as the entity id instead of a text label

It shows a device ID and an entity ID that is nowhere to be found in the UI.

It won’t let me upload a pic to show the difference. These are in available blue switches that do not show up with regular friendly name entity IDs. Somewhere in the yaml code it has to be a table that lists these numeric values that represent entity IDs that are then relabeled as friendly IDs.

You shouldn’t be using yaml to alter device triggers, conditions, or actions. Those were built to be managed via the UI, the fields are filled with unique identifiers. These are in place so that you can alter the entity_id without breaking the device trigger, action, or condition.

If you must know them, they are the entry id, which can only be seen in templates at the moment.