Skip to content
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

ozw: Homeseer HS-WD200+ dimmer status is not updating when toggling the dimmer #36616

Closed
nemith opened this issue Jun 10, 2020 · 33 comments
Closed

Comments

@nemith
Copy link

nemith commented Jun 10, 2020

The problem

Testing out new ozw integration with my HS-WD200+ switches the state of the switch doesn't initially match (I had the same issue with zwave integration as well)

The on/off switch (HS-WS200+) work fantastic. The result is near instantaneous and works great.

However on the HS-WD200+ if i turn on or off the switch (or change the dimmer) the status toggles and then toggles back before the dimming is complete leaving the switch in the wrong state. Toggling it again fixes the problem

For example if my lights are on toggling the dimmer to off will toggle the HA state to off and the immediately back to on. Mean time the switch/lights will remain off. Switching back to off seems ot fix this.

Looking at MQTT explorer i see there is a Target Value but it doesn't seem to be updated at all (perhaps a problem with ozw?)

Environment

  • Home Assistant Core release with the issue: 0.11.0.7
  • Last working Home Assistant Core release (if known): N/A
  • Operating environment (Home Assistant/Supervised/Docker/venv): These get renamed so often i am not sure. I am running the image on a RPi
  • Integration causing this issue: ozw
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/ozw/

Problem-relevant configuration.yaml

None.

Traceback/Error logs

None.

Additional information

@probot-home-assistant
Copy link

ozw documentation
ozw source
(message by IssueLinks)

@kpine
Copy link
Contributor

kpine commented Jun 10, 2020

I would recommend you attach two MQTT dumps to this issue. Replace 24 with your node ID.

The first dump would be the entire node, so topic: OpenZWave/1/node/24/#.

The second dump would capture the activity while you toggle the switch, This would show whether the Target Value is being published by OZW or not. For that, you could dump topic: OpenZWave/1/node/24/instance/1/commandclass/38/value/#. Make sure the duration value of the dump is set long enough for you to toggle the switch.

You could also turn on MQTT debug logs but it gets busy quickly.

Question for the developers, the light component is checking for a target value, but the discovery schema does configure it, is it necessary to add it to pickup the Target value?

@MartinHjelmare
Copy link
Member

Yes, I think we need to add it to the discovery schema. If I get a dump from the device I can try to fix it.

@nemith
Copy link
Author

nemith commented Jun 10, 2020

Initial dump: mqtt_dump.txt
Dump while triggering the dimmer off: mqtt_dump(1).txt

I only triggered the dimmer once and not twice to get it in the right state.

You could also turn on MQTT debug logs but it gets busy quickly.

Right now I only have two light switches using the entire system so I can do this if the info isn't in the dumps.

@kpine
Copy link
Contributor

kpine commented Jun 10, 2020

I don't see anything in the second dump file that shows the light switch going from on to off, maybe I am missing it. It looks like you selected the entire OpenZWave topic instead of concentrating on the values for the SWITCH_MULTILEVEL command class for the specific node, which makes it difficult to follow. If you dump using the topic I posted the results will be filtered to the ones that are important. Maybe you can get another one?

If you want to use debug logs, here's a configuration, restart after enabling. You might be able to enable it at runtime with service calls.

logger:
  default: info
  logs:
    homeassistant.components.ozw: debug
    homeassistant.components.mqtt: debug

You can also use "DevTools -> MQTT -> Listen to a topic" to subscribe and watch changes to the dimmer values, which is basically the same as what the dump does, but slightly more accessible. Again, you'd want to subscribe to topic OpenZWave/1/node/8/instance/1/commandclass/38/value/#.

Or, if you have access to mosquitto_sub, you can also follow the changes to the value.

$ mosquitto_sub -h mqtt_broker_hostname -R -t OpenZWave/1/node/8/instance/1/commandclass/38/value/#

The dump and "Listen to a topic" show retained messages. That command will ignore retained messages and print only newly published messages, so it will be a little easier to follow. I also find it easier to read on the terminal, instead of in HA.

@nemith
Copy link
Author

nemith commented Jun 10, 2020

Again, you'd want to subscribe to topic OpenZWave/1/node/8/instance/1/commandclass/38/value/#.

Sorry i missed that in your previous post.
mqtt_dump-1.txt: Change to off
mqtt_dump(4).txt Off to on

Here is seems the Target Value is retained and not being updated?

Here is watching the topic with mosquitto_sub

{
    "Label": "Dimming Duration",
    "Value": 255,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591813888
}
{
    "Label": "Dimming Duration",
    "Value": 0,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591813888
}

And here i trigger the dimmer to off again to get it back in the right state

{
    "Label": "Dimming Duration",
    "Value": 255,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591813899
}
{
    "Label": "Level",
    "Value": 0,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 0,
    "Node": 8,
    "Genre": "User",
    "Help": "The Current Level of the Device",
    "ValueIDKey": 139034641,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591813899
}
{
    "Label": "Dimming Duration",
    "Value": 0,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591813899
}

Back on

{
    "Label": "Dimming Duration",
    "Value": 255,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591814009
}
{
    "Label": "Dimming Duration",
    "Value": 0,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591814009
}

And retriggered to match the correct state

{
    "Label": "Dimming Duration",
    "Value": 255,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591814044
}
{
    "Label": "Level",
    "Value": 99,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 0,
    "Node": 8,
    "Genre": "User",
    "Help": "The Current Level of the Device",
    "ValueIDKey": 139034641,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591814044
}
{
    "Label": "Dimming Duration",
    "Value": 0,
    "Units": "",
    "ValueSet": false,
    "ValuePolled": false,
    "ChangeVerified": false,
    "Min": 0,
    "Max": 255,
    "Type": "Byte",
    "Instance": 1,
    "CommandClass": "COMMAND_CLASS_SWITCH_MULTILEVEL",
    "Index": 5,
    "Node": 8,
    "Genre": "System",
    "Help": "Duration taken when changing the Level of a Device",
    "ValueIDKey": 1407375030976529,
    "ReadOnly": false,
    "WriteOnly": false,
    "Event": "valueChanged",
    "TimeStamp": 1591814044
}

@nemith
Copy link
Author

nemith commented Jun 15, 2020

Even when setting the ramp time to 0 on the dimmer config itself the problem is still there. I don't have a different branded dimmer to compare with so I am not sure what is supposed to be happening. From what i can tell there is no target value being sent to mqtt.

I also noticed the value field for my switch goes from 0 - 99. If i set to 255 then it will automatically update back to 99.

Is there some debug values to pull from the ozwdaemon?

@kpine
Copy link
Contributor

kpine commented Jun 15, 2020

Even when setting the ramp time to 0 on the dimmer config itself the problem is still there

That has never worked for me. Even assigning the ramp config values to be as quickly as possible, the GET after the SET always reports the wrong value.

I also noticed the value field for my switch goes from 0 - 99. If i set to 255 then it will automatically update back to 99.

0-99 are the valid brightness values. 255 means toggle the last value.

Is there some debug values to pull from the ozwdaemon?

You should be able to follow the logs and see the interaction between the OZW library and the switch. You'll see logs that say [ozw.library]. Are you using the addon or using docker on your own? If using the addon, also make sure you're up to date there. The logs should be in the supervisor somewhere. If standalone docker, the logs are output to the docker logs. If using the allinone image, there is an ozwdaemon.log file.

@nemith
Copy link
Author

nemith commented Jun 16, 2020

Are you using the addon or using docker on your own?

I am using the addon which, for debugging, has been less than stellar. I have been updating the addon as they come out and retesting. There is so much logging that the supervisor logs and the ha command only have a couple seconds of logs at any given point, but this is probably a lack of my knowledge of the supervisor itself.

@grizzlyjere
Copy link

I'm encountering the same thing with the HS-WD100+. OZW never sees the final state of the device, just an initial COMMAND_CLASS_SWITCH_MULTILEVEL as it transitions to the final state.

Should the device config xml be updated to force a refresh when it sees this command class?

@grizzlyjere
Copy link

I've updated the config to add

  <CommandClass id="38">
    <Compatibility>
      <VerifyChanged index="0">true</VerifyChanged>
    </Compatibility>
  </CommandClass>

That works for basic on/off, but when local dimming, OZW/HA isn't updated with the correct value. When performing local dimming, only CENTRAL_SCENE events for the button press seem to be emitted. What config changes could I use to force a refresh?

I tired both a VerifyChanged and a TriggerRefreshValue on the CENTRAL_SCENE command class without luck. Happy to submit a PR once this is corrected.

@kpine
Copy link
Contributor

kpine commented Jun 21, 2020

Should the device config xml be updated to force a refresh when it sees this command class?

What version of the COMMAND_CLASS_SWITCH_MULTILEVEL is being reported? If it's V4, then you would be better off relying on the Target value instead of refreshing. If V3 or earlier then VerifyChanged would be the way to go, but it still fails in some cases. Ideally, OZW should do this w/o any config overrides.

That works for basic on/off, but when local dimming, OZW/HA isn't updated with the correct value. When performing local dimming, only CENTRAL_SCENE events for the button press seem to be emitted. What config changes could I use to force a refresh?

Sounds like you need a firmware update? "v5.15: Updated ZDK to 6.51.08. Added Z-Wave “switch multilevel report” (instant status) to button press (9/30/16)". https://homeseer.com/current-downloads/

@andrerod
Copy link

@grizzlyjere I'm hitting what i believe is the same issue with Jasco Dimmers. I couldn't figure out yet how to change the config in my Hassio setup. Is this within the openzwave docker container ? Essentially wanted to try your suggestion of setting:

true

@grizzlyjere
Copy link

What version of the COMMAND_CLASS_SWITCH_MULTILEVEL is being reported? If it's V4, then you would be better off relying on the Target value instead of refreshing. If V3 or earlier then VerifyChanged would be the way to go, but it still fails in some cases. Ideally, OZW should do this w/o any config overrides.

Thanks for the pointer. The HS-WD100+ reports V1, so VerifyChanged seems to work well. The HS-WD200+ is reporting V4, but the TargetValue isn't reported correctly. Not sure if that's a dimmer problem or part of the broader issue OZW is looking into with VerifyChange.

Sounds like you need a firmware update? "v5.15: Updated ZDK to 6.51.08. Added Z-Wave “switch multilevel report” (instant status) to button press (9/30/16)". https://homeseer.com/current-downloads/

Ah! Never updated the firmware -- that did the trick, thanks!

@grizzlyjere
Copy link

@andrerod Yes, I'm using the openzwave docker container. I'm running it stand-along instead of the HA add-on.

My change can be found in this PR if you want to copy & paste to try: https://github.com/OpenZWave/open-zwave/pull/2272/files

@kpine
Copy link
Contributor

kpine commented Jun 26, 2020

The HS-WD100+ reports V1, so VerifyChanged seems to work well.

Strangely enough, in the pre-release version of this a person was reporting that their WD100+ was sending Target values, meaning it is at least V4. I wonder if there are multiple versions of the switch. The ZWave products DB lists two of them, the newer one shows it supports V4, while the older one shows nothing. Pretty annoying if they released two versions of the same switch w/o changing the IDs, happens often though.

The HS-WD200+ is reporting V4, but the TargetValue isn't reported correctly. Not sure if that's a dimmer problem or part of the broader issue OZW is looking into with VerifyChange.

That's basically the gist of this issue. If a switch is correctly implementing V4, then using the Target value will avoid having to poll the switch, which is always preferred. Since you're running the standalone docker container it's easier to get logs, did you already check if a Target value is being returned or not when you toggle the switch?

@grizzlyjere
Copy link

That's basically the gist of this issue. If a switch is correctly implementing V4, then using the Target value will avoid having to poll the switch, which is always preferred. Since you're running the standalone docker container it's easier to get logs, did you already check if a Target value is being returned or not when you toggle the switch?

For the HS-WD200+ I did some testing and I may have misunderstood Target Value and misspoke. I guess TargetValue its only send when there is a local action? And it's only a 100 point scale (vs. 255 in HA)? If so, it appears to work. I'm seeing changes reported in HA and the Target Value being send in MQTT very quickly. Remote changes don't trigger a TargetValue in MQTT.

What's not working are status updates when controlling from HA. Changing the brightness or turning on/off from the UI are rarely reported correctly. If I use oz-admin to change the level (on the user values tab) that updates HA correctly instantly. Viewing from MQTT, looks like a dimming duration is briefly turned on and an in-progress, but not final level is reported. Assuming I haven't goofed somewhere.

@kpine
Copy link
Contributor

kpine commented Jun 26, 2020

I guess TargetValue its only send when there is a local action?

What do you mean by local and remote? I would say local is pressing the switch, remote is sending a z-wave command from the controller, or did you mean the opposite?

And it's only a 100 point scale (vs. 255 in HA)?

In zwave valid level values are 0 (off), 1-99 (lowest brightness to 100%) and 255 which means restore the last level. So it makes sense that target would be something 0-99.

@grizzlyjere
Copy link

What do you mean by local and remote? I would say local is pressing the switch, remote is sending a z-wave command from the controller, or did you mean the opposite?

Yeah, local being switch action. I see TargetValue only when there is an action at the switch.

@kpine
Copy link
Contributor

kpine commented Jun 26, 2020

Yeah, local being switch action. I see TargetValue only when there is an action at the switch.

In that case, the behavior you're observing doesn't seem correct to me. The spec says that if a Get is sent immediately after a Set, the device must return the target value. Either the device is non-compliant, or something is going on with OZW. Would you mind posting the OZW logs from when you remotely activate the switch? I would be interested in taking a look.

@grizzlyjere
Copy link

Would you mind posting the OZW logs from when you remotely activate the switch? I would be interested in taking a look.

@kpine Sure. Here are some log extracts. Happy to provide more

  1. Dimmer at 100%, Turned Off From HA.
  2. HA still shows on at this point, but dimmer is off
  3. Command Off Again from HA
  4. HA shows off now
  5. Set to around 50% from HA
  6. HA shows off, but brightness level is still in middle

@kpine
Copy link
Contributor

kpine commented Jun 27, 2020

Logs look great. Here's my interpretation as a Z-Wave amateur.

  1. Dimmer at 100%, Turned Off From HA.
  2. HA still shows on at this point, but dimmer is off
[20200626 19:00:10.893 EDT] [ozw.library] [info]: Info - Node: 9 Value::Set - COMMAND_CLASS_SWITCH_MULTILEVEL - Level - 0 - 1 - 0
[20200626 19:00:10.894 EDT] [ozw.library] [info]: Info - Node: 9 SwitchMultilevel::Set - Setting to level 0
[20200626 19:00:10.894 EDT] [ozw.library] [info]: Info - Node: 9   Duration: Default
[20200626 19:00:10.894 EDT] [ozw.library] [debug]: Detail - Node: 9 Queuing (Send) SwitchMultilevelCmd_Set (Node=9): 0x01, 0x0b, 0x00, 0x13, 0x09, 0x04, 0x26, 0x01, 0x00, 0xff, 0x25, 0x57, 0x40
[20200626 19:00:10.895 EDT] [ozw.library] [debug]: Detail - Node: 9 Queuing (Send) SwitchMultilevelCmd_Get (Node=9): 0x01, 0x09, 0x00, 0x13, 0x09, 0x02, 0x26, 0x02, 0x25, 0x58, 0xb7
[20200626 19:00:10.895 EDT] [ozw.library] [info]: Info - Node: 9 Sending (Send) message (Callback ID=0x57, Expected Reply=0x13) - SwitchMultilevelCmd_Set (Node=9): 0x01, 0x0b, 0x00, 0x13, 0x09, 0x04, 0x26, 0x01, 0x00, 0xff, 0x25, 0x57, 0x40

