zwave-js / zwave-js-ui

Full featured Z-Wave Control Panel UI and MQTT gateway. Built using Nodejs, and Vue/Vuetify
https://zwave-js.github.io/zwave-js-ui
MIT License
968 stars 205 forks source link

Enerwave ZWN-SC7 Scene Controller #1640

Closed MYeager1967 closed 3 years ago

MYeager1967 commented 3 years ago

I have one of these scene controllers that I've been using with a Vera Plus for several years. It has never wanted to work with Home Assistant and, as it's on the compatibility list for zwaveJS, I figured things might work now. It does appear in the interface and it's correctly identified and everything, but I can't figure out how to get it to work. Anyone out there actually have one of these working in their system that could point me in the right direction? If it works on a 5 year old Vera, I can't see why it won't work here...

robertsLando commented 3 years ago

@blhoward2 Something related to https://github.com/zwave-js/node-zwave-js/issues/2397 ?

blhoward2 commented 3 years ago

Yes. That device needs to have scene IDs configured, probably in Simplicity Studio for now. Then you add the controller to every group and watch for the events. It is supposed to have a master controller program it, which is the issue.

https://enerwaveautomation.com/product_sheets/ZWN-SC7-InstallGuide.pdf

The PC Controller steps should be similar to these. https://blog.gruby.com/2019/01/04/setting-up-a-leviton-vrcz4-m0z-for-use-with-home-assistant/

MYeager1967 commented 3 years ago

Going to try to figure this out in a few days. Any chance you'd be willing to help out?

AlCalzone commented 3 years ago

The linked manual is pretty vague. Are we sure this doesn't just send Scene Activation commands to the controller?

blhoward2 commented 3 years ago

It's possible. Some googling suggests it's complicated in any event. Here are steps under HomeSeer: https://forums.homeseer.com/forum/homeseer-products-services/system-software-controllers/hs4-hs4pro-software/1386053-7-button-scene-controller-enerwave-zwn-sc7-to-be-or-not-to-be

AlCalzone commented 3 years ago

Eh, I'm not 100% sure what Homeseer configures there exactly, but I think those are multiple endpoints with associations to other nodes (or the controller) and the device sends scene activation commands via these associations.

@MYeager1967 Please make a driver log, loglevel debug or silly, re-interview your node and when that is done, attach the logfile here (via drag&drop).

csanner commented 3 years ago

okay, NO idea if this helps or not, but this is how it was used with smartthings: https://github.com/mattjfrank/ZWN-SC7-Enerwave-7-Button-Scene-Controller

AlCalzone commented 3 years ago

Yeah, that helps. The device is configured using the Scene Controller Configuration CC, which tells it which Scene Activation CC commands to send for which button/group. I'm not sure if you can assign each button to a different association group, I'd need a log for that.

So the basic functionality should be supported in the driver - not sure if the applications have support yet.

csanner commented 3 years ago

What kind of log can I get for you? I'll happily run it through its paces if I know where to grab the output from

AlCalzone commented 3 years ago

The one I requested here: https://github.com/zwave-js/zwavejs2mqtt/issues/1640#issuecomment-913703115

csanner commented 3 years ago

Ah, sorry. Missed that as I came in late.

That looks like I need the mqtt set up. I do not. (I tried switching so I could get the panel back after I first set the whole thing up and I could not get it working)

AlCalzone commented 3 years ago

HomeAssistant also has a way to get the driver logs, but I don't know how.

MYeager1967 commented 3 years ago

Sorry I haven't been much help the past few days. I've been working WAY too much. I'll have a good chance to dig into this on Thursday afternoon (I hope). Let me know what I can do to help and how to do it and I'll be happy to oblige. I'd love to get this working without having to put it back on the Vera. I've even looked to see if there's something else out there that's more current that might work "out of the box"...

Looks like it restarted the whole thing when I enabled logging.... zwavejs_2021-09-07.log

blhoward2 commented 3 years ago

This is the modern replacement. Fewer buttons but you now get up to 5x taps per button, plus button held, to react to. https://www.thesmartesthouse.com/products/zooz-700-series-z-wave-plus-scene-controller-switch-zen32

MYeager1967 commented 3 years ago

How difficult is it to use this controller? I'm not against changing it out.... If I can see the events in zwavejs2mqtt and act on them, that would be just fine.

blhoward2 commented 3 years ago

In HA? Not at all. There is a blueprint for it. https://community.home-assistant.io/t/zen32-scene-controller-z-wave-js/292610 Include it and then setup the automation:

image

You can also see and respond to the exact event for each. The button colors and states can also be manually controlled using the set_config_parameter service for more granular control of what's on and when.

csanner commented 3 years ago

I mean, that is cool and if I need more I'll probably be buying those. but I'd like to keep the hardware I already have if possible :) And I'll happily help out with this in any way I can.

AlCalzone commented 3 years ago

https://github.com/zwave-js/node-zwave-js/issues/3309 needs to be solved for full support in the driver. Shouldn't be too hard

Ikcelaks commented 3 years ago

zwave-js/node-zwave-js#3313 should allow setting the dimmingDuration.

Ideally, though, I think it would be nice if clients supported directly calling the set API method to directly set both the sceneId and dimmingDuration in the same call. Home-Assistant supports this specifically for setting lock user-codes (which are very similar), but it doesn't have a way to generically invoke a command class API method as far as I can tell.

MYeager1967 commented 3 years ago

I'd like to keep the current hardware as well, as everyone already knows what each button does...

Ikcelaks commented 3 years ago

This should now be fixed in release 5.6.0

MYeager1967 commented 3 years ago

I'm guessing this doesn't get us anywhere closer to the device actually working?

robertsLando commented 3 years ago

Wait a moment I had a problem with 5.6 release

AlCalzone commented 3 years ago

I'm guessing this doesn't get us anywhere closer to the device actually working?

You can now set the dimming duration and scene ID via the UI. What more do you need?

blhoward2 commented 3 years ago

That's assuming enough sceneId boxes show up. When I tried the Leviton before only half showed up. There are eight scenes as it sends a different one when turning off each button.

MYeager1967 commented 3 years ago

Last I looked, it only had one box to set anything in. The device has 7 buttons. 😀

blhoward2 commented 3 years ago

Try again with the new version, and upload a screenshot within zjs2mqtt please. And a node dump.

MYeager1967 commented 3 years ago

Try again with the new version, and upload a screenshot within zjs2mqtt please. And a node dump.

Happily, but it will be at least tomorrow. How do I do the node dump? Your work on this is exceptional, especially since everyone else including open-zwave basically ignored it.

Ikcelaks commented 3 years ago

There should be one sceneId / dimmingDuration pair for each association group the node has. If this isn't the case, try reinterviewing the node.

Unfortunately, I wrote the code for the Scene Controller Configuration CC, and I don't own a device that supports it, so there may be a bug.

Here's how it should work:

MYeager1967 commented 3 years ago

I'm not sure what command groups the device uses, but there's a few of us that would be more than happy to see this thing working so you should have plenty of help getting logs and such. I'll check this out tomorrow if I get time. I will have to update the container again first as I have the version that was reported to have an error and I may have to re-interview the device. I'll report back when I get that done.

blhoward2 commented 3 years ago

I don't have my devices hooked up anymore, but I think there should actually be two per group for the Leviton. It sends separate on/off scenes for each button, but each button has only one group.

Edit: It has four association groups, but eight scene groups. https://blog.gruby.com/2019/01/04/setting-up-a-leviton-vrcz4-m0z-for-use-with-home-assistant/ I'm not sure which you were describing.

Maybe we need a compat flag where the number of scenes exceeds the number of buttons? @AlCalzone

Ikcelaks commented 3 years ago

Thanks for that link! I'll check the specs more closely. It's possible that I interpreted things wrong, and we never noticed because we didn't have a device to test.

Ikcelaks commented 3 years ago

Double checked the specs, and it very clearly stated that the number of groups should be retrieved using the AssociationCC, so there shouldn't be a distinction between scene groups and association groups, but obviously there is for your device according to the link you shared.

I wouldn't be shocked at all if other scene controllers followed the same pattern of having two (or more) scenes per association group. It should be relatively easy to dynamically determine the number of groups the SceneControllerConfigurationCC supports during the interview by simply performing a Get command on each groupId until we get a response Report for group 0. I imagine @AlCalzone would want that behind a compat flag.

blhoward2 commented 3 years ago

A manufacturer not follow the spec. I'm shocked! Shocked I tell you! I have actually configured my VRCS4 in PC Controller before so I do know those instructions are accurate.

Seriously, though, I can build an image of whatever branch and test this on my test bench. So let me know when whatever you an Al decide is ready.

AlCalzone commented 3 years ago

It should be relatively easy to dynamically determine the number of groups the SceneControllerConfigurationCC supports during the interview by simply performing a Get command on each groupId until we get a response Report for group 0. I imagine @AlCalzone would want that behind a compat flag.

Hmm, interesting approach. In another issue we discussed specifying the actual number of scenes as a compat flag, but since we'll query each scene anyways (do we?), this should be okay. I'd still put it behind a flag to avoid unnecessary timeouts for confirming devices.

@blhoward2 you could check if the current version at least lets you configure the device's first few scenes.

Ikcelaks commented 3 years ago

The idea was that the first time we performed a Get asking an unsupported groupId, the node would tell us by replying with a Report for groupId = 0, which would tell us we'd gone past the end. However, I just took a look and saw that returning a Report with groupId = 0 is only a "SHOULD" according to the specs. 👎

Personally, I think it's a bad idea to depend on a timeout to tell us that we've queried all the valid groupIds. Let's go with having the compat flag explicitly set the number of groups.

OR we could just remove the bounds check and let users send to whatever groupId they want, although that wouldn't play nice with discovery and using the setValue API.

MYeager1967 commented 3 years ago

I updated and re-interviewed the device and it looks like I still only get one scene select box. What can I do to help now?

Went ahead and re-enabled logging and waited for it to completely finish startup. Then I re-interviewed the node. Attached is the log with EVERYTHING that it logged between the start of the interview and the time it states it was completed. Another device updated, but it's easy to see those entries.. zwavejs2mqtt.log .

Ikcelaks commented 3 years ago

@MYeager1967 can you get the "Debug Info" for the node?

I'm surprised that you're only seeing one entry for Association Command Configuration, because the configuration file explicitly defines 7 association groups.

MYeager1967 commented 3 years ago

