dgomes / dali2mqtt

DALI <-> MQTT bridge
MIT License
45 stars 23 forks source link

Lamp delation #47

Open AdamN1 opened 3 years ago

AdamN1 commented 3 years ago

fallows conversation from https://github.com/dgomes/dali2mqtt/issues/39#issuecomment-834496089

Abandoned devices: we should no longer publish them to the discovery topic. In HA there is yet to exist an API to remove devices... currently you need to use the UI

Will you to accept PR with code for deleting missing lamps(remove from device.yaml)? By deleting I'm mean cleaning mqtt on the broker by the dali2mqtt. I know it's hack but it will help mqtt entity in the HA to stay clean.

AdamN1 commented 2 years ago

@dgomes ??

dgomes commented 2 years ago

and how will you distinguish those ?

I think we should move away from retained topics and publish the topics upon home assistant restart

AdamN1 commented 2 years ago

and how will you distinguish those ?

We can get list from mqtt server and compare records in topic.

I think we should move away from retained topics and publish the topics upon home assistant restart

I don't think that I understand what you mean

dgomes commented 2 years ago

discovery topics need to be there only during HA start, you don't need to "store" them in the MQTT broker using the retain flag.

Each time HA starts it already publishes a message, dali2mqtt should subscribe to that message and publish all the lamps without retain flag, in this way there is no need to clear topics as they are never retained.