OZW does a Multilevel Set (0x26, 0x01, 0x00, 0xff):

Value Field Meaning
0x26 Command Class COMMAND_CLASS_SWITCH_MULTILEVEL
0x01 Command SWITCH_MULTILEVEL_SET
0x00 (0) Value 0% brightness / Off
0xff (255) Duration Factory default duration

That looks good, the command to turn off the switch was sent as expected.

After the Set is an immediate Get, which is returned via a Report command:

[20200626 19:00:10.927 EDT] [ozw.library] [info]: Info - Node: 9 Sending (Send) message (Callback ID=0x58, Expected Reply=0x04) - SwitchMultilevelCmd_Get (Node=9): 0x01, 0x09, 0x00, 0x13, 0x09, 0x02, 0x26, 0x02, 0x25, 0x58, 0xb7
[20200626 19:00:10.972 EDT] [ozw.library] [debug]: Detail - Node: 9   Received: 0x01, 0x0d, 0x00, 0x04, 0x00, 0x09, 0x05, 0x26, 0x03, 0x63, 0x63, 0x00, 0xc7, 0x00, 0x18

The Report payload (0x26, 0x03, 0x63, 0x63, 0x00) is:

Value Field Meaning
0x26 Command Class COMMAND_CLASS_SWITCH_MULTILEVEL
0x03 Command SWITCH_MULTILEVEL_REPORT
0x63 (99) Current Value 100% brightness / On
0x63 (99) Target Value 100% brightness / ON
0x00 (0) Duration 0 seconds. Already at the Target Value.

Whoops, that's wrong isn't it? Both the current and target values are the old ones (switch 100% on). How does this happen? It's as if the Get were received before the Set, so the device is returning the state prior to the Set. I would have expected that Current might have been 100% still, but at least Target should have been 0. The Duration of 0 also means that the device is already at the intended value.

Because the Report is showing level 99, OZW doesn't notice any change from the current values, so it doesn't tell HA anything, and HA stays as it was.