{ "id": 44, "name": "Patio Scene Controller", "loc": "", "values": [ { "id": "44-43-0-sceneId", "nodeId": 44, "commandClass": 43, "commandClassName": "Scene Activation", "endpoint": 0, "property": "sceneId", "propertyName": "sceneId", "type": "number", "readable": true, "writeable": true, "label": "Scene ID", "stateless": false, "min": 1, "max": 255, "list": false, "lastUpdate": 1631824163393 }, { "id": "44-43-0-dimmingDuration", "nodeId": 44, "commandClass": 43, "commandClassName": "Scene Activation", "endpoint": 0, "property": "dimmingDuration", "propertyName": "dimmingDuration", "type": "any", "readable": true, "writeable": true, "label": "Dimming duration", "stateless": false, "list": false, "lastUpdate": 1631824163394 }, { "id": "44-114-0-manufacturerId", "nodeId": 44, "commandClass": 114, "commandClassName": "Manufacturer Specific", "endpoint": 0, "property": "manufacturerId", "propertyName": "manufacturerId", "type": "number", "readable": true, "writeable": false, "label": "Manufacturer ID", "stateless": false, "min": 0, "max": 65535, "list": false, "value": 282, "lastUpdate": 1631824163394, "newValue": 282 }, { "id": "44-114-0-productType", "nodeId": 44, "commandClass": 114, "commandClassName": "Manufacturer Specific", "endpoint": 0, "property": "productType", "propertyName": "productType", "type": "number", "readable": true, "writeable": false, "label": "Product type", "stateless": false, "min": 0, "max": 65535, "list": false, "value": 2049, "lastUpdate": 1631824163394, "newValue": 2049 }, { "id": "44-114-0-productId", "nodeId": 44, "commandClass": 114, "commandClassName": "Manufacturer Specific", "endpoint": 0, "property": "productId", "propertyName": "productId", "type": "number", "readable": true, "writeable": false, "label": "Product ID", "stateless": false, "min": 0, "max": 65535, "list": false, "value": 2819, "lastUpdate": 1631824163395, "newValue": 2819 }, { "id": "44-134-0-libraryType", "nodeId": 44, "commandClass": 134, "commandClassName": "Version", "endpoint": 0, "property": "libraryType", "propertyName": "libraryType", "type": "number", "readable": true, "writeable": false, "label": "Library type", "stateless": false, "list": true, "states": [ { "text": "Unknown", "value": 0 }, { "text": "Static Controller", "value": 1 }, { "text": "Controller", "value": 2 }, { "text": "Enhanced Slave", "value": 3 }, { "text": "Slave", "value": 4 }, { "text": "Installer", "value": 5 }, { "text": "Routing Slave", "value": 6 }, { "text": "Bridge Controller", "value": 7 }, { "text": "Device under Test", "value": 8 }, { "text": "N/A", "value": 9 }, { "text": "AV Remote", "value": 10 }, { "text": "AV Device", "value": 11 } ], "value": 2, "lastUpdate": 1631824163395, "newValue": 2 }, { "id": "44-134-0-protocolVersion", "nodeId": 44, "commandClass": 134, "commandClassName": "Version", "endpoint": 0, "property": "protocolVersion", "propertyName": "protocolVersion", "type": "string", "readable": true, "writeable": false, "label": "Z-Wave protocol version", "stateless": false, "list": false, "value": "3.42", "lastUpdate": 1631824163395, "newValue": "3.42" }, { "id": "44-134-0-firmwareVersions", "nodeId": 44, "commandClass": 134, "commandClassName": "Version", "endpoint": 0, "property": "firmwareVersions", "propertyName": "firmwareVersions", "type": "string[]", "readable": true, "writeable": false, "label": "Z-Wave chip firmware versions", "stateless": false, "list": false, "value": [ "1.3" ], "lastUpdate": 1631824163396, "newValue": [ "1.3" ] } ], "groups": [ { "text": "Group 1", "endpoint": 0, "value": 1, "maxNodes": 32, "isLifeline": false, "multiChannel": false }, { "text": "Group 2", "endpoint": 0, "value": 2, "maxNodes": 32, "isLifeline": false, "multiChannel": false }, { "text": "Group 3", "endpoint": 0, "value": 3, "maxNodes": 32, "isLifeline": false, "multiChannel": false }, { "text": "Group 4", "endpoint": 0, "value": 4, "maxNodes": 32, "isLifeline": false, "multiChannel": false }, { "text": "Group 5", "endpoint": 0, "value": 5, "maxNodes": 32, "isLifeline": false, "multiChannel": false }, { "text": "Group 6", "endpoint": 0, "value": 6, "maxNodes": 32, "isLifeline": false, "multiChannel": false }, { "text": "Group 7", "endpoint": 0, "value": 7, "maxNodes": 32, "isLifeline": false, "multiChannel": false } ], "neighbors": [], "ready": true, "available": true, "hassDevices": {}, "failed": false, "inited": true, "hexId": "0x011a-0x0801-0x0b03", "dbLink": "https://devices.zwave-js.io/?jumpTo=0x011a:0x0801:0x0b03:1.3", "manufacturerId": 282, "productId": 2819, "productType": 2049, "deviceConfig": { "filename": "/usr/src/app/store/.config-db/devices/0x011a/zwn-sc7.json", "isEmbedded": true, "manufacturer": "Wenzhou MTLC Electric Appliances Co., Ltd.", "manufacturerId": 282, "label": "ZWN-SC7", "description": "Scene Controller", "devices": [ { "productType": 2049, "productId": 2819 } ], "firmwareVersion": { "min": "0.0", "max": "255.255" }, "associations": {} }, "productLabel": "ZWN-SC7", "productDescription": "Scene Controller", "manufacturer": "Wenzhou MTLC Electric Appliances Co., Ltd.", "firmwareVersion": "1.3", "protocolVersion": 3, "nodeType": 0, "endpointsCount": 0, "endpointIndizes": [], "isSecure": false, "security": "None", "supportsSecurity": false, "supportsBeaming": true, "isControllerNode": false, "isListening": true, "isFrequentListening": false, "isRouting": false, "keepAwake": false, "maxDataRate": 40000, "deviceClass": { "basic": 2, "generic": 2, "specific": 2 }, "deviceId": "282-2819-2049", "status": "Alive", "interviewStage": "Complete", "statistics": { "commandsTX": 1, "commandsRX": 0, "commandsDroppedRX": 0, "commandsDroppedTX": 0, "timeoutResponse": 0 }, "lastActive": 1631824163396, "_name": "Patio Scene Controller" }

Here's the info on the installation:

zwavejs2mqtt: 5.6.0 zwave-js: 8.3.1 home id: 4239462396 home hex: 0xfcb10ffc

MYeager1967 commented 3 years ago

image

MYeager1967 commented 3 years ago

I'm assuming this is where I should see the multiple selection windows?

AlCalzone commented 3 years ago

@MYeager1967 Please re-interview the device again, make a driver log, loglevel debug or silly and attach it here as a file.

The scene ID above is for Scene Activation CC (what the device sends the controller when a scene is activated), not the Scene XYZ Configuration CCs (which configure what the device sends).

MYeager1967 commented 3 years ago

Ok. I didn't edit anything out of the log so it's ALL there.... Hopefully you'll see something useful.. I don't have anything else that I can select much for. Don't have the scene configuration stuff here. I do have a scene section under wzave2mqtt that I have started to populate, but I have no way currently to access that from this device. zwavejs2mqtt.log .

AlCalzone commented 3 years ago

That's not a driver log. Check my link.

MYeager1967 commented 3 years ago

That's not a driver log. Check my link.

Right switches, wrong section. Sorry.... I promise I'm capable of learning.... This is the log you're looking for!

zwavejs_2021-09-16.log

AlCalzone commented 3 years ago

So, the device does actually support 7 association groups, not 4 like that other controller. However your log contains a bunch of these messages

[Node 044] Timed out while waiting for a response from the node

meaning the driver doesn't get any response at all to some queries. This includes the queries of the CC versions and the entirety of Scene Controller Configuration CC.

I fear this will make it more or less impossible to configure the device via the UI elements. What you can try is executing a custom driver function (which I believe is not documented @robertsLando?):

await driver.controller.nodes.get(44).commandClasses["Scene Controller Configuration"].set(
  1, // this is the group #
  5, // this is the scene ID it should send
  "5s", // this is an optional transition duration for the scene
)

Or to disable a scene:

await driver.controller.nodes.get(44).commandClasses["Scene Controller Configuration"].set(
  1, // this is the group #
  0
)
MYeager1967 commented 3 years ago

I found this a while back on another site:

ZWN-­‐SC7 has 7 association groups. Here is a sample instruction how to implement a button for a scene. Reader should better be a zwave software programmer.

  1. Include the ZWN-­‐SC7 in a z‐wave gateway controller.
  2. Set up an association group for ZWN-­‐SC7. Use CC_ASSOCIATION. We suggest assign the controller’s nodeID into the group for later use.
  3. Use CC_SCENE_CONTROLLER_CONF to assign the scene in the gateway controller to the ZWN-­‐SC7’s button. For command SCENE_CONTROLLER_CONF_SET, parameter groupID is the ZWN-­‐SC7’s asscoation groupID. sceneID is the identity of the scene in you gateway controller.
  4. Press ZWN-­‐SC7 button to test the scene.

I've been told repeatedly over time that this device doesn't seem to follow the standard very well. On the Vera controller, it includes and then you have to go into the setup for the device and point it to the scenes. In the log, it's not getting an answer to the scene controller conf query but is it possible that the controller isn't answering because it's not expecting it and the format is wrong? I'm just spitballing here as this project is way over my head.

AlCalzone commented 3 years ago
  1. is already done since you have the device included
  2. is also done during the first interview (confirmed by your log)
  3. is what I proposed above

In the log, it's not getting an answer to the scene controller conf query but is it possible that the controller isn't answering because it's not expecting it and the format is wrong?

The format is very simple: just the normal CC header (like for every other CC) plus 1 byte group ID. Hard to get that wrong, so I'd say the device just doesn't follow the specs and only implements partial support for the CC (just setting, not reading the config).

If that's the case, don't worry about the timeouts after you're setting the scenes (if the SET command goes through).

csanner commented 3 years ago

so how would I run that custom driver function? Also, is this, by nature of being a "scene controller", limited to setting a "scene" - i.e. is there no way to read an incoming zwave message in, say, node-red and act on that?

Ikcelaks commented 3 years ago

@MYeager1967 and anyone else who is trying to use a scene controller that has already been setup in the past, if your scene controller has always sent scene activation commands to the controller/hub (not directly to other nodes), you might just need to add your controller (probably node_1) to EVERY association group on the scene controller node.

Then you can listen for the scene activation events in home assistant or whatever system you're using.