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

shutter recognized as dimmer #3862

Closed
zeev-mindali opened this issue Aug 25, 2024 · 56 comments · Fixed by #3877, #3900 or #3916
Closed

shutter recognized as dimmer #3862

zeev-mindali opened this issue Aug 25, 2024 · 56 comments · Fixed by #3877, #3900 or #3916
Assignees
Labels
question Further information is requested

Comments

@zeev-mindali
Copy link

Dear all,

i connected the homeassistant to zwave-js-ui.
made working with mqtt discovery because of issues that the shutter is recognized as dimmier
once i made the choice i can see home assistant option on the device.
but the device reporting also as dimmer:
{
"type": "light",
"object_id": "dimmer_9",
"discovery_payload": {
"command_topic": "zwave/lab/gp9/switch_multilevel/endpoint_9/targetValue/set",
"state_topic": "zwave/lab/gp9/switch_multilevel/endpoint_9/currentValue",
"state_value_template": "{{ "OFF" if value_json.value == 0 else "ON" }}",
"brightness_command_topic": "zwave/lab/gp9/switch_multilevel/endpoint_9/targetValue/set",
"brightness_scale": 99,
"brightness_state_topic": "zwave/lab/gp9/switch_multilevel/endpoint_9/currentValue",
"brightness_value_template": "{{ value_json.value }}",
"on_command_type": "brightness",
"availability": [
{
"payload_available": "true",
"payload_not_available": "false",
"topic": "zwave/lab/gp9/status",
"value_template": "{{'true' if value_json.value else 'false'}}"
},
{
"topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status",
"value_template": "{{'online' if value_json.value else 'offline'}}"
},
{
"payload_available": "true",
"payload_not_available": "false",
"topic": "zwave/driver/status"
}
],
"availability_mode": "all",
"device": {
"identifiers": [
"zwavejs2mqtt_0xf2e08abf_node48"
],
"manufacturer": "TouchWand Co., Ltd.",
"model": "Glass 9 v2.03 (Glass9)",
"name": "lab-gp9",
"sw_version": "4.13.8"
},
"name": "lab-gp9_dimmer_9",
"unique_id": "zwavejs2mqtt_0xf2e08abf_48-38-9-currentValue"
},
"discoveryTopic": "light/lab-gp9/dimmer_9/config",
"values": [
"38-9-currentValue",
"38-9-targetValue"
],
"persistent": false,
"ignoreDiscovery": false,
"id": "light_dimmer_9"
}

is there anything i can do to make it work as shutter?
are there any automation for making all dimmer recognized as shutter?

zeev

@zeev-mindali zeev-mindali added the question Further information is requested label Aug 25, 2024
@robertsLando
Copy link
Member

Hi @zeev-mindali , the code that defines if discovering a cover or a light dimmer is here:

case CommandClasses['Multilevel Switch']:

I may have to add a case to handle your device as a cover, could you do a node export from the ui so I can check the node.deviceClass.generic and node.deviceClass.specific

@zeev-mindali
Copy link
Author

Dear robert,

i attaching two files:
node46_ui node46_driver.
in node46_driver i see that node 8,9,10, identify as Motor class C, i think this is the start point of the bug.
node46_ui.json
node46_driver.json

zeev

@robertsLando
Copy link
Member

Oh ok I may have understand what's the issue here, seems I only get the device class of root endpoint instead of getting it for each one, this requires a fix on my side

@zeev-mindali
Copy link
Author

hi @robertsLando
i didn't see any change on my side regrading that issue,
it's still shows dimmer,
i check the linked pull, but it's not working for now.

@robertsLando
Copy link
Member

@zeev-mindali The PR is not merged yet, how did you test it?

@robertsLando
Copy link
Member

I have created 9.18.1 relese, give it a try

@zeev-mindali
Copy link
Author

great, i will check it today, tnx a lot

@zeev-mindali
Copy link
Author

zeev-mindali commented Sep 11, 2024

dear @robertsLando,
i made the update, and i using the zwave-js-ui as my main zwave in home assistant,
i can see in the home assistant tab, that it's recognized as cover, but home assistant still show me as light,
is it something on zwave-js-ui or on home assistant?

i using HAOS

@robertsLando
Copy link
Member

I think that's something related to HA but I'm not an HA expert, try to ask to them and let me know :)

@zeev-mindali
Copy link
Author

zeev-mindali commented Sep 16, 2024

@robertsLando
the problem is deffentily HA fault.
i used the mqtt in HA , and i got cover, but the zwave-js of HA is still shown as light.

but i have another device, whice is still shown as dimmer :(
i will get the info out and send you the logs

@zeev-mindali
Copy link
Author

here the files:
zwavejs_current.log
z-ui_current.log

@robertsLando
Copy link
Member

From discovery prospecctive seems good:

2024-09-16 16:53:38.703 DEBUG GATEWAY: Publishing discovery: {
  type: 'cover',
  object_id: 'position_8',
  discovery_payload: {
    command_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_8/targetValue/set',
    position_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_8/currentValue',
    set_position_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_8/targetValue/set',
    position_template: '{{ value_json.value | round(0) }}',
    position_open: 99,
    position_closed: 0,
    payload_open: 99,
    payload_close: 0,
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/gp9/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node24', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'Glass 9 (Glass9)',
      name: 'lab-gp9',
      sw_version: '2.10.3'
    },
    name: 'lab-gp9_position_8',
    unique_id: 'zwavejs2mqtt_0xe98f251e_24-38-8-currentValue'
  },
  discoveryTopic: 'cover/lab-gp9/position_8/config',
  values: [ '38-8-currentValue', '38-8-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}
2024-09-16 16:53:39.190 DEBUG GATEWAY: Publishing discovery: {
  type: 'cover',
  object_id: 'position_9',
  discovery_payload: {
    command_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_9/targetValue/set',
    position_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_9/currentValue',
    set_position_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_9/targetValue/set',
    position_template: '{{ value_json.value | round(0) }}',
    position_open: 99,
    position_closed: 0,
    payload_open: 99,
    payload_close: 0,
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/gp9/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node24', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'Glass 9 (Glass9)',
      name: 'lab-gp9',
      sw_version: '2.10.3'
    },
    name: 'lab-gp9_position_9',
    unique_id: 'zwavejs2mqtt_0xe98f251e_24-38-9-currentValue'
  },
  discoveryTopic: 'cover/lab-gp9/position_9/config',
  values: [ '38-9-currentValue', '38-9-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}
2024-09-16 16:53:39.676 DEBUG GATEWAY: Publishing discovery: {
  type: 'cover',
  object_id: 'position_10',
  discovery_payload: {
    command_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_10/targetValue/set',
    position_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_10/currentValue',
    set_position_topic: 'zwave/lab/gp9/switch_multilevel/endpoint_10/targetValue/set',
    position_template: '{{ value_json.value | round(0) }}',
    position_open: 99,
    position_closed: 0,
    payload_open: 99,
    payload_close: 0,
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/gp9/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node24', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'Glass 9 (Glass9)',
      name: 'lab-gp9',
      sw_version: '2.10.3'
    },
    name: 'lab-gp9_position_10',
    unique_id: 'zwavejs2mqtt_0xe98f251e_24-38-10-currentValue'
  },
  discoveryTopic: 'cover/lab-gp9/position_10/config',
  values: [ '38-10-currentValue', '38-10-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}

Then light dimmers:

2024-09-16 16:52:46.192 DEBUG GATEWAY: Publishing discovery: {
  type: 'light',
  object_id: 'dimmer_1',
  discovery_payload: {
    command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_1/targetValue/set',
    state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_1/currentValue',
    state_value_template: '{{ "OFF" if value_json.value == 0 else "ON" }}',
    brightness_command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_1/targetValue/set',
    brightness_scale: 99,
    brightness_state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_1/currentValue',
    brightness_value_template: '{{ value_json.value }}',
    on_command_type: 'brightness',
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/wallwand/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node25', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'WallWand touch panel (WallWand)',
      name: 'lab-wallwand',
      sw_version: '1.48'
    },
    name: 'lab-wallwand_dimmer_1',
    unique_id: 'zwavejs2mqtt_0xe98f251e_25-38-1-currentValue'
  },
  discoveryTopic: 'light/lab-wallwand/dimmer_1/config',
  values: [ '38-1-currentValue', '38-1-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}
2024-09-16 16:52:46.349 DEBUG GATEWAY: Publishing discovery: {
  type: 'light',
  object_id: 'dimmer_2',
  discovery_payload: {
    command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_2/targetValue/set',
    state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_2/currentValue',
    state_value_template: '{{ "OFF" if value_json.value == 0 else "ON" }}',
    brightness_command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_2/targetValue/set',
    brightness_scale: 99,
    brightness_state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_2/currentValue',
    brightness_value_template: '{{ value_json.value }}',
    on_command_type: 'brightness',
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/wallwand/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node25', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'WallWand touch panel (WallWand)',
      name: 'lab-wallwand',
      sw_version: '1.48'
    },
    name: 'lab-wallwand_dimmer_2',
    unique_id: 'zwavejs2mqtt_0xe98f251e_25-38-2-currentValue'
  },
  discoveryTopic: 'light/lab-wallwand/dimmer_2/config',
  values: [ '38-2-currentValue', '38-2-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}
2024-09-16 16:52:46.654 DEBUG GATEWAY: Publishing discovery: {
  type: 'light',
  object_id: 'dimmer_5',
  discovery_payload: {
    command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_5/targetValue/set',
    state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_5/currentValue',
    state_value_template: '{{ "OFF" if value_json.value == 0 else "ON" }}',
    brightness_command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_5/targetValue/set',
    brightness_scale: 99,
    brightness_state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_5/currentValue',
    brightness_value_template: '{{ value_json.value }}',
    on_command_type: 'brightness',
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/wallwand/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node25', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'WallWand touch panel (WallWand)',
      name: 'lab-wallwand',
      sw_version: '1.48'
    },
    name: 'lab-wallwand_dimmer_5',
    unique_id: 'zwavejs2mqtt_0xe98f251e_25-38-5-currentValue'
  },
  discoveryTopic: 'light/lab-wallwand/dimmer_5/config',
  values: [ '38-5-currentValue', '38-5-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}
2024-09-16 16:52:47.137 DEBUG GATEWAY: Publishing discovery: {
  type: 'light',
  object_id: 'dimmer_6',
  discovery_payload: {
    command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_6/targetValue/set',
    state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_6/currentValue',
    state_value_template: '{{ "OFF" if value_json.value == 0 else "ON" }}',
    brightness_command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_6/targetValue/set',
    brightness_scale: 99,
    brightness_state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_6/currentValue',
    brightness_value_template: '{{ value_json.value }}',
    on_command_type: 'brightness',
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/wallwand/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node25', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'WallWand touch panel (WallWand)',
      name: 'lab-wallwand',
      sw_version: '1.48'
    },
    name: 'lab-wallwand_dimmer_6',
    unique_id: 'zwavejs2mqtt_0xe98f251e_25-38-6-currentValue'
  },
  discoveryTopic: 'light/lab-wallwand/dimmer_6/config',
  values: [ '38-6-currentValue', '38-6-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}
2024-09-16 16:52:47.334 DEBUG GATEWAY: Publishing discovery: {
  type: 'light',
  object_id: 'dimmer_7',
  discovery_payload: {
    command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_7/targetValue/set',
    state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_7/currentValue',
    state_value_template: '{{ "OFF" if value_json.value == 0 else "ON" }}',
    brightness_command_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_7/targetValue/set',
    brightness_scale: 99,
    brightness_state_topic: 'zwave/lab/wallwand/switch_multilevel/endpoint_7/currentValue',
    brightness_value_template: '{{ value_json.value }}',
    on_command_type: 'brightness',
    availability: [
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/lab/wallwand/status',
        value_template: "{{'true' if value_json.value else 'false'}}"
      },
      {
        topic: 'zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status',
        value_template: "{{'online' if value_json.value else 'offline'}}"
      },
      {
        payload_available: 'true',
        payload_not_available: 'false',
        topic: 'zwave/driver/status'
      },
      [length]: 3
    ],
    availability_mode: 'all',
    device: {
      identifiers: [ 'zwavejs2mqtt_0xe98f251e_node25', [length]: 1 ],
      manufacturer: 'TouchWand Co., Ltd.',
      model: 'WallWand touch panel (WallWand)',
      name: 'lab-wallwand',
      sw_version: '1.48'
    },
    name: 'lab-wallwand_dimmer_7',
    unique_id: 'zwavejs2mqtt_0xe98f251e_25-38-7-currentValue'
  },
  discoveryTopic: 'light/lab-wallwand/dimmer_7/config',
  values: [ '38-7-currentValue', '38-7-targetValue', [length]: 2 ],
  persistent: false,
  ignoreDiscovery: false
}

@zeev-mindali
Copy link
Author

this is my problem, the wallwand is not a dimmer, it's a cover :(

@robertsLando
Copy link
Member

@zeev-mindali the wallwand has multiple endpoints (13), could you do another export of the node please like you did here: #3862 (comment) ?

@zeev-mindali
Copy link
Author

here are logs, i attached only the wallwand
z-ui_current.log
zwavejs_current.log

@robertsLando robertsLando reopened this Sep 17, 2024
@robertsLando
Copy link
Member

@zeev-mindali those are the logs, I need an export of the node like you did hre: #3862 (comment)

@zeev-mindali
Copy link
Author

@robertsLando
Copy link
Member

@zeev-mindali are ALL dimmers above covers? Because some are reporting specific_type_basic_wall_controller and others specific_type_motor_multiposition. While the second is self explanatory the fist I'm not sure if should be alwats considered a cover

@zeev-mindali
Copy link
Author

the controller have two multi level switch:

  1. multiposition motor.
  2. long/short switch , which is virtual switch which long press (3 seconds) makes it's true, for not make action accedently.

@robertsLando
Copy link
Member

@zeev-mindali wait for 9.19.1, will release it the end of the week

@zeev-mindali
Copy link
Author

Dear @robertsLando ,

any news on the release?

@zeev-mindali
Copy link
Author

for getting up or position:
Topic: zwave/mbr/gp9/switch_multilevel/endpoint_10/targetValue
{"time":1727239904945,"value":99}

for getting down or position:
Topic: zwave/mbr/gp9/switch_multilevel/endpoint_10/targetValue
{"time":1727239904945,"value":0}

the problem is in:
Topic: zwave/mbr/gp9/switch_multilevel/endpoint_10/targetValue
{"time":1727239904945,"value": stop}

it should be:
Topic: zwave/mbr/gp9/switch_multilevel/endpoint_10/Down
{"time":1727239904945,"value": false}

if you need any more data , don't hasitate to ask for

@robertsLando
Copy link
Member

@zeev-mindali I need the discovery payload, the one you find by going to home assistant tab when you click on a node on control panel table, then select the cover in the list of discovery devices and you will see the discovery payload on the right that's the one sent to HA

@zeev-mindali
Copy link
Author

zeev-mindali commented Sep 25, 2024

for an endpoint 8

{
  "type": "cover",
  "object_id": "position_8",
  "discovery_payload": {
    "command_topic": "zwave/mbr/gp9/switch_multilevel/endpoint_8/targetValue/set",
    "position_topic": "zwave/mbr/gp9/switch_multilevel/endpoint_8/currentValue",
    "set_position_topic": "zwave/mbr/gp9/switch_multilevel/endpoint_8/targetValue/set",
    "position_template": "{{ value_json.value | round(0) }}",
    "position_open": 99,
    "position_closed": 0,
    "payload_open": 99,
    "payload_close": 0,
    "availability": [
      {
        "payload_available": "true",
        "payload_not_available": "false",
        "topic": "zwave/mbr/gp9/status",
        "value_template": "{{'true' if value_json.value else 'false'}}"
      },
      {
        "topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave/status",
        "value_template": "{{'online' if value_json.value else 'offline'}}"
      },
      {
        "payload_available": "true",
        "payload_not_available": "false",
        "topic": "zwave/driver/status"
      }
    ],
    "availability_mode": "all",
    "device": {
      "identifiers": [
        "zwavejs2mqtt_0xeeea28a4_node8"
      ],
      "manufacturer": "TouchWand Co., Ltd.",
      "model": "Glass 9 (Glass9)",
      "name": "mbr-gp9",
      "sw_version": "4.13.8"
    },
    "name": "mbr-gp9_position_8",
    "unique_id": "zwavejs2mqtt_0xeeea28a4_8-38-8-currentValue"
  },
  "discoveryTopic": "cover/mbr-gp9/position_8/config",
  "values": [
    "38-8-currentValue",
    "38-8-targetValue"
  ],
  "persistent": false,
  "ignoreDiscovery": false,
  "id": "cover_position_8"
}

@robertsLando
Copy link
Member

robertsLando commented Sep 25, 2024

Based on docs the command_topic is the one where we should send the open/close commands but we actually have two topics to send the open/close ( Down and Up), so what?

cc @ccutrer as I know he have a good understanding of auto discovery topic

@zeev-mindali
Copy link
Author

zeev-mindali commented Sep 25, 2024

@robertsLando

i have for endpoint 8 two entity
one is cover, as i posted above

the second is switch:

{
  "type": "switch",
  "object_id": "switch_8",
  "discovery_payload": {
    "payload_off": false,
    "payload_on": true,
    "value_template": "{{ value_json.value }}",
    "command_topic": "zwave/mbr/gp9/switch_binary/endpoint_8/targetValue/set",
    "state_topic": "zwave/mbr/gp9/switch_binary/endpoint_8/currentValue",
    "availability": [
      {
        "payload_available": "true",
        "payload_not_available": "false",
        "topic": "zwave/mbr/gp9/status",
        "value_template": "{{'true' if value_json.value else 'false'}}"
      },
      {
        "topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave/status",
        "value_template": "{{'online' if value_json.value else 'offline'}}"
      },
      {
        "payload_available": "true",
        "payload_not_available": "false",
        "topic": "zwave/driver/status"
      }
    ],
    "availability_mode": "all",
    "device": {
      "identifiers": [
        "zwavejs2mqtt_0xeeea28a4_node8"
      ],
      "manufacturer": "TouchWand Co., Ltd.",
      "model": "Glass 9 (Glass9)",
      "name": "mbr-gp9",
      "sw_version": "4.13.8"
    },
    "name": "mbr-gp9_switch_8",
    "unique_id": "zwavejs2mqtt_0xeeea28a4_8-37-8-currentValue"
  },
  "discoveryTopic": "switch/mbr-gp9/switch_8/config",
  "values": [
    "37-8-currentValue",
    "37-8-targetValue"
  ],
  "persistent": false,
  "ignoreDiscovery": false,
  "id": "switch_switch_8"
}

maybe the solution will be from this side.

@robertsLando
Copy link
Member

robertsLando commented Sep 25, 2024

maybe the solution will be from this side.

What does the switch do? Open & close? Is this a standard for covers to also have a binary switch to open/close or something only related to yours?

@zeev-mindali
Copy link
Author

nope, you correct

@zeev-mindali
Copy link
Author

@robertsLando

the more i digging into it, the command topic is the one we need, you totally correct.
but for stoping we can use the Up or Down as if i understand correctly.

@robertsLando
Copy link
Member

@zeev-mindali yeah but this is the problem here, Up and Down are two different topics, I cannot map them dinamically on the discovery payload command, I don't have many alternatives here

@zeev-mindali
Copy link
Author

@robertsLando

i agree with you, i played with the mqtt configuration in the home assistant.
found there is another topic, called payload_stop
but in glass9 by mco home, i needed to check if the cover is opening or closing for sending true or false for stop.
in wallwand by touchwand, it's has no effect.

in both cases the only solution is Up/Down set to false, but after the expriance from the glass9 i not sure if needed only up or down, or both for using that.

still playing with it

@robertsLando
Copy link
Member

@zeev-mindali let me know if there is something I can do on my side

@zeev-mindali
Copy link
Author

@robertsLando

i very confused , i have a simple shutter also from mco home, which works great.
so why the other one is not :( it's seems it's not related to mqtt, but more to the zwave commands.
if i able to make mqtt commands to make it work, maybe the problem on the driver side?
is the entity of the cover is treated like a single end point cover device?

it's payload:
{
"type": "cover",
"object_id": "position",
"discovery_payload": {
"command_topic": "zwave/mbr/shutter/switch_multilevel/endpoint_0/targetValue/set",
"position_topic": "zwave/mbr/shutter/switch_multilevel/endpoint_0/currentValue",
"set_position_topic": "zwave/mbr/shutter/switch_multilevel/endpoint_0/targetValue/set",
"position_template": "{{ value_json.value | round(0) }}",
"position_open": 99,
"position_closed": 0,
"payload_open": 99,
"payload_close": 0,
"availability": [
{
"payload_available": "true",
"payload_not_available": "false",
"topic": "zwave/mbr/shutter/status",
"value_template": "{{'true' if value_json.value else 'false'}}"
},
{
"topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave/status",
"value_template": "{{'online' if value_json.value else 'offline'}}"
},
{
"payload_available": "true",
"payload_not_available": "false",
"topic": "zwave/driver/status"
}
],
"availability_mode": "all",
"device": {
"identifiers": [
"zwavejs2mqtt_0xeeea28a4_node11"
],
"manufacturer": "Mco Home Co., Ltd.",
"model": "Shutter Panel (MH-C621)",
"name": "mbr-shutter",
"sw_version": "4.14"
},
"name": "mbr-shutter_position",
"unique_id": "zwavejs2mqtt_0xeeea28a4_11-38-0-currentValue"
},
"discoveryTopic": "cover/mbr-shutter/position/config",
"values": [
"38-0-currentValue",
"38-0-targetValue"
],
"persistent": false,
"ignoreDiscovery": false,
"id": "cover_position"
}

@robertsLando
Copy link
Member

@zeev-mindali Sincerly I have no clue, I'm sorry :(

@zeev-mindali
Copy link
Author

@robertsLando

found the problem, finally

when i use the payload_stop or any other
the zwave get:
command class : 0x26 - COMMAND_CLASS_SWITCH_MULTILEVEL
command : 0x01 - SWITCH_MULTILEVEL_SET

this is not correct

it should be:
command class : 0x26 - COMMAND_CLASS_SWITCH_MULTILEVEL
command : 0x05 - SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE

i tested the zwave js ui, and it's working and sending the correct command, the issue is with mqtt or HA which not using the correct methods.

if it's help, i can send you a zniffer log, for not working and working

@robertsLando
Copy link
Member

Can this be a fix? #3916

BTW I'm not sure if that could create some issue

@zeev-mindali
Copy link
Author

zeev-mindali commented Sep 26, 2024

i saw in the gateway file, referance for open and close, didn't see a zwave command for stop, or i missed that?

if there is a zwave-js-ui file i can test it and approve or disapprove

@zeev-mindali
Copy link
Author

Can this be a fix? #3916

BTW I'm not sure if that could create some issue

does the fix is in the new release?

@zeev-mindali
Copy link
Author

@robertsLando

mange to fix the code :)
gateway file
in function - > parsePayload(payload: any, valueId: ZUIValueId, valueConf: GatewayValue)
in the begining of the function
i checked if payload is STOP, which reflects the stop from HA.
if the payload is top, i move the up (not matter if it's up or down) to false.

if (payload === 'STOP') {
this._zwave
.writeValue({...valueId,property: 'Up',},false,)
.catch(() => {})
return null
}

and the stop from ha is now working :)

i checking now with the wallwand (needs to works also) and a single shutter MCO Home C621.
if it will working without a problem, i will notify you :)

@zeev-mindali
Copy link
Author

@robertsLando

tested with 3 diffrent devices, two has multi endpoint and one is shutter.
first of all you need to take out the change that you made with the open close, which represent up/down
where you wrote : // ref issue #3862

and add to the begining of the function the code:
if (payload === 'STOP') {
this._zwave
.writeValue({...valueId,property: 'Up',},false,)
.catch(() => {})
return null
}

this will fix the issues with the stop
now it's all working.

i tried to compile to arm v7 , but it's says the package will work only on macos :(

so if you can also help with that also, i can check with the package

@zeev-mindali
Copy link
Author

sent you the suggested change

@robertsLando
Copy link
Member

Just submitted a change to #3916, could you check it? Only stop should be handled so?

@zeev-mindali
Copy link
Author

@robertsLando

only stop should be handled, but if it's found in payload STOP then it should be false and not true

this._zwave
.writeValue(
{
...valueId,
property: 'Up',
},
false, <== this will stop him
)

@robertsLando
Copy link
Member

@zeev-mindali Ok will change the payload to be false instead. Wondering if I should also handel the down command someway and write false there too in case it's going down? Dunno how it works sincerly as I never used a z-wave cover

@zeev-mindali
Copy link
Author

@robertsLando

it doesn't matter if it's up->false or down->false, on both cases it will stop the cover.
i running checks on my side, to check the code.

@robertsLando
Copy link
Member

Ok perfect thanks for the feedback, merging now, patch release will come in next days

@zeev-mindali
Copy link
Author

@robertsLando

great,
how can i make the arm_v7 file? i want to check it on my side

@robertsLando
Copy link
Member

@zeev-mindali You will find it on workflow assets once this ends: https://github.com/zwave-js/zwave-js-ui/actions/runs/11108825157

@robertsLando
Copy link
Member

@zeev-mindali 9.21.1 is out

https://github.com/zwave-js/zwave-js-ui/releases/tag/v9.21.1

@zeev-mindali
Copy link
Author

the 9.21.1 fixed the problem with start stop issue :)
you can close it

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