-
Notifications
You must be signed in to change notification settings - Fork 24
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
Preserve dali lamp configuration across restart #39
Comments
You have a conventional switch ? That is not a standard DALI setup, DALI controllers should always be powered on and lamps turned on/off through a DALI switch But I can agree on having a persistent storage of DALI devices |
Yes, I have SSR switch that i use for switching lamps. I was thinking how can we support persistent configuration in
@dgomes what you think? |
You should connect your SSR switches to a device like https://www.lunatone.com/en/product/dali-mc4l-din-rail/ If lights are disconnected (not just off, but without any means of controlling through DALI) then their state should be |
you mean case 2, yes? |
my point is that we should:
No further case necessary, if the lamp is really removed you should just edit devices.yaml and remove the lamp (eventually we can create an MQTT command that does that for you) |
When the lamp is in the offline state do we support topic for this lamp? I see one problem with offline state. When we raport state=offline to HA entity will be disables and we will don't have posibility to change this from HA( maybe from automation ). With state=off it's much easier, entity in HA is active so we can change state. In my scenerio were there is SSR switch and DALI dimmer I create group light for this two element and automation for brightness Automation code
I know that this is my home setup that i can change. I also agree that the best and simplest situation is when dali device is always connected but I think(didn't check) this isn't mandatory. Dali support command 0x2D: "SET POWER ON LEVEL", so if there is a setting for I don't think there is one right way to solve this, so let's give possibility to choose what should be reported via MQTT? (via variable) |
If the DALI device is powered off you cannot send any commands to it. In a DALI system devices are always connected (meaning they are powered) to the DALI bus and receiving commands even when the light is turned off. Your use case is by no means a normal DALI use case because you are removing power from the DALI lamps and making them unreachable. You should turn on and off a DALI lamp using DALI commands not removing the device power. All this being said, if a light is unavailable (HA state) it can go from that state to on, and therefore your automation would still work. The big difference is that HA would recognise that the lamp is unavailable and can not receive any DALI command to turn on/off or dim |
What is the setting 0x2D: "SET POWER ON LEVEL" for? I ask out of curiosity.
I'm aware of this.
Is there a way from HA automation to change this? If the lamp is unavailable how MQTT message should look? What about abandoned devices in the mqtt broker and HA, when we delete entry in device.yaml? Are we going to delete them or leave them? |
Not sure what you want to change... If the lamp is unavailable, we publish on the availability topic (https://www.home-assistant.io/integrations/light.mqtt/#availability) a False message. 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 |
If you are using this to turn on your lights, I hope you don't have DALI in your bedroom, I wouldn't like to be waken up in the night after a powerloss 😉 |
In my situation SSR stay off so the light will also be off. But I'm using this for night light startup to prevent flash. I setup this to the lowest supported value, turn on Fade IN. When I turn on lamp the light brightens smoothly.
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. |
if the device is no longer present, this should happen yes |
What you think about comparing mqtt topics from dali2mqtt with topics in the mqtt broker. If we find lamp in added by dali2mqtt that we don't have in the device.yaml and we didn't scanned lamp on startup we need to remove lamp from broker. Are you ok with this kind of approeche? |
What does this mean ? we only care about dali2mqtt topics... All topics under dali2mqtt/ are controlled by dali2mqtt daemon and shouldn't be anyone ele messing with these topics |
I mean search broker history for actually unsupported lamps. If we compare mqtt broker history with device.yaml we can find removed lamps and remove them from broker. |
I propose add this in couple i smaller commits:
|
you should not depend on mqtt broker retaining topics |
let's move this conversation to separate issue #47 |
I think that dali lamp scan/full scan should happen only on the first run of the script. After lamp are found information should be saved to file. After restart dali2mqtt script should check if the lamp configuration file exist if so lamps should be fetch from file.
Benefits from the change:
After adding base support for storing lamp information we can use mqtt command to trigger lamp scan, search for new lamps, change configuration like entity_id, name etc.
The text was updated successfully, but these errors were encountered: