-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Aeotec Minimote Scene Mode Setting Not Retained After Re-Interview #4088
Comments
You'll need to enable driver debug logs and post those instead of the application ones for a proper diagnosis. I've been using the Minimote for years, including with Z-Wave JS, and the "undefined" values have no impact on behavior for me. I feel like I looked at this in the past and found the the parameters are write-only, e.g. the device fails to respond when reading the values (could be the failure you've listed) and as a result nothing is saved in the driver cache. Driver logs would clarify that. I don't believe I configured mine the same way as you did though, I think I set each button (params 241 to 244) to "Scene Mode" and left 250 unset. The user guide does seem to indicate only setting param 250 is necessary. And how are you using scenes in HA? MQTT? Z-Wave integration? Event entity or event triggers? I am using event triggers with the Z-Wave integration: trigger:
platform: event
event_type: zwave_js_value_notification
event_data:
device_id: !input minimote_device
command_class: 43 # Scene Activation
property: sceneId |
I will work on the logs and post them when I have more detail. i use the scene buttons to interface with Node Red, which monitors the Home Assistant entity "Scene ID" for each of two Minimotes. That worked flawlessly when the Zwave controller was a Vera Edge and never needed to be reconfigured. I recently implemented ser2net on the Vera Edge and use it as a network attached Zwave controller, with Zwave JS UI linked to the remote interface. That also works flawlessly once i have configured the Minimotes as secondary controllers in Scene Mode, but as reported the configuration is not 'sticky' and is lost on restarting Zwave JS UI or Home Assistant. I had for a while set the individual buttons to Scene Mode but that also did not seem to be sticky. The only reason the Minimote stops working is that the Scene ID entity for the remote becomes unavailable in Home Assistant - nothing has been reconfigured in the remote as it is in sleep mode most of the time and is therefore not reconfigured when Zwave JS UI restarts. Immediately after that restart though, Scen ID is flagged as Unavailable. As I say, I will provide logs as soon as I have done some more tests but my gut feeling is that Zwave JS UI should use its cached values for these often-sleeping battery powered devices and should assume that the existing values apply unless a new configuration is received. I will try an automation using the YAML you provided and report back on whether that proves to be 'sticky' across restarts. |
Switching to Z-Wave JS while retaining the original controller and network would not have changed the Minimote configuration. Everything would have transferred over as-is. Unlike other software, Z-Wave JS does not modify config parameters without user input.
I presume you mean your automations stop working. No Z-Wave device is dependent on the availability of the HA entity. Just as a check I just restarted ZUI and the Scene ID entity only goes unavailable while ZUI is restarting (expected). I should also say I'm still on an older version of the driver, I haven't migrated to v14 yet.
Z-Wave JS already does use cached values (for every type of device). The Scene Activation values are not cached because they are events, it would make much sense to cache a scene event that happened minutes/hours/days ago. Additionally, the cached value of the configuration parameter (250) has no effect on how the device behaves, the configuration is stored on the device. Z-Wave JS does not use the config parameter value for any logic related to the scene notifications. |
The HA entity is a product of (created by) the zwave integration and is dependent on the zwave code for its availability. If I understand the code correctly, the zwave integration iterates over the Zwave-JS devices from the code embedded in Zwave JS UI to create the Home Assistant devices and their entities. Because the Minimote is not considered to be in scene mode the Scene ID field is flagged "unavailable".
In my case, it remains unavailable.
i would not expect the scene activation values to be cached, but the configuration value for field 250 should be consistent across restarts for these battery powered devices as they cannot be polled at startup. |
I tried an automation with your code but as expected it does not work after a restart of Zwave JS UI because property sceneid is no longer available. Time to work on the debug log. |
ZJSUI logs 1_buttons_pressed.log Details of the attached logs:1: Although the sceneID event is disabled in the zwave integration, button presses show in the logs of both ZJSUI and the integration. There is a clear difference between (1) and (5) in that when I specifically set field 250 to disabled I get no button presses logged, but if I enable scene mode in field 250 and then restart ZJSUI the zwave integration shows sceneID as unavailable yet button presses are registered in the logs. I think that this shows:
The only conclusion I can draw from this is that ZJSUI is not configuring the node correctly after a restart. |
One final test: I enabled scene mode in field 250 but also for each of the four buttons. My automations worked as normal. I then restarted ZJSUI with the same result as before: sceneID became unavailable and my automations stopped working. Setting the buttons to scene mode therefore makes no difference. |
zwave_js-01JF7SE7B4HRK5Z7R95C000ZJ6-Minimote White-851f8cf40b09086212a9dfa662417d57.json Apologies for bombing you with information but I just downloaded diagnostics for one remote from the Zwave integration after enabling scene mode in field 250 and waking the remote to ensure that the value was set there. The diagnostics include the following which incorrectly claims that scene mode is disabled: {
"domain": "select",
"entity_id": "select.minimote_white_scene_mode_secondary_controller",
"original_name": "Scene Mode (Secondary Controller)",
"original_device_class": null,
"disabled": true,
"disabled_by": "integration",
"hidden_by": null,
"original_icon": null,
"entity_category": "config",
"supported_features": 0,
"unit_of_measurement": null,
"value_id": "50-112-0-250",
"primary_value": {
"command_class": 112,
"command_class_name": "Configuration",
"endpoint": 0,
"property": 250,
"property_name": "Scene Mode (Secondary Controller)",
"property_key": null,
"property_key_name": null
}
} This explains why the sceneID event field is disabled. The question remains: why does ZJSUI or ZJS think that scene mode is disabled when it is not? |
Unfortunately none of the new logs you attached are driver debug logs, so there is no new information provided by the logs. We would really need to see those driver logs to possibly know more. Despite that, I can provide some clarifications based on the other new information.
Actually the diagnostic provided says it's enabled. The "values": {
"50-112-0-250": {
"endpoint": 0,
"commandClass": 112,
"commandClassName": "Configuration",
"property": 250,
"propertyName": "Scene Mode (Secondary Controller)",
"ccVersion": 1,
"metadata": {
"type": "number",
"readable": true,
"writeable": true,
"label": "Scene Mode (Secondary Controller)",
"default": 0,
"min": 0,
"max": 1,
"states": {
"0": "Disable",
"1": "Enable"
},
"valueSize": 1,
"format": 1,
"allowManualEntry": false,
"isFromConfig": true
},
"value": 1
}
No, the
It doesn't think it's disabled (see above), so your attention should focus on the {
"domain": "event",
"entity_id": "event.minimote_white_scene_id",
"original_name": "Scene ID",
"original_device_class": null,
"disabled": false,
"disabled_by": null,
"hidden_by": null,
"original_icon": null,
"entity_category": null,
"supported_features": 0,
"unit_of_measurement": null,
"value_id": "50-43-0-sceneId",
"primary_value": null
} The event entity state is determined by the
This is exactly what I have been saying all along. The configuration remains on the device and it's irrelevant whether ZUI/HA thinks/knows it's enabled or not. So the problem is the metadata of the "sceneId" value ID is lost on restart and only re-generated during the re-interview. Normally the Scene Activation value IDs will be persisted in cache, this part is required for battery devices. The diagnostic shows
Event triggers have nothing to do with the event entity, so no that is not expected. The event triggers have pre-existed the event entity by several years, completely unrelated except that the source is the same event (Scene Activation Set). If you copied and pasted the trigger exactly as I posted it won't work, you need to fill in your device ID and the desired scene ID (button). You can also go to the Dev Tools event viewer, copy/paste Since you're using an add-on, there's not a good way to downgrade to 9.26.0 which is the last version that used driver v13. That could show whether there is a problem in the newer driver code. I might try an upgrade to reproduce if I can find the time. Otherwise, hopefully you can grab the correct driver logs. |
OK, so clearly I have a lot to learn! I have successfully used the information in your last response to add code to Node Red which responds to zwave_js_value_notification for the two Minimotes and this works irrespective of the availability of Scene ID. For me the current bug becomes moot - thanks for your help there. I attach a device debug log filtered for node 050 (one of my Minimotes). The log contains:
|
Undefined Configuration ParametersRegarding the config parameter values, all of them except 250 are marked as write-only. PR zwave-js/node-zwave-js#2555 is responsible for that, however it neglected to update parameter 250. Here are the Device DB parameters (derived from the config file): Write only: Read/write: During the interview, you can see the read-back of parameters 241-249 are skipped (because they are write-only), and only 250 is queried. The read of 250 fails, so clearly it is also write-only.
So I think this is just a missing setting from the device config file, parameter 250 should be set to write-only. Since the device fails to respond, you will never see a valid value, except maybe temporarily after you set it. Also, neither the Home Assistant UI nor ZUI give any indication that the parameters are write only, it would be nice if they indicated it some way. Missing
|
I installed your override configuration and that does solve the problem with scene ID. I will revert my Node Red code to use that, but keep the new code in reserve in case of future problems. If you have the time to do a PR to fix the issue permanently it would be appreciated and will save you and others having to go through all this again in future. I have learnt a few things but would have preferred to remain in the dark and just have a working system. Thanks for all your efforts on this issue. |
Checklist
Deploy method
Home Assistant Add-on
Z-Wave JS UI version
9.27.8
ZwaveJS version
14.3.7
Describe the bug
After pairing the Aeotec Minimote with Z-Wave JS UI and setting it to Scene Mode (Secondary Controller), the setting is initially applied and works as expected. However, after performing a re-interview (or after restarting zwave-js-ui), the Scene Mode setting is unset, which causes the device to stop working as a remote for triggering scenes in Home Assistant. This behaviour does not occur when the same device is paired with other controllers (e.g., Vera Edge).
Once the field "[50-112-0-250] Scene Mode (Secondary Controller)" is set once more to Scene Mode the "Scene ID" field in Home Assistant's zwave integration shows as "Available" and my Home Assistant scenes work again. This setting will however not persist and the error described above will repeat if Home Assistant or the Zwave JS UI add-on are restarted. At that point manual intervention will again be required.
To Reproduce
Expected behavior
The Scene Mode (Secondary Controller) setting should persist after re-interview or restart and should remain enabled unless manually changed by the user.
Additional context
After a restart of zwave-js-ui the log shows this for one minimote:
Of which the key issue seems to be that parameter 250 is now undefined. At this point scenes do not work. I can awaken the minimote but this will not trigger an interview so the status does not change. If I then re-interview the minimote I get once more:
So scene mode remains unset. If I now set parameter 250 to "Enable" once more I get this in the log:
and scenes work once more
The text was updated successfully, but these errors were encountered: