-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Intercept node name and location changes from outside UI #3591
Comments
@spudwebb Problem is that actually I have no way to detect that node name and location changed on driver so that's why you don't see it there, if you restart the application you probably will see it correctly |
@robertsLando 2024-02-09 09:00:16.640 INFO Z-WAVE: [Node 005] Value added 5-119-0-name => My Test Dimmer and it seems that ZWave JS UI get this info because it creates a "Node Naming and Location v0" CC with the name and location values: but after a restart of the application you can see that this CC is gone, and the name and location fields are still not populated: The device used for these screenshots does NOT support the "Node Naming and Location" command class |
I didn't know about that. If so I could certainly catch those events to upate cached node name and location. Let me get a confirmation from @AlCalzone |
That's correct. The bit about the value IDs vanishing is awkward though, I may have to rethink that. |
@robertsLando I tested the SYNC-NODE-NAME-LOC branch, and the fix only works for node that supports the "Node Naming and Location" CC. Name and Location of nodes that do not support it remain blank after a name or location update on the driver. |
@AlCalzone What is the behaviour when node doens't support name/location CC? Do you still list that cc in defined valueIds or do you emit the |
I think you should ignore the |
@spudwebb try PR now |
@robertsLando , still not working, I don't see any name or location in the UI even though they are set on the driver side. And now it isn't working either for nodes that support name/location CC. |
Ops, typo. Try now sorry. I successfully tested this working by using driver function to emulate a change of node name: const node = driver.controller.nodes.get(78);
node.name = "Test" When I run this I see the observer triggers and the name updates on UI too |
This is working well now. Thank you! |
Thanks for the feedback! Merging now |
@robertsLando, I'm reopening this because it seems that it doesn't work the first time I set the name and location for a node, in this case the driver emit some "Value added" events which does not trigger the renaming in UI
if I set again the same name and location for the same node, now "Value updated" events are emitted and it works
|
@robertsLando it works as expected now thanks! Not related but I wanted to mention it: on my windows machine when I try to run
So my workaround was to run the 2 build commands separately and it worked:
|
Sorry @spudwebb I missed your message, I think you may forgot to install dev dependencies? What are the steps you do to setup your repository? You should run |
I followed the exact instructions found here: https://zwave-js.github.io/zwave-js-ui/#/getting-started/other-methods?id=nodejs-or-pkg-version |
Might be a Windows thing with the single quotes. |
@spudwebb That's really strange because it's exactly what I do on my side, it could be it's a windows issue? I'm not aware of any issue using |
yes it looks like it's a windows issue with the single quotes. If I remove the single quotes for the build target in package.json it works as expected:
|
Ok I think there is no issue in removing it on my side too, thanks for letting me know |
I'm creating a ZWave driver for HomeSeer based on ZWave JS UI and using the ZWaveJS.NET library to communicate with the ZWave JS server.
I want to be able to update the name and location of a node so that when those values are updated within HomSseer they are also updated in ZWaveJS UI.
To do that I tried to use the
ZWaveNode.SetName()
andZWaveNode.SetLocation()
methods of the .NET library which correctly set the values in the ZWaveJS cache (in store/xxxxxxxx.values.jsonl), but it seems that ZWave JS UI completely ignore those values and uses its own instances of name and location that are saved in store/nodes.json.So my question is: is there a way to update the name and location of a node displayed by ZWave JS UI using a command sent to the ZWave JS server?
Alternatively would it be possible to modify ZWave JS UI behavior so that either
(a) if there is no name/location in nodes.json then it uses the name and location from the ZWave JS cache
or
(b) add a setting that will force ZWave JS UI to always use the name and location from the ZWave JS cache
Related discussion zwave-js/ZWaveJS.NET#60
The text was updated successfully, but these errors were encountered: