-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Home Assistant discovery improvements (including scenes) #19838
Conversation
@Koenkk: I can split the PR if you prefer these to be separate. I've also got some points that still need to be adressed before finalizing the PR:
|
5bb6ab0
to
cc022aa
Compare
I have fixed the tests for the group device info, but I'm not sure I understand Jest well enough to write a meaningful test to add |
Why do you prefer this? It should also contain the
Scenes are also supported for endpoint, so we should add this
You can emit the event form the eventBus directly, example |
Regarding the Whereas the scene name ought not to be part of the actual
OK.
Thanks, that helps, but my main stumbling block right now seems to be how to set up a state with scenes. Would I have to create them using the MQTT mock? |
abe6894
to
65f4795
Compare
65f4795
to
51f34c6
Compare
I think we should include the name in the
Yes, here is an example on how to create them: zigbee2mqtt/test/publish.test.js Line 1410 in 311ea07
|
No, we can't. When the After thinking about it, the easiest way to achieve this would be to provide an optional override parameter |
3b14c4d
to
14e4548
Compare
Agree! |
OK, so it's more complicated than I initially thought. We currently have several different usages of the
|
I think adding an optional postfix to the |
8d400cc
to
540bf49
Compare
540bf49
to
7d18cbb
Compare
All good, many thanks! |
Hi @Koenkk, |
Next release = tomorrow! |
Thank you @mundschenk-at ! |
@jd1900 You get scene entities in HA. @ukmgranger Not sure why they would appear unavailable for you, availability is tied to the standard Z2M mechanism (i.e. both the bridge topic and the specific device/group topic must be available). Are you on a recent-ish HA version? If so, maybe try reloading the MQTT integration. |
@mundschenk-at Sorry - my bad - I deleted my post just after I wrote it. It was just a full restart of HA that fixed things (should have known). |
If it happens again (say with future discovery improvements 😅), a reload of the MQTT config entry should normally be enough to get things on track again. |
I don't know if it is related to this feature, but after I updated I can not add scenes via the z2m web interface to a single light any more: Adding a scene triggers error (red pop-up) "Publish 'set' 'scene_store' to 'Licht Esszimmer Mitte' failed: 'Error: Not a group'". |
That's an error message from |
I'm having a bit of a nightmare with the scenes at the moment! They seem to randomly change their name (discovered scenes) in HA to either add or remove a suffix. So for example I have a scene called 'scene.kitchen_0_kitchen_bright'. This then becomes 'scene.kitchen_0_kitchen_bright_2'. There are other scenes which have the '_2' at the end, which then gets removed. This obviously throws out all my automatons in NR and my many scene buttons on my Dashboard. |
@ukmgranger I don't see this (but I'm on |
I have also experienced the name changes in scenes and was wondering why may HA automations stopped working. |
@mundschenk-at No I have removed all other HA created scenes for the kitchen. It's almost like it's discovering the scene from Z2M more than once causing the scene to change names. It's happening on many of my scenes. |
Huh, can you check the MQTT info whether there are multiple discovery payloads? |
@ukmgranger @theRealAJR Do you remember what you did before those duplicate entities showed up (editing scenes etc.)? I'll try to reproduce the issue, but I need some starting points. |
You know, I think this is the same core issue as #12610. I'll add a delay before republishing the scene data there too. |
I have also experienced the name changes. The patch to prevent scene entities from being duplicated is going to stable branch soon? |
It's not merged into |
I played with it again yesterday. Scenes in the same group were renamed when other scenes were added. There are scenes with suffix _2 now i.e. in the same group some scenes have that suffix and some don't. |
@theRealAJR Are you on the most recent |
no, 1.34.0 commit: aae7312 |
Ah, OK. This has already been fixed via #20097. |
object_id_postfix
key in the discovery payload to customize theentity_id
in Home Assistant.