Z-Wave.me: Allow updating entities#167839
Z-Wave.me: Allow updating entities#167839Tomeamis wants to merge 6 commits intohome-assistant:devfrom
Conversation
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Hey there @lawfulchaos, @Z-Wave-Me, @PoltoS, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
Which use case or bug will this solve or fix? |
joostlek
left a comment
There was a problem hiding this comment.
CI is failing, can you take a look?
I have a dimmable light that doesn't push updates to the controller. The controller seems to expect that, so after it issues a Set command, it also tries to get the value from the device. Unfortunately, if the change is slow enough, the update happens before the value changes, so the controller seems to think that nothing has changed. I tried to force the update from a HA script, but it did nothing. This ensures that the update command actually goes to the device, thus alerting the controller that changes are happening. |
Done. Now the only failure is the test coverage, and there were no tests for this to begin with. |
This sounds more like it should be solved in the zwave_me_ws library, rather than here in the consuming application (Home Assistant) 🤔 |
How so? You can't force update from HA if the HA integration ignores the command. The library you linked is just a wrapper around their websocket API, which does nothing on its own. The attempted update logic is in the controller, which indeed has many places that could be improved, but sadly, they aanounced that there will be no new versions. Also, what exactly is bad about Home Assistant being able to solicit an update from the device? |
|
Besides the update method should be placed in the base |
I have thought about putting it there, but I wasn't sure that I should do that with all device types, since I can only test a few. But if you think it's better, I can move it. AFAIK all the device types either support the "update" command or ignore it, so it shouldn't break anything. EDIT: Also, most devices do report the changes themselves, so it's not like the integration should just call the "update" command after every change command. |
|
The update process should not be in the integration, but rather in Z-Way itself. Z-Way is smart enough to detect that the device supports Supervision and LifeLine. If so, it won't do additional updates. Otherwise, it will poll the device itself after the update. If the device, on getting a Set and then a Get, will return the old value and no unsolicited report, it is a big device issue. You can write a script to poll such a device on Get (tricky, but doable). But better to check first:
|
It doesn't support Supervision. And yes, it does poll the device after the Set. But it doesn't seem to take the Set duration into account, it just issues a Get immediately, and if that returns a different value, (apparently) every 2 seconds thereafter until it returns the same value. Unfortunately, if the duration is, for example, 10 minutes, that makes for one tick every 6 seconds, so the 2 second Get interval returns the same value and the polling ends. Also, in your opinion, would it cause any issues if I just put the |
|
I got your point about a very slow Set. Make sense, I'll check if we can improve Z-Way to change 2s to depend on the duration (if it is set). Good idea! Issue created.
Won't harm if it is not called periodically. |
|
I moved the update to ZWaveMeEntity, tested it with some other devices and it seems to work fine.
Oh, nice. I thought the development was over. I looked in the GitHub repos and couldn't find it, would you mind linking it? |
Proposed change
Makes entities from the Z-wave.me integration support being explicitly updated
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: