FGR222 state update not working

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

FGR222 state update not working

Post by barry44 »

Hello

I have FGR222 Roller Shutter.
They are associated via a group on a zwave remote control.
When I hit the key of the remote control, the roller shutter works normally (open / close / open during press, stopping when I release the key)

But when I change state via the remote control, the state is not updated in domoticz.
I've checked ZWaveJsUi debug, and it tells that the currentValue is updated. But domoticz does not see the update

Here are logs.
First domoticz log, seeing update only on power

Code: Select all

2023-04-02 18:35:23.088 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-02 18:35:23.091 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-02 18:35:25.625 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-02 18:35:25.628 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-02 18:35:28.739 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-02 18:35:28.742 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-02 18:35:30.786 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-02 18:35:30.789 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-02 18:35:32.367 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-02 18:35:32.372 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power) 
Then ZWaveJSUI log showing the mqtt updates

Code: Select all

2023-04-02 16:35:23.077 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453323077, value: 1680453323077 } with options { qos: 1, retain: false }
2023-04-02 16:35:23.081 INFO Z-WAVE: [Node 025] Metadata updated: 49-0-Power
2023-04-02 16:35:23.083 DEBUG MQTT: Publishing to zwave/25/49/0/Power: {
time: 1680453323083,
value: 244.3,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:23.084 INFO Z-WAVE: [Node 025] Value updated: 49-0-Power 0.7 => 244.3
2023-04-02 16:35:25.515 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453325515, value: 1680453325515 } with options { qos: 1, retain: false }
2023-04-02 16:35:25.519 DEBUG MQTT: Publishing to zwave/25/38/0/currentValue: {
time: 1680453325519,
value: 81,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:25.520 INFO Z-WAVE: [Node 025] Value updated: 38-0-currentValue 99 => 81
2023-04-02 16:35:25.535 INFO Z-WAVE: [Node 025] Metadata updated: 49-0-Power
2023-04-02 16:35:25.537 DEBUG MQTT: Publishing to zwave/25/49/0/Power: {
time: 1680453325537,
value: 0.7,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:25.538 INFO Z-WAVE: [Node 025] Value updated: 49-0-Power 244.3 => 0.7
2023-04-02 16:35:25.765 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453325765, value: 1680453325765 } with options { qos: 1, retain: false }
2023-04-02 16:35:28.727 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453328727, value: 1680453328727 } with options { qos: 1, retain: false }
2023-04-02 16:35:28.731 INFO Z-WAVE: [Node 025] Metadata updated: 49-0-Power
2023-04-02 16:35:28.733 DEBUG MQTT: Publishing to zwave/25/49/0/Power: {
time: 1680453328733,
value: 246.2,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:28.734 INFO Z-WAVE: [Node 025] Value updated: 49-0-Power 0.7 => 246.2
2023-04-02 16:35:30.774 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453330774, value: 1680453330774 } with options { qos: 1, retain: false }
2023-04-02 16:35:30.778 INFO Z-WAVE: [Node 025] Metadata updated: 49-0-Power
2023-04-02 16:35:30.780 DEBUG MQTT: Publishing to zwave/25/49/0/Power: {
time: 1680453330779,
value: 0.7,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:30.780 INFO Z-WAVE: [Node 025] Value updated: 49-0-Power 246.2 => 0.7
2023-04-02 16:35:32.249 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453332248, value: 1680453332248 } with options { qos: 1, retain: false }
2023-04-02 16:35:32.256 DEBUG MQTT: Publishing to zwave/25/38/0/currentValue: {
time: 1680453332255,
value: 99,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:32.258 INFO Z-WAVE: [Node 025] Value updated: 38-0-currentValue 81 => 99
2023-04-02 16:35:32.271 INFO Z-WAVE: [Node 025] Metadata updated: 49-0-Power
2023-04-02 16:35:32.274 DEBUG MQTT: Publishing to zwave/25/49/0/Power: {
time: 1680453332273,
value: 0.7,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:32.275 INFO Z-WAVE: [Node 025] Value updated: 49-0-Power 0.7 => 0.7
2023-04-02 16:35:32.499 DEBUG MQTT: Publishing to zwave/25/lastActive: { time: 1680453332498, value: 1680453332498 } with options { qos: 1, retain: false }
It seems that this event is not collected and used by domoticz

Code: Select all

2023-04-02 16:35:25.519 DEBUG MQTT: Publishing to zwave/25/38/0/currentValue: {
time: 1680453325519,
value: 81,
nodeName: 'VoletSalon2',
nodeLocation: ''
} with options { qos: 1, retain: false }
2023-04-02 16:35:25.520 INFO Z-WAVE: [Node 025] Value updated: 38-0-currentValue 99 => 81
What do you think about that ? Have I missed something ? Is it a bug ?

Thank's for your help
User avatar
cbartetzko
Posts: 27
Joined: Sunday 25 December 2016 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Speyer/Germany
Contact:

Re: FGR222 state update not working

Post by cbartetzko »

I Had similar issues when migrating from OZW to ZwaveJS-UI. Some sensors were missing values in Domoticz.

The solution:

Have a look in the Device's Section "Home Assistent" in ZwaveJS-UI.
Only the sensors shown in this list are pushed to Domoticz via MQTT-Autodiscover.
If your desired sensor is missing, you can add one on the right side:
If none of the sensors is selected, you get an empty entry HASS Device JSon Field on the right side for a new device definition.
Now enter your new device definition and hit the "Add" button above.
Finally select the new device in the list an then hit the "Rediscover" Button on the right side above the definition.
This will push the new device to Domoticz.

The JSON syntax is a bit tricky, but you can copy/paste/modify existing ones. That helps.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Hello

I've tried rediscovering currentValue, but still the same problem.
The log shows the rediscovering, but after, only power is updated.
Tried with cover_position and switch_switch in Home Assitant view.

Code: Select all

 2023-04-03 22:10:28.037 Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_position (unique_id: zwavejs2mqtt_0xc7bf3f61_Node25_position)
2023-04-03 22:11:10.666 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:11:10.673 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:11:12.040 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:11:12.045 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:11:36.874 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:11:36.881 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:11:37.890 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:11:37.897 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:11:39.400 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:11:39.403 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:11:54.099 Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_switch (unique_id: zwavejs2mqtt_0xc7bf3f61_25-37-0-currentValue)
2023-04-03 22:12:36.043 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:12:36.050 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:12:37.568 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:12:37.573 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:12:49.078 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:12:49.086 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:12:50.180 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:12:50.183 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-03 22:12:51.723 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-03 22:12:51.726 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power
Even after rediscovering (position and currentValue), when I change state via direct remote control, the state is not updated
It seems that the topic update is not detected, only power.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

I have re checked with mqtt explorer when doing rediscover

Here is the topic generated

Code: Select all

{
  "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"
    ],
    "manufacturer": "Fibargroup",
    "model": "Roller Shutter 2 (FGR222)",
    "name": "VoletSalon2",
    "sw_version": "25.25"
  },
  "name": "VoletSalon2_position",
  "unique_id": "zwavejs2mqtt_0xc7bf3f61_Node25_position"
}
Here is the log of domoticz

Code: Select all

2023-04-03 22:34:17.879 Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_position (unique_id: zwavejs2mqtt_0xc7bf3f61_Node25_position)
When I open or close with remote controller, topic "zwave/25/38/0/currentValue" is updated.
Before

Code: Select all

{
  "time": 1680553897038,
  "value": 0,
  "nodeName": "VoletSalon2",
  "nodeLocation": ""
}
After

Code: Select all

{
  "time": 1680553975783,
  "value": 9,
  "nodeName": "VoletSalon2",
  "nodeLocation": ""
}
But the position is not updated in domoticz. Blind is still closed.
Could it be a bug ? Is there any way to check that ? Something else to verify ?
User avatar
cbartetzko
Posts: 27
Joined: Sunday 25 December 2016 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Speyer/Germany
Contact:

Re: FGR222 state update not working

Post by cbartetzko »

Your MQTT-Explorer logs show topics with prefix zwave.
These topics are not seen by Domoticz MQTT-Autodiscover, which typically listens to prefix "homeassistant"
unless you have changed that in the Domoticz Hardware setting.

Anyhow this prefix defined in Domoticz Hardware has to be identical with the prefix defined in Zwave-JSUI-HomeAssistand-Settings.

So what you have to do, is defining the "25/38/0/currentValue" device in Zwave-JSUI-HomeAssistand-Section of the FGR222.
After adding this as a new device and Rediscovering this sensor it should appear in Domoticz and should get updated.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

The device is present and working in domoticz
If I send command from domoticz, it works. The roller shutter open and close.

What does not work is the position returned when I change via remote controller (so directly to the device, without domoticz commanding it). It's the same if i use a switch directly connected to fgr222 input (I did not verify before). In those two cases, the position is not updated in domoticz.

For the prefix, when you do "rediscover", it publishes in "homeassistant/cover/VoletSalon2/position/config" (the homeassistant prefix is here)

What is published here is

Code: Select all

{
  "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"
    ],
    "manufacturer": "Fibargroup",
    "model": "Roller Shutter 2 (FGR222)",
    "name": "VoletSalon2",
    "sw_version": "25.25"
  },
  "name": "VoletSalon2_position",
  "unique_id": "zwavejs2mqtt_0xc7bf3f61_Node25_position"
}
It tells where to find updated values (and there is no prefix here)

So I think there is a bug. The position topic is not read by domoticz, and domoticz don't update roller shutter from topic.
I don't know how to verify my idea
User avatar
cbartetzko
Posts: 27
Joined: Sunday 25 December 2016 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Speyer/Germany
Contact:

Re: FGR222 state update not working

Post by cbartetzko »

"position_topic": "zwave/25/38/0/currentValue" says that it's published under prefix zwave and not homeassistant.
That's why Domoticz can't see it.

Can you post the contents of HomeAssistant Section of your FGR222 Device in Zwave-JSUI ?

I'm using Philio Roller Shutter controls. Attached you find a screenshot of the position feedback,
which works perfectly in Domoticz, also when I operate locally with wired switches.
Attachments
Bildschirmfoto 2023-04-04 um 23.06.40.png
Bildschirmfoto 2023-04-04 um 23.06.40.png (118.73 KiB) Viewed 1155 times
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Here is the screenshot of position
fgr222Position.png
fgr222Position.png (40.48 KiB) Viewed 1153 times
And it's exactly the same for current
fgr222current.png
fgr222current.png (43.98 KiB) Viewed 1153 times
And current is working (updated in domoticz). Both are with zwave prefix.

Am I missing something ?
My other sensors are working in the same way (dimmer for example, data are in zwave/nodeId/... and discover published in homeassistant/...) And values are updated in domoticz
User avatar
cbartetzko
Posts: 27
Joined: Sunday 25 December 2016 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Speyer/Germany
Contact:

Re: FGR222 state update not working

Post by cbartetzko »

Hm, looks good basically. The only difference to my Philio Definition for cover_position seems to be the position_template.
Maybe you give it a try and change that to "position_template": "{{ value_json.value | round(0) }}", then update and rediscover.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Hello

I m not at home today. I ll try it friday and tell you.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Hello

It does not change anything
Here is the new paramaters
fgr222-zwavejsupdate.png
fgr222-zwavejsupdate.png (59.82 KiB) Viewed 1117 times
I open the roller shutter with domoticz to 19%. Then I closed it with remote control
The status is still open at 19% in domoticz
fgr222-open.png
fgr222-open.png (24.4 KiB) Viewed 1117 times
The status is OK in zwavejsui
fgr222-zwavejsmultilevel.png
fgr222-zwavejsmultilevel.png (33.48 KiB) Viewed 1117 times
Moreover, by reading domoticz log, we can see it does not detect topic update. It detects only power update

Code: Select all

2023-04-07 21:05:46.347 Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_position (unique_id: zwavejs2mqtt_0xc7bf3f61_Node25_position)
2023-04-07 21:06:49.598 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-07 21:06:49.604 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-07 21:06:54.624 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-07 21:06:54.636 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-07 21:08:36.394 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-07 21:08:36.399 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-07 21:08:38.452 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-07 21:08:38.464 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power)
2023-04-07 21:08:41.270 MQTTAuto: General/kWh (VoletSalon2_electric_kwh_value)
2023-04-07 21:08:41.275 MQTTAuto: Usage/Electric (VoletSalon2_electricity_power) 
I'm sure it was working when I migrate from openzwave to zwavejsui. But I don't know when it was broken (2023.1 or recent update of zwavejsui). But as the data are published in topic and seems not detected by domoticz, I think it could be domoticz
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Hello

I've done some new try today
I start domoticz in debug mode with

Code: Select all

./domoticz -www 8080 -sslwww 443 -log "/var/log/domoticz.log" -loglevel all -debuglevel normal,auth,hardware,received,webserver,eventsystem,python
And I collect the trace from "salon2" which is the new name after delete and recreate the roller shutter.
In the startup sequence, here are the log

Code: Select all

2023-04-09 10:06:03.463  Debug: MQTTAuto: Topic: homeassistant/cover/VoletSalon2/position/config, Message: {"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"],"manufacturer":"Fibargroup","model":"Roller Shutter 2 (FGR222)","name":"VoletSalon2","sw_version":"25.25"},"name":"VoletSalon2_position","unique_id":"zwavejs2mqtt_0xc7bf3f61_Node25_position"}
2023-04-09 10:06:03.464  Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_position (unique_id: zwavejs2mqtt_0xc7bf3f61_Node25_position)
2023-04-09 10:06:03.565  Debug: MQTTAuto: Topic: homeassistant/switch/VoletSalon2/switch/config, Message: {"payload_off":false,"payload_on":true,"value_template":"{{ value_json.value }}","command_topic":"zwave/25/37/0/targetValue/set","state_topic":"zwave/25/37/0/currentValue","device":{"identifiers":["zwavejs2mqtt_0xc7bf3f61_node25"],"manufacturer":"Fibargroup","model":"Roller Shutter 2 (FGR222)","name":"VoletSalon2","sw_version":"25.25"},"name":"VoletSalon2_switch","unique_id":"zwavejs2mqtt_0xc7bf3f61_25-37-0-currentValue"}
2023-04-09 10:06:03.565  Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_switch (unique_id: zwavejs2mqtt_0xc7bf3f61_25-37-0-currentValue)
2023-04-09 10:06:03.666  Debug: MQTTAuto: Topic: homeassistant/sensor/VoletSalon2/power_power/config, Message: {"value_template":"{{ value_json.value }}","unit_of_measurement":"W","device_class":"power","state_topic":"zwave/25/49/0/Power","json_attributes_topic":"zwave/25/49/0/Power","device":{"identifiers":["zwavejs2mqtt_0xc7bf3f61_node25"],"manufacturer":"Fibargroup","model":"Roller Shutter 2 (FGR222)","name":"VoletSalon2","sw_version":"25.25"},"name":"VoletSalon2_power_power","unique_id":"zwavejs2mqtt_0xc7bf3f61_25-49-0-Power"}
2023-04-09 10:06:03.666  Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_power_power (unique_id: zwavejs2mqtt_0xc7bf3f61_25-49-0-Power)
2023-04-09 10:06:03.767  Debug: MQTTAuto: Topic: homeassistant/sensor/VoletSalon2/current_current/config, Message: {"value_template":"{{ value_json.value }}","unit_of_measurement":"A","device_class":"current","state_topic":"zwave/25/49/0/Current","json_attributes_topic":"zwave/25/49/0/Current","device":{"identifiers":["zwavejs2mqtt_0xc7bf3f61_node25"],"manufacturer":"Fibargroup","model":"Roller Shutter 2 (FGR222)","name":"VoletSalon2","sw_version":"25.25"},"name":"VoletSalon2_current_current","unique_id":"zwavejs2mqtt_0xc7bf3f61_25-49-0-Current"}
2023-04-09 10:06:03.767  Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_current_current (unique_id: zwavejs2mqtt_0xc7bf3f61_25-49-0-Current)
2023-04-09 10:06:03.867  Debug: MQTTAuto: Topic: homeassistant/sensor/VoletSalon2/electric_kwh_value/config, Message: {"value_template":"{{ value_json.value }}","unit_of_measurement":"kWh","state_class":"total_increasing","device_class":"energy","state_topic":"zwave/25/50/0/value/65537","json_attributes_topic":"zwave/25/50/0/value/65537","device":{"identifiers":["zwavejs2mqtt_0xc7bf3f61_node25"],"manufacturer":"Fibargroup","model":"Roller Shutter 2 (FGR222)","name":"VoletSalon2","sw_version":"25.25"},"name":"VoletSalon2_electric_kwh_value","unique_id":"zwavejs2mqtt_0xc7bf3f61_25-50-0-value-65537"}
2023-04-09 10:06:03.868  Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_electric_kwh_value (unique_id: zwavejs2mqtt_0xc7bf3f61_25-50-0-value-65537)
2023-04-09 10:06:03.968  Debug: MQTTAuto: Topic: homeassistant/sensor/VoletSalon2/electric_w_value/config, Message: {"value_template":"{{ value_json.value }}","unit_of_measurement":"W","device_class":"power","state_topic":"zwave/25/50/0/value/66049","json_attributes_topic":"zwave/25/50/0/value/66049","device":{"identifiers":["zwavejs2mqtt_0xc7bf3f61_node25"],"manufacturer":"Fibargroup","model":"Roller Shutter 2 (FGR222)","name":"VoletSalon2","sw_version":"25.25"},"name":"VoletSalon2_electric_w_value","unique_id":"zwavejs2mqtt_0xc7bf3f61_25-50-0-value-66049"}
2023-04-09 10:06:03.969  Status: MQTTAuto: discovered: VoletSalon2/VoletSalon2_electric_w_value (unique_id: zwavejs2mqtt_0xc7bf3f61_25-50-0-value-66049)
When I manually change state with remote controller

Code: Select all

2023-04-09 10:06:29.279  Debug: MQTTAuto: Topic: zwave/25/49/0/Power, Message: {"time":1681027589271,"value":243,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:29.280  Debug: SQLH UpdateValueInt VoletSalon2_power_power HwID:12  DevID:zwavejs2mqtt_0xc7bf3f61_25-49-0-Power Type:248  sType:1 nValue:0 sValue:243.000 
2023-04-09 10:06:29.281  MQTTAuto: Usage/Electric (VoletSalon2_power_power)
2023-04-09 10:06:33.089  Debug: MQTTAuto: Topic: zwave/25/38/0/currentValue, Message: {"time":1681027593073,"value":88,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:36.847  Debug: MQTTAuto: Topic: zwave/25/49/0/Power, Message: {"time":1681027596841,"value":0.7,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:36.848  Debug: SQLH UpdateValueInt VoletSalon2_power_power HwID:12  DevID:zwavejs2mqtt_0xc7bf3f61_25-49-0-Power Type:248  sType:1 nValue:0 sValue:0.700 
2023-04-09 10:06:36.849  MQTTAuto: Usage/Electric (VoletSalon2_power_power)
2023-04-09 10:06:44.948  Debug: MQTTAuto: Topic: zwave/25/38/0/currentValue, Message: {"time":1681027604942,"value":94,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:48.730  Debug: MQTTAuto: Topic: zwave/25/49/0/Power, Message: {"time":1681027608718,"value":0.7,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:48.732  Debug: SQLH UpdateValueInt VoletSalon2_power_power HwID:12  DevID:zwavejs2mqtt_0xc7bf3f61_25-49-0-Power Type:248  sType:1 nValue:0 sValue:0.700 
2023-04-09 10:06:48.735  MQTTAuto: Usage/Electric (VoletSalon2_power_power)
2023-04-09 10:06:52.558  Debug: MQTTAuto: Topic: zwave/25/38/0/currentValue, Message: {"time":1681027612551,"value":99,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:56.360  Debug: MQTTAuto: Topic: zwave/25/49/0/Power, Message: {"time":1681027616346,"value":0.7,"nodeName":"VoletSalon2","nodeLocation":""}
2023-04-09 10:06:56.361  Debug: SQLH UpdateValueInt VoletSalon2_power_power HwID:12  DevID:zwavejs2mqtt_0xc7bf3f61_25-49-0-Power Type:248  sType:1 nValue:0 sValue:0.700 
2023-04-09 10:06:56.364  MQTTAuto: Usage/Electric (VoletSalon2_power_power)
So domoticz see position update in the topic "zwave/25/38/0/currentValue". But domoticz never update anything with this value
Last edited by barry44 on Sunday 09 April 2023 22:33, edited 1 time in total.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Me again

I've open domoticz source code. My last c++ is over 20 years at school :D A bit hard.
I started from "https://github.com/domoticz/domoticz/bl ... scover.cpp" with this method

Code: Select all

void MQTTAutoDiscover::on_message(const struct mosquitto_message* message)
The log message "Debug: MQTTAuto: Topic: zwave/25/38/0/currentValue..." is from (line 60)

Code: Select all

Debug(DEBUG_HARDWARE, "Topic: %s, Message: %s", topic.c_str(), qMessage.c_str());

I hope it goest to

Code: Select all

handle_auto_discovery_sensor_message(message, itt.first);
but I don't really understand this

Code: Select all

(mosquitto_topic_matches_sub(itt.first.c_str(), topic.c_str(), &result) == MOSQ_ERR_SUCCESS
(1)
In my opinion, where are checking if the message is coming from a registered topic.
Then I think it continues to (line 1305)

Code: Select all

void MQTTAutoDiscover::handle_auto_discovery_sensor_message(const struct mosquitto_message* message, const std::string& subscribed_topic)

Code: Select all

bIsJSON = root.isObject();
Supposed to be true (message is json)

Code: Select all

(pSensor->position_topic == topic)
Supposed to be true (it's a position topic)

Code: Select all

if (!pSensor->position_template.empty())
Supposed to be true (there is a template)

Code: Select all

szValue = GetValueFromTemplate(root, pSensor->position_template);
(2)Get the value from template. And then goes to

Code: Select all

else if (pSensor->component_type == "cover")
handle_auto_discovery_cover(pSensor, message);
and then (line 2772)

Code: Select all

void MQTTAutoDiscover::handle_auto_discovery_cover(_tMQTTASensor* pSensor, const struct mosquitto_message* message)
{
	InsertUpdateSwitch(pSensor);
}

Code: Select all

void MQTTAutoDiscover::InsertUpdateSwitch(_tMQTTASensor* pSensor)

Code: Select all

if (pSensor->component_type == "cover")
	{
		UpdateBlindPosition(pSensor);
		return;
	}
line 3666

Code: Select all

void MQTTAutoDiscover::UpdateBlindPosition(_tMQTTASensor* pSensor)
line 3702

Code: Select all

	if (pSensor->last_value.empty())
		return;
I don'y understand what is checked.
After that, it's json, going to this condition

Code: Select all

else if (!root["value"].empty())
then convert to integer, verify if there is level change (and there is one), and finally update both device and level

Code: Select all

		UpdateValueInt(m_HwdID, pSensor->unique_id.c_str(), pSensor->devUnit, pSensor->devType, pSensor->subType, pSensor->SignalLevel, pSensor->BatteryLevel, pSensor->nValue, pSensor->sValue.c_str(),
			szDeviceName);

		if (bHaveLevelChange)
			m_sql.UpdateDeviceValue("LastLevel", level, szIdx);
But there is no update in the log message. So something get wrong before

I can see 3 main failures (but I'm not sure)
- the topic updated is not registered. So it does not continue at (1)
- the template evaluation return nothing (2)
- another failure I miss.

Quite a long message, but I don't know how to go further. If a MQTT Auto discovery dev can help me to understand what happen
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

I've just find that
https://github.com/domoticz/domoticz/issues/5620

So the trouble is the position_template which could not be evaluated.
last beta seems to correct it. But I can't upgrade to last beta.

I'm still trying to update the hass, but it's not taken by zwavejsui. When I tried it (a few post before), I did not verify what was push in the discovery topic. My bad !
I don't understand why, but just changing position_template does not work. Previous value is maintained.
barry44
Posts: 27
Joined: Thursday 17 November 2016 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Contact:

Re: FGR222 state update not working

Post by barry44 »

Hello

Finally it's ok with a zwavejsui upgrade.
Now, HASS update works.
Changing position template works fine !

thank you for the idea @
cbartetzko wrote: Wednesday 05 April 2023 8:18
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests