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
950 stars 204 forks source link

Hass json device update don't work #3043

Closed barrydouu closed 1 year ago

barrydouu commented 1 year ago

Checklist

Deploy method

Docker

Z-Wave JS UI version

8.13.1

ZwaveJS version

10.14.0

Describe the bug

Hello I've a FGR222 roller shutter. I'd like to change the hass device json, to change the "position_template" of the cover_position (In Home Assistant entry of the device). So I change "position_template": "{{ (value_json.value / 99 * 100) | round(0) }}", with "position_template": "{{ value_json.value | round(0) }}", Then I hit "update" (on the right side) Then I hit "rediscover"

But when I do that, the value pushed to the discovery topic is the old one

Here is the log 2023-04-10 14:45:04.310 DEBUG SOCKET: Event HASS_API emitted to Sy4hC9hqEfRH2ASAAAAW 2023-04-10 14:45:04.311 INFO APP: Hass api call: discover 2023-04-10 14:45:04.312 DEBUG GATEWAY: Publishing discovery: { type: 'cover', object_id: 'position', values: [ '38-0-currentValue', '38-0-targetValue', [length]: 2 ], discovery_payload: { command_topic: 'zwave/25/38/0/targetValue/set', position_topic: 'zwave/25/38/0/currentValue', set_position_topic: 'zwave/25/38/0/targetValue/set', position_template: '{{ (value_json.value / 99 * 100) | round(0) }}', position_open: 99, position_closed: 0, payload_open: '99', payload_close: '0', device: { identifiers: [ 'zwavejs2mqtt_0xc7bf3f61_node25', [length]: 1 ], manufacturer: 'Fibargroup', model: 'Roller Shutter 2 (FGR222)', name: 'VoletSalon2', sw_version: '25.25' }, name: 'VoletSalon2_position', unique_id: 'zwavejs2mqtt_0xc7bf3f61_Node25_position' }, discoveryTopic: 'cover/VoletSalon2/position/config', persistent: false, ignoreDiscovery: false, id: 'cover_position' }

To Reproduce

Go to home assistant of a device update a hass definition hit update hit rediscover

Expected behavior

I'd like the rediscover send the new "position_template"

Additional context

No response

barrydouu commented 1 year ago

I've just updated to 8.14.1, and now it's working perfectly

Thank you

robertsLando commented 1 year ago

@barrydouu thanks for the feedback 🙏🏻

Call-Me-G-Now commented 3 months ago

@robertsLando Changes made to the JSON payload are not published with the following workflow:

it does seem to work with this workflow:

can you confirm this is not the intended behavior?

zwave-js-ui: 9.13.2.632ca88
zwave-js: 12.9.1
robertsLando commented 3 months ago

@Call-Me-G-Now It should work in the first way AFAIK, if not I have to test this myself and see what's broken

Call-Me-G-Now commented 3 months ago

ok, lemme know if you can reproduce it.

robertsLando commented 3 months ago

I cannot reproduce it, when I press update the in memory device is updated then when I press on rediscover I see it published to mqtt correctly

Call-Me-G-Now commented 3 months ago

Thanks for the feedback. I'll go back and test on my end once more to be sure. If still so, I'll record it.

Call-Me-G-Now commented 3 months ago

zwavejs2.webm

Unfortunately it's not working on my end. You can also see in the end that moving away from this component and coming back to it the original name is display as payload again. Seem like it's not saved. As i'm running the docker i've check file/storage path permissions but they could not be an issue as all was masked 777, rwx for everyone.

robertsLando commented 3 months ago

@Call-Me-G-Now Could you try to restart your application?

Call-Me-G-Now commented 3 months ago

Yessir, this is video is after a fresh docker restart.