[20200626 19:00:10.973 EDT] [ozw.library] [info]: Info - Node: 9 Received SwitchMultiLevel report: level=99
[20200626 19:00:10.973 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=99, new value=99, type=byte
[20200626 19:00:10.973 EDT] [ozw.library] [debug]: Detail - Node: 9 Changes to this value are not verified
[20200626 19:00:10.974 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=99, new value=99, type=byte
[20200626 19:00:10.974 EDT] [ozw.library] [debug]: Detail - Node: 9 Changes to this value are not verified
[20200626 19:00:10.975 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=255, new value=0, type=byte
  1. Command Off Again from HA
  2. HA shows off now

The same Set and Get commands are repeated:

[20200626 19:03:21.437 EDT] [ozw.library] [info]: Info - Node: 9 Value::Set - COMMAND_CLASS_SWITCH_MULTILEVEL - Level - 0 - 1 - 0
[20200626 19:03:21.438 EDT] [ozw.library] [info]: Info - Node: 9 SwitchMultilevel::Set - Setting to level 0
[20200626 19:03:21.438 EDT] [ozw.library] [info]: Info - Node: 9   Duration: Default
[20200626 19:03:21.439 EDT] [ozw.library] [debug]: Detail - Node: 9 Queuing (Send) SwitchMultilevelCmd_Set (Node=9): 0x01, 0x0b, 0x00, 0x13, 0x09, 0x04, 0x26, 0x01, 0x00, 0xff, 0x25, 0x59, 0x4e
[20200626 19:03:21.439 EDT] [ozw.library] [debug]: Detail - Node: 9 Queuing (Send) SwitchMultilevelCmd_Get (Node=9): 0x01, 0x09, 0x00, 0x13, 0x09, 0x02, 0x26, 0x02, 0x25, 0x5a, 0xb5

Then the Report:

[20200626 19:03:21.515 EDT] [ozw.library] [debug]: Detail - Node: 9   Received: 0x01, 0x0d, 0x00, 0x04, 0x00, 0x09, 0x05, 0x26, 0x03, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x18

The Report payload (0x26, 0x03, 0x00, 0x00, 0x00) this time is:

Value Field Meaning
0x26 Command Class COMMAND_CLASS_SWITCH_MULTILEVEL
0x03 Command SWITCH_MULTILEVEL_REPORT
0x00 (0) Current Value 0% brightness / Off
0x63 (0) Target Value 0% brightness / Off
0x00 (0) Duration 0 seconds. Already at the Target Value.

This is correct, node reports it is off now. OZW agrees and updates HA with the new values, and HA updates the switch state to off.

[20200626 19:03:21.515 EDT] [ozw.library] [info]: Info - Node: 9 Received SwitchMultiLevel report: level=0
[20200626 19:03:21.516 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=99, new value=0, type=byte
[20200626 19:03:21.516 EDT] [ozw.library] [debug]: Detail - Node: 9 Changes to this value are not verified
[20200626 19:03:21.517 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=99, new value=0, type=byte
[20200626 19:03:21.517 EDT] [ozw.library] [debug]: Detail - Node: 9 Changes to this value are not verified
[20200626 19:03:21.518 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=255, new value=0, type=byte
  1. Set to around 50% from HA
  2. HA shows off, but brightness level is still in middle

The Set to turn on the light to 57% brightness:

[20200626 19:04:40.859 EDT] [ozw.library] [info]: Info - Node: 9 Value::Set - COMMAND_CLASS_SWITCH_MULTILEVEL - Level - 0 - 1 - 57
[20200626 19:04:40.859 EDT] [ozw.library] [info]: Info - Node: 9 SwitchMultilevel::Set - Setting to level 57
[20200626 19:04:40.860 EDT] [ozw.library] [info]: Info - Node: 9   Duration: Default
[20200626 19:04:40.860 EDT] [ozw.library] [debug]: Detail - Node: 9 Queuing (Send) SwitchMultilevelCmd_Set (Node=9): 0x01, 0x0b, 0x00, 0x13, 0x09, 0x04, 0x26, 0x01, 0x39, 0xff, 0x25, 0x5b, 0x75
[20200626 19:04:40.860 EDT] [ozw.library] [debug]: Detail - Node: 9 Queuing (Send) SwitchMultilevelCmd_Get (Node=9): 0x01, 0x09, 0x00, 0x13, 0x09, 0x02, 0x26, 0x02, 0x25, 0x5c, 0xb3
[20200626 19:04:40.861 EDT] [ozw.library] [info]: Info - Node: 9 Sending (Send) message (Callback ID=0x5b, Expected Reply=0x13) - SwitchMultilevelCmd_Set (Node=9): 0x01, 0x0b, 0x00, 0x13, 0x09, 0x04, 0x26, 0x01, 0x39, 0xff, 0x25, 0x5b, 0x75

Payload 0x26, 0x01, 0x39, 0xff means set the switch to ~57% (0x39) brightness. The device responds with the Report:

[20200626 19:04:40.938 EDT] [ozw.library] [debug]: Detail - Node: 9   Received: 0x01, 0x0d, 0x00, 0x04, 0x00, 0x09, 0x05, 0x26, 0x03, 0x00, 0x63, 0x00, 0xc7, 0x00, 0x7b

The Report payload (0x26, 0x03, 0x00, 0x63, 0x00) this time is:

Value Field Meaning
0x26 Command Class COMMAND_CLASS_SWITCH_MULTILEVEL
0x03 Command SWITCH_MULTILEVEL_REPORT
0x00 (0) Current Value 0% brightness / Off
0x63 (99) Target Value 100% brightness / On
0x00 (0) Duration 0 seconds. Already at the Target Value.

Oh no, another failure. The Current Level is 0, which sounds reasonable (switch hasn't changed yet), but the Target Value is 100% brightness, even though you set it to 57%. HA shows off, because it the current value never changed and it doesn't look at the Target (as mentioned earlier). Again, how does this happen? Above we see OZW sending the Set command with 57% brightness.

OZW processes the report and only the Target value changed, which HA is not properly using yet.

[20200626 19:04:40.939 EDT] [ozw.library] [info]: Info - Node: 9 Received SwitchMultiLevel report: level=0
[20200626 19:04:40.940 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=0, new value=0, type=byte
[20200626 19:04:40.940 EDT] [ozw.library] [debug]: Detail - Node: 9 Changes to this value are not verified
[20200626 19:04:40.940 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=0, new value=99, type=byte
[20200626 19:04:40.941 EDT] [ozw.library] [debug]: Detail - Node: 9 Changes to this value are not verified
[20200626 19:04:40.941 EDT] [ozw.library] [debug]: Detail - Node: 9 Refreshed Value: old value=255, new value=0, type=byte

If HA did use the Target value here, you would still see the wrong value, the switch would appear at 100% instead of 57%. Also, the Current Level would be out of sync because the value is never updated again. Not sure if that matters or not, if the Target value was correct.

@Fishwaldo, any thoughts on what's going on here (did I miss something)?

@Fishwaldo
Copy link

@kpine your decode is correct. This device is all over the place unfortunately. You could try the VerifiedChange flag, that should work around it (I assume if you manually refresh the ValueID after a while it’s correct?)

@grizzlyjere
Copy link

grizzlyjere commented Jun 28, 2020

@kpine your decode is correct. This device is all over the place unfortunately. You could try the VerifiedChange flag, that should work around it (I assume if you manually refresh the ValueID after a while it’s correct?)

How do I manually refresh ValueID?

I added VerifyChange for the 200+, and it doesn't seemed to have helped. I did the same for the 100+ and it "mostly" fixed (will post separately to avoid confusion).

On the HS-WD200+, I've added the following to the device specific XML. Cleared the cache, restarted, and confirmed it was picked up by in cache file. This is correct, isn't it?

<CommandClass id="38">
    <Compatibility>
      <VerifyChanged index="0">true</VerifyChanged>
     </Compatibility>
 </CommandClass>

When turning the device from 100% brightness to off, it doesn't get updated. Same with dimming, and turning on to off.
Here are the logs for using Node-Red to call the HA light.turn_off service for the light on Node 9: https://pastebin.com/sfyDp9me
And from off to ~25%: https://pastebin.com/hXKQW4LR

I noticed it still says Node: 9 Changes to this value are verified, leading me to think the VerifyChanged isn't correct?

@nemith
Copy link
Author

nemith commented Aug 12, 2020

This seems better on HA 0.114.0. The devices will toggle, go back during dimming then update to the final state at the end. However there are still instances where the HA state and the actual state of the dimmer are different (HA says on, light is off or visa versa).

This one issue is really holding me back from HA and I would love to help out on providing a fix, but its' not clear to me where to go next or where to start.

@kpine
Copy link
Contributor

kpine commented Aug 12, 2020

It is still a work in progress. OpenZWave/open-zwave#1321

@iDVB
Copy link

iDVB commented Oct 21, 2020

I'm a newb with Zwave, but I also have this exact same with HS-WD200+ and have had it since trying to switch to HA completely. I'm very eager to help in any way I can to try and get this truly fixed. I also have a contact with Homeseer, so I'm happy to reach out to them if we're feeling this might be an issue with the device's firmware. Msg me if I can be of help.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 25, 2021
@nemith
Copy link
Author

nemith commented Jan 27, 2021

Still exists.

@github-actions github-actions bot removed the stale label Jan 28, 2021
@FutureTense
Copy link

Same issue. Anyone try this with zwave-js?

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@tareko
Copy link

tareko commented Jul 31, 2021

This issue still seems to be active. I'm using a WD200+ with the latest Home Assistant and OZWDaemon

@tareko
Copy link

tareko commented Jul 31, 2021

As a workaround, I changed the ramps to be 1s for local and remote:

Developer tools > services
ozw.set_config_parameter
parameters 11 and 12
set ramp to 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests