thomasloven / hass-plejd

🔹 Plejd BLE integration for Home Assistant
96 stars 9 forks source link

Hidden switches don't show up #64

Closed pierrei closed 6 months ago

pierrei commented 6 months ago

I just tried out the project and boy does it work well! Apart from one thing :D

I have a few switches (SPR-01) that are configured in the Plejd app to be hidden from the room they're in. These do not show up in HA at all. I have to un-hide them in the Plejd app and restart HA, then they show up. Would be amazing if devices for these switches were created in HA and set to hidden there when they are hidden in Plejd.

Thanks for a great project!

pierrei commented 6 months ago

I had a look and this might be in the direction of what I'm thinking: https://github.com/thomasloven/hass-plejd/compare/master...pierrei:hass-plejd:pierrei/add-hidden-devices

oyvindwe commented 6 months ago

@pierrei I think you are on the right track with this change. Have you tested it out locally?

thomasloven commented 6 months ago

Looks good to me. Would you mind making a PR?

pierrei commented 6 months ago

I'll test it myself now and if all works well I'll create a PR 👍

pierrei commented 6 months ago

Yes, it's working well! The devices show up in the device list but the switches in this case are hidden "by integration". I'll create the PR!

Device:

Screenshot 2024-05-10 at 09 14 32

Individual switch settings:

Screenshot 2024-05-10 at 09 14 48
pierrei commented 6 months ago

https://github.com/thomasloven/hass-plejd/pull/65

pierrei commented 6 months ago

Is there anything we need to account for on updates btw? If the integration has been set up and devices created, if a user later hides something in Plejd should we also push an update to HA to update visibility? 🤔

oyvindwe commented 6 months ago

Is there anything we need to account for on updates btw? If the integration has been set up and devices created, if a user later hides something in Plejd should we also push an update to HA to update visibility? 🤔

That is not supported by HA according to the documentation for entity_registry_visible_default:

Return if the entity should be visible when first added.

This only applies when fist added to the entity registry.

I think this is as good as it gets!

thomasloven commented 6 months ago

Closed by #65