Page 1 of 1

Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Wednesday 12 January 2022 0:01
by les2v
Dear Reader,

Happy new year 2022!!!!
Wish you the best for this year...

Mine is starting with few misunderstanding related to MQTT Auto discovery.
I have the following error message in domoticz log:
2022-01-11 23:28:01.360 Error: MQTT Auto Discovery Client: Climate device no idea how to interpretate state values (0x60a423fffeec42f2_climate_zigbee2mqtt)

Here is my setup:
Domoticz version is Version: 2021.1 (build 14040) running on pi4b.

I have setup zigbee2mqtt with only 1 device (HVAC) paired.
here is the message that I get from the zigbee2mqtt server:
MQTT publish: topic 'zigbee2mqtt/Chauffage Bureau', payload '{"linkquality":0,"local_temperature":19,"occupied_heating_setpoint":19,"running_state":"idle","unoccupied_heating_setpoint":15.5}'
Everything looks ok.


I have installer MQTT explorer to better understand the situation related to domoticz / mqtt auto discovery.
Here is the code I extracted related to the zigbee device:
{"action_template":"{% set values = {None:None,'idle':'off','heat':'heating','cool':'cooling','fan_only':'fan'} %}
{{ values[value_json.running_state] }}","action_topic":"zigbee2mqtt/Chauffage Bureau","availability":[{"topic":"zigbee2mqtt/bridge/state"}],"current_temperature_template":"
{{ value_json.local_temperature }}","current_temperature_topic":"zigbee2mqtt/Chauffage Bureau","device":{"identifiers":["zigbee2mqtt_0x60a423fffeec42f2"],"manufacturer":"Acova","model":"Alcantara 2 heater (ALCANTARA2)","name":"Chauffage Bureau"},"json_attributes_topic":"zigbee2mqtt/Chauffage Bureau","max_temp":"28","min_temp":"7","mode_command_topic":"zigbee2mqtt/Chauffage Bureau/set/system_mode","mode_state_template":"{{ value_json.system_mode }}","mode_state_topic":"zigbee2mqtt/Chauffage Bureau","modes":["off","heat","auto"],"name":"Chauffage Bureau","temp_step":0.5,"temperature_command_topic":"zigbee2mqtt/Chauffage Bureau/set/occupied_heating_setpoint","temperature_state_template":"{{ value_json.occupied_heating_setpoint }}","temperature_state_topic":"zigbee2mqtt/Chauffage Bureau","temperature_unit":"C","unique_id":"0x60a423fffeec42f2_climate_zigbee2mqtt"}

Any idea?
Thanks for your support.
les2v

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Wednesday 12 January 2022 9:39
by jvdz
You get that error because the config paylaod states to use this template: "mode_state_template":"{{ value_json.system_mode }}" when a MQTT message is received on: "mode_state_topic":"zigbee2mqtt/Chauffage Bureau" ... and that JSON payload doesn't contain the field "system_mode".
Any idea why that is?

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Wednesday 12 January 2022 22:28
by waltervl
Domoticz latest beta of today has a change about this subject.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Thursday 13 January 2022 6:15
by gizmocuz
@waltervl, that patch is not related to this problem.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Thursday 13 January 2022 13:58
by waltervl
gizmocuz wrote: Thursday 13 January 2022 6:15 @waltervl, that patch is not related to this problem.
Good (or not good...), that is why I formulated my announcement already with some reservation :-)

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Friday 14 January 2022 0:31
by les2v
jvdz wrote: Wednesday 12 January 2022 9:39 You get that error because the config paylaod states to use this template: "mode_state_template":"{{ value_json.system_mode }}" when a MQTT message is received on: "mode_state_topic":"zigbee2mqtt/Chauffage Bureau" ... and that JSON payload doesn't contain the field "system_mode".
Any idea why that is?
Not really. I am not sure where to find this info.
I have looked at all directories in mqtt quto discovery and also inside zigbee2mqtt.
I have not found the config payload definition file.

Do I get your question properly?

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 16:28
by les2v
Hi,

I am still trying to figure out the root cause of the error message.
[As you can understand I am completely new to the mqtt protocole.]

Here is what I have understood:

Zigbee2mqtt config for ACOVA HVAC is defined here in a file called "acova.js".
This is under the "zigbee-herdsman-converters " location. here is the extract I believe is moqt interesting for the error.

---
fromZigbee: [fz.thermostat, fz.hvac_user_interface],
toZigbee: [
tz.thermostat_local_temperature,
tz.thermostat_system_mode,
tz.thermostat_occupied_heating_setpoint,
tz.thermostat_unoccupied_heating_setpoint,
tz.thermostat_occupied_cooling_setpoint,
tz.thermostat_running_state,
],
exposes: [
exposes.climate()
.withSetpoint('occupied_heating_setpoint', 7, 28, 0.5)
.withLocalTemperature()
.withSystemMode(['off', 'heat', 'auto'])
.withRunningState(['idle', 'heat']),
---
System mode is well define in "toZigbee".
I believe this is what is called by jvdz the "config payload" file.
Please correct me if I am wrong.

I have also understood that "zigbee2mqtt.io" template for HVAC is defined as climate.
climate definition is at this location.
https://www.zigbee2mqtt.io/guide/usage/ ... l#specific (search for climate)
However, I am still not able to make the connections between these 2 topics.
Could you help me?

Thank you.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 17:15
by jvdz
Just use a program like MQTT_Explorer on a Windows computer and connect it to your MQTT Server, so you can see all MQTT traffic flowing between systems. There you should find the TOPIC used for AUTO Discovery ( default: HOMEASSISTANT/) under which you find all message for devices that will be discovered. One of them is for this device. When you have that you can look at the TOPICS used by this device for STATE and COMMANDS. Those topics should also be available in de MQTT_EXPLORER for display and likely one of those is generating this message.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 17:56
by les2v
Hi jvdz,

Thanks for taking the time to help me.
I"ve already checked with mqtt explorer.
Here is the copy my first message:
---
I have installed MQTT explorer to better understand the situation related to domoticz / mqtt auto discovery.
Here is the code I extracted related to the zigbee device:
{"action_template":"{% set values = {None:None,'idle':'off','heat':'heating','cool':'cooling','fan_only':'fan'} %}
{{ values[value_json.running_state] }}","action_topic":"zigbee2mqtt/Chauffage Bureau","availability":[{"topic":"zigbee2mqtt/bridge/state"}],"current_temperature_template":"
{{ value_json.local_temperature }}","current_temperature_topic":"zigbee2mqtt/Chauffage Bureau","device":{"identifiers":["zigbee2mqtt_0x60a423fffeec42f2"],"manufacturer":"Acova","model":"Alcantara 2 heater (ALCANTARA2)","name":"Chauffage Bureau"},"json_attributes_topic":"zigbee2mqtt/Chauffage Bureau","max_temp":"28","min_temp":"7","mode_command_topic":"zigbee2mqtt/Chauffage Bureau/set/system_mode","mode_state_template":"{{ value_json.system_mode }}","mode_state_topic":"zigbee2mqtt/Chauffage Bureau","modes":["off","heat","auto"],"name":"Chauffage Bureau","temp_step":0.5,"temperature_command_topic":"zigbee2mqtt/Chauffage Bureau/set/occupied_heating_setpoint","temperature_state_template":"{{ value_json.occupied_heating_setpoint }}","temperature_state_topic":"zigbee2mqtt/Chauffage Bureau","temperature_unit":"C","unique_id":"0x60a423fffeec42f2_climate_zigbee2mqtt"}
---

I belive that this is more a config issue related to zigbee2mqtt for acova device.
I also think that this sessage is sent by zigbee2mqtt server to mqtt server.
Am I correct?

Then you told me :
"You get that error because the config paylaod states to use this template: "mode_state_template":"{{ value_json.system_mode }}" when a MQTT message is received on: "mode_state_topic":"zigbee2mqtt/Chauffage Bureau" ... and that JSON payload doesn't contain the field "system_mode"."

So I am looking for the location where I need to add the "system_mode".
- I thought initially that it was in the config file: "acova.js" but I don't think so anymore because it's define in it. 'refer to my last message).
- So I have check the definition of the "climate" template in zigbee2mqtt website. I also see the system_mode definition.

So I am missing a piece of the puzzle. but still not clear to me.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 20:03
by les2v
I have also just found out that prior to the error message I have a first error message:

2022-01-15 19:56:27.350 Error: MQTT Auto Discovery Client: Exception: Type is not convertible to string!
2022-01-15 19:56:27.350 Error: MQTT Auto Discovery Client: Climate device no idea how to interpretate state values (0x60a423fffeec42f2_climate_zigbee2mqtt)

Maybe it's going to help.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 20:59
by jvdz
Yea, I guess you are getting close to compiling all the data but I also need the TOPIC name that goes with the posted PAYLOAD DATA as those are required when we need to debug issue like these.
So just capture the MQTT messages for the device CONFIG + the STATE updates you get for this device so I can test/replicate & debug the issue.
Preferably all different updates you get for this device so I can properly test. :)

EDIT: I think I have all required info to replicate the issue:

Code: Select all

2022-01-15 21:34:29.912  MQTT_HA: MQTT received: Chauffage Bureau (value: {"linkquality":0,"local_temperature":19,"occupied_heating_setpoint":19,"running_state":"idle","unoccupied_heating_setpoint":15.5})
2022-01-15 21:34:29.914  Error: MQTT_HA: Climate device no idea how to interpretate state values (0x60a423fffeec42f2_climate_zigbee2mqtt)
2022-01-15 21:34:29.922  MQTT_HA: Thermostat/SetPoint (Chauffage Bureau)

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 21:36
by les2v
Here is what I believe you have asked me:

---------------------------------------------
[Note: already sent in a previous message]
Extracted from MQTT explorer : homeassistant/climate/0x60a423fffeec42f2/climate/config

{"action_template":"{% set values = {None:None,'idle':'off','heat':'heating','cool':'cooling','fan_only':'fan'} %} {{ values[value_json.running_state] }}",
"action_topic":"zigbee2mqtt/Chauffage Bureau",
"availability":[
{"topic":"zigbee2mqtt/bridge/state"}],
"current_temperature_template":"{{ value_json.local_temperature }}",
"current_temperature_topic":"zigbee2mqtt/Chauffage Bureau",
"device":{"identifiers":["zigbee2mqtt_0x60a423fffeec42f2"],
"manufacturer":"Acova",
"model":"Alcantara 2 heater (ALCANTARA2)",
"name":"Chauffage Bureau"},
"json_attributes_topic":"zigbee2mqtt/Chauffage Bureau",
"max_temp":"28",
"min_temp":"7",
"mode_command_topic":"zigbee2mqtt/Chauffage Bureau/set/system_mode",
"mode_state_template":"{{ value_json.system_mode }}",
"mode_state_topic":"zigbee2mqtt/Chauffage Bureau",
"modes":["off","heat","auto"],
"name":"Chauffage Bureau",
"temp_step":0.5,
"temperature_command_topic":"zigbee2mqtt/Chauffage Bureau/set/occupied_heating_setpoint",
"temperature_state_template":"{{ value_json.occupied_heating_setpoint }}",
"temperature_state_topic":"zigbee2mqtt/Chauffage Bureau",
"temperature_unit":"C",
"unique_id":"0x60a423fffeec42f2_climate_zigbee2mqtt"}

---------------------------------------------------------------------------
Extracted from MQTT explorer : homeassistant/sensor/0x60a423fffeec42f2/linkquality/config

{"availability":[{"topic":"zigbee2mqtt/bridge/state"}],
"device":{"identifiers":["zigbee2mqtt_0x60a423fffeec42f2"],
"manufacturer":"Acova",
"model":"Alcantara 2 heater (ALCANTARA2)",
"name":"Chauffage Bureau"},
"enabled_by_default":false,
"entity_category":"diagnostic",
"icon":"mdi:signal",
"json_attributes_topic":"zigbee2mqtt/Chauffage Bureau",
"name":"Chauffage Bureau linkquality",
"state_class":"measurement",
"state_topic":"zigbee2mqtt/Chauffage Bureau",
"unique_id":"0x60a423fffeec42f2_linkquality_zigbee2mqtt",
"unit_of_measurement":"lqi",
"value_template":"{{ value_json.linkquality }}"}

------------------------------------------------------------------------------
I copy also the MQTT message extracted from Zigbee2MQTT webserver console:

MQTT publish: topic 'zigbee2mqtt/Chauffage Bureau', payload '{"linkquality":0,"local_temperature":21,"occupied_heating_setpoint":19,"running_state":"idle","system_mode":{"system_mode":"off"},"unoccupied_heating_setpoint":15.5}'

Hope you have all the data you need.
Thank you for your support.

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Saturday 15 January 2022 21:39
by jvdz
I have EDITING my last post.... and see you replied in the mean time.
Thanks for the info and have enough for the moment.!

EDIT from last post: I think I have all required info to replicate the issue:

Code: Select all

2022-01-15 21:34:29.912  MQTT_HA: MQTT received: Chauffage Bureau (value: {"linkquality":0,"local_temperature":19,"occupied_heating_setpoint":19,"running_state":"idle","unoccupied_heating_setpoint":15.5})
2022-01-15 21:34:29.914  Error: MQTT_HA: Climate device no idea how to interpretate state values (0x60a423fffeec42f2_climate_zigbee2mqtt)
2022-01-15 21:34:29.922  MQTT_HA: Thermostat/SetPoint (Chauffage Bureau)

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Sunday 16 January 2022 7:52
by gizmocuz
There are two issues with this climate sensor:

1. The status object does not 'always' contain the mode state value

Your fist payload post:

Code: Select all

{
  "linkquality": 0,
  "local_temperature": 19,
  "occupied_heating_setpoint": 19,
  "running_state": "idle",
  "unoccupied_heating_setpoint": 15.5
}
Your second payload post:

Code: Select all

{
  "linkquality": 0,
  "local_temperature": 21,
  "occupied_heating_setpoint": 19,
  "running_state": "idle",
  "system_mode": {
    "system_mode": "off"
  },
  "unoccupied_heating_setpoint": 15.5
}
2. The system_mode is reported in a object (named 'system_mode') and not as expected in the config in value_json.system_mode
In is reported in value_json[system_mode].system_mode

The exception jvdz mentioned above has been solved, but that does not solve this issue
This is not a Domoticz issue

Re: Error: MQTT Auto Discovery: Climate device no idea how to interpretate state values

Posted: Sunday 16 January 2022 17:12
by les2v
Hello,

Regarding 1/
I have checked zigbee2mqtt logs and they all have the same contents:
---
MQTT publish: topic 'zigbee2mqtt/Chauffage Bureau', payload '{"linkquality":0,"local_temperature":21,"occupied_heating_setpoint":19,"running_state":"idle","system_mode":{"system_mode":"off"},"unoccupied_heating_setpoint":15.5}'
---
So can't really explain the differences in terms of payload. I am continuing checking to confirm that this is not there anymore.

Regarding 2/
I understand that for system_mode we should get: "system_mode":"off" instead of "system_mode":{"system_mode":"off"}.
This message is published by Zigbee2mqtt script so I have opened an issue:
https://github.com/Koenkk/zigbee2mqtt/issues/10830

Hopefully with their support I will make some progress.

Thnank you for your support.
vfd.