cgarwood / homeassistant-zwave_mqtt

Limited Pre-Release of the new OZW1.6 Z-Wave component. Currently has limited platform support. Check the README for more details.
72 stars 8 forks source link

Central scene different buttons not shown in #59

Closed mosjonathan closed 4 years ago

mosjonathan commented 4 years ago

mqtt_dump.txt

mosjonathan commented 4 years ago

in the current add-on for zwave i get the following:

{ "event_type": "zwave.scene_activated", "data": { "entity_id": "zwave.thermofloor_as_unknown_type_0300_id_a305", "node_id": 7, "scene_id": 1, "scene_data": 7680 }, "origin": "LOCAL", "time_fired": "2020-02-16T15:09:01.069244+00:00", "context": { "id": "90aa26fafbeb42329509601d2eb2938e", "parent_id": null, "user_id": null } }

scene id is the button number in my case 1 through 8 and scene data gives away a single, double, hold and release event number

marcelveldt commented 4 years ago

The new implementation takes care of unfolding the central scene support while the previous (OZW 1.4) only forwarded the raw data.

So, my guess is that you will get another scene id (and label) for other key presses.

mosjonathan commented 4 years ago

for 1 button press i get scene id 1,2 or 3 with the according labels single hold or release. unfortunately those are the same for all 8 buttons (of the same node). so it is not possible to see which button is pressed

marcelveldt commented 4 years ago

Aha! So The scene is correct but the device itself has multiple buttons.

mosjonathan commented 4 years ago

yes that is correct ( Heatit Z Push 8 https://www.robbshop.nl/z-push-button-8-wandzender-z-wave-plus-heat-it)

Fishwaldo commented 4 years ago

@marcelveldt: 1) you should be publishing the Value from the List, not the label (as it can be changed/translated etc). (maybe scene_value as well?). I think I need to add a "Selected_Value" to the json as well. 2) Each "Scene" is a different ValueID: ( I see 3 in the dump below triggering changes.)


OpenZWave/1/node/7/instance/1/commandclass/91/value/562950076547092/,{    "Label": "Scene 2",    "Value": {        "List": [            {                "Value": 0,                "Label": "Inactive"            },            {                "Value": 1,                "Label": "Pressed 1 Time"            },            {                "Value": 2,                "Label": "Key Released"            },            {                "Value": 3,                "Label": "Key Held down"            }        ],        "Selected": "Inactive"    },    "Units": "",    "Min": 0,    "Max": 0,    "Type": "List",    "Instance": 1,    "CommandClass": "COMMAND_CLASS_CENTRAL_SCENE",    "Index": 2,    "Node": 7,    "Genre": "User",    "Help": "",    "ValueIDKey": 562950076547092,    "ReadOnly": false,    "WriteOnly": false,    "ValueSet": false,    "ValuePolled": false,    "ChangeVerified": false,    "Event": "valueChanged",    "TimeStamp": 1581863554}
OpenZWave/1/node/7/instance/1/commandclass/91/value/281475099836436/,{    "Label": "Scene 1",    "Value": {        "List": [            {                "Value": 0,                "Label": "Inactive"            },            {                "Value": 1,                "Label": "Pressed 1 Time"            },            {                "Value": 2,                "Label": "Key Released"            },            {                "Value": 3,                "Label": "Key Held down"            }        ],        "Selected": "Pressed 1 Time"    },    "Units": "",    "Min": 0,    "Max": 0,    "Type": "List",    "Instance": 1,    "CommandClass": "COMMAND_CLASS_CENTRAL_SCENE",    "Index": 1,    "Node": 7,    "Genre": "User",    "Help": "",    "ValueIDKey": 281475099836436,    "ReadOnly": false,    "WriteOnly": false,    "ValueSet": false,    "ValuePolled": false,    "ChangeVerified": false,    "Event": "valueChanged",    "TimeStamp": 1581863555}
OpenZWave/1/node/7/instance/1/commandclass/91/value/281475099836436/,{    "Label": "Scene 1",    "Value": {        "List": [            {                "Value": 0,                "Label": "Inactive"            },            {                "Value": 1,                "Label": "Pressed 1 Time"            },            {                "Value": 2,                "Label": "Key Released"            },            {                "Value": 3,                "Label": "Key Held down"            }        ],        "Selected": "Inactive"    },    "Units": "",    "Min": 0,    "Max": 0,    "Type": "List",    "Instance": 1,    "CommandClass": "COMMAND_CLASS_CENTRAL_SCENE",    "Index": 1,    "Node": 7,    "Genre": "User",    "Help": "",    "ValueIDKey": 281475099836436,    "ReadOnly": false,    "WriteOnly": false,    "ValueSet": false,    "ValuePolled": false,    "ChangeVerified": false,    "Event": "valueChanged",    "TimeStamp": 1581863556}```
marcelveldt commented 4 years ago

@Fishwaldo currently the scene ID is published AND the label. scene_id in the hass event is the value from the list. What's missing is the difference between buttons but as is turns out this is just a different ValueID. For now we'll go with a simple ValueID property in the hass event to differentiate the different keys/buttons ?

Fishwaldo commented 4 years ago

ahhh - So you probably want to rename some things? scene_id should be the ValueID Index (each ValueID represents a Scene/Button in this case)

Then "TriggeredScene" or something? "TriggeredSceneLabel" and "TriggeredSceneValue"

I've just added "Selected_id" to the JSON to give you both the Label (Selected) and Value of the Label (Selected_id)

hazzeh commented 4 years ago

Here are some additional logs if it helps. It is from a nodon 4 button remote, but I've only captured 2 buttons and 2 "actions".

It shows the data published to the mqtt bus, and also what the zwave_mqtt.scene_activated is showing in home assistant.

In the mqtt message, the "Label" and "Index" corresponds to the what button is pressed, and the "Value.Selected" corresponds to the "action". In the zwave_mqtt.scene_activated event, the scene_id and scene_label corresponds to the "action". I guess it need something for the Label and Index as well (like @Fishwaldo suggested).

remote.txt

hazzeh commented 4 years ago

I did a proposal for a fix here: https://github.com/hazzeh/homeassistant-zwave_mqtt/commit/72848b1f7068cafd20c4f7195d334a3944f0489e

marcelveldt commented 4 years ago

@Fishwaldo thanks for the fix in the daemon, much better now. @hazzeh, thanks for your proposed fix. Looks fine. Just only we need to incorporate the new value Fishwaldo added to the json. Will you do a PR for this or want me to fix it ?

hazzeh commented 4 years ago

@marcelveldt I can do a PR after I've updated it with selected_id. However Im not sure if the selected_id is showing the correct value. For me it will be the same number for every value and scene. It changes when I restart the ozwdaemon. @Fishwaldo is that the correct behaviour with selected_id? I thought it should correspond to the "List Value". In the List for my remote , the values goes from 0 to 4.

Values from the mqtt bus:

    "Label": "Scene 2",
        "Selected": "Pressed 2 Times",
        "Selected_id": 3307669504
    "Label": "Scene 1",
        "Selected": "Pressed 1 Time",
        "Selected_id": 3307669504
marcelveldt commented 4 years ago

@hazzeh can you please test the latest version ? While I was refactoring some stuff I did some basic work on this too, so you should now have the index as additional property in the event.

hazzeh commented 4 years ago

@marcelveldt Same issue with the latest versions of the ozwdaemon. The problem is that it is the incoming values from ozwdaemon that are incorrect imo. I'll try some troubleshooting of qt-openzwave and see if I can pinpoint the issue.

marcelveldt commented 4 years ago

Yeah, the value is incorrect. the label should be fine. I filed an issue report at qt-openzwave for that. I have another PR waiting btw regarding the central scenes support as I've been testing today myself with some remotes with central scene support

silfa718 commented 4 years ago

This is what I am getting when I double press down on my homeseer switch

{ "event_type": "zwave_mqtt.scene_activated", "data": { "node_id": 6, "scene_id": 2, "scene_label": "Scene 2", "scene_value_id": 1897188608, "scene_value_label": "Pressed 2 Times" }, "origin": "LOCAL", "time_fired": "2020-02-23T21:21:47.143352+00:00", "context": { "id": "a9968d68d89b4500b4cd55250316a0d1", "parent_id": null, "user_id": null } }

hazzeh commented 4 years ago

@silfa718 You need to upgrade the to the latest dockerimage of ozwdaemon (and restart home assistant), then the scene_value_id will show the correct value.

silfa718 commented 4 years ago

I am on version 1.0.12 ozwdaemon

mosjonathan commented 4 years ago

I think that the version if this component needs a bump after the latest commit from @marcelveldt

silfa718 commented 4 years ago

Updated to 1.0.13 and got this:

{ "event_type": "zwave_mqtt.scene_activated", "data": { "node_id": 6, "scene_id": 2, "scene_label": "Scene 2", "scene_value_id": 4, "scene_value_label": "Pressed 2 Times" }, "origin": "LOCAL", "time_fired": "2020-02-25T12:09:56.642041+00:00", "context": { "id": "2ae84bc728b544d793f8cb5964cc3ef7", "parent_id": null, "user_id": null } }

marcelveldt commented 4 years ago

@hazzeh I think we can close this one now ? Is everything correct on your side too now ?

hazzeh commented 4 years ago

@hazzeh I think we can close this one now ? Is everything correct on your side too now ?

Yes, your correction works like a charm. Thanks.

mosjonathan commented 4 years ago

@marcelveldt i can confirm that it works correctly.

thanks for the fix