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

Yes, if other people have the issue, there’s no reason to create a new one. Just add your comments to the original.

OK, I commented on github, and waiting to see if is the same or different issue and what fix will be offered, or it will be a bug fix in future version. Thank you PEDRO for all your help!

Its definitely a bug. I only use ZHA so cant comment on Z2M, but I think I’ve proved the issue on the screenshots I posted on this thread:

Same problem here, can’t select ZHA devices anymore in automation trigger.

Why you closed the issue on github?

The original issue 89972 was closed, but the new one that was raised is still open.

You meant this one? Because I don’t have a log error and I am running on Home Assistant 2023.7.1

use a numeric state trigger instead (2 options above state in my screenshot).

not really.

it is a full-fledged member of the automation arsenal just as much as a device is.

and IMHO, it’s better to not use device triggers due to some inherent drawbacks when using them.

Namely, that when you use a device instead of a state if the device fails and needs replaced then there is no easy way to update the automations that use the old device id to use the new device id aside from going in to every automation and manually updating the device id to the new one. that’s because every device always gets unique id and can’t easily be changed by the user.

if you use an entity state then the target entity_id can be updated to use the same entity_id as the old one and then every place that entity_id is used just works.

it’s probably fine if nothing ever breaks or needs replaced for upgrades etc. tho.

and as you’ve found not every integration/device provides a “device” inside HA. in that case you have only one option and that’s to use an entity_id state/numeric_state etc.

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.