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

MQTT Autodiscover Thermostat missing switch #6052

Open
tfarray opened this issue Apr 3, 2024 · 9 comments
Open

MQTT Autodiscover Thermostat missing switch #6052

tfarray opened this issue Apr 3, 2024 · 9 comments

Comments

@tfarray
Copy link

tfarray commented Apr 3, 2024

In domoticz, I am missing one entry for my Thermostat in the MQTT Autodiscovered devices.

Device : Portable Reporting Controller Thermostat HVAC Horstmann (Secure Meters) SRT-321 Thermostat-HVAC
Missing switch : When the Thermostat changes to 'heat' (because it's too cold, and it turns heat on)
I can see the entry posted in MQTT, here is an example of the value :
mqtt -t >> 17:02:55 {"time":1712156575702,"value":0} zwave/MyThermostat/thermostat_operating_state/endpoint_0/state

This gives interesting data (not critical) to show when the thermostat wants to turn heat on and off.
Let me know if you want more details

@waltervl
Copy link
Collaborator

waltervl commented Apr 3, 2024

There is some info missing. For instructions how to report mqtt auto discover issues check the wiki page https://www.domoticz.com/wiki/MQTT_AD_Report_Problems

@tfarray
Copy link
Author

tfarray commented Apr 4, 2024

Hello, sorry for not having followed those instructions, I missed to read that prior to posting. I'm new to MQTT, and I still am learning eveyday.

Config Topic

homeassistant/climate/nodeID_5/climate/config

Config Payload

{
  "min_temp": 5,
  "max_temp": 40,
  "temp_step": 0.5,
  "modes": [
    "heat"
  ],
  "mode_state_template": "{{ {1: \"heat\"}[value_json.value] | default('off') }}",
  "current_temperature_topic": "zwave/nodeID_5/sensor_multilevel/endpoint_0/Air_temperature",
  "current_temperature_template": "{{ value_json.value }}",
  "temperature_state_topic": "zwave/nodeID_5/thermostat_setpoint/endpoint_0/setpoint/1",
  "temperature_state_template": "{{ value_json.value }}",
  "temperature_command_topic": "zwave/nodeID_5/thermostat_setpoint/endpoint_0/setpoint/1/set",
  "mode_state_topic": "zwave/nodeID_5/thermostat_mode/endpoint_0/mode",
  "mode_command_topic": "zwave/nodeID_5/thermostat_mode/endpoint_0/mode/set",
  "action_topic": "zwave/nodeID_5/thermostat_operating_state/endpoint_0/state",
  "action_template": "{{ {0: \"idle\", 1: \"heating\", 2: \"cooling\", 3: \"fan\", 4: \"idle\", 5: \"idle\", 6: \"fan\", 7: \"heating\", 8: \"heating\", 9: \"cooling\", 10: \"heating\", 11: \"heating\"}[value_json.value] | default('idle') }}",
  "temperature_unit": "C",
  "precision": 0.1,
  "device": {
    "identifiers": [
      "zwavejs2mqtt_0xf5c19b66_node5"
    ],
    "manufacturer": "Secure Meters (UK) Ltd.",
    "model": "Battery Powered Wall Thermostat (SRT321)",
    "name": "nodeID_5",
    "sw_version": "1.0"
  },
  "availability": [
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/nodeID_5/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",
  "name": "nodeID_5_climate",
  "unique_id": "zwavejs2mqtt_0xf5c19b66_Node5_climate"
}

State Topic & payload

Topic :  zwave/nodeID_5/thermostat_operating_state/endpoint_0/state
Value : {"time":1712216131009,"value":1}

But I don't think this is a "real" issue. It's just that the data does not get parsed to Domoticz. There is probably some filters set somewhere, but I don't know if it's per device or if there is a global schema.

@gizmocuz
Copy link
Contributor

gizmocuz commented Apr 4, 2024

I get one switch with this configuration

image

I think one of the reasons is that 'modes' only contain 'heat' ... no off or other values

@tfarray
Copy link
Author

tfarray commented Apr 4, 2024

Yes, I have this one too, but it's not the good one. On the device, when the heating icon turns on and off, this switch does not turn on/off. But when you look at the MQTT traffic, you can see that the mentioned topic does turn on/off together with the device.

@gizmocuz
Copy link
Contributor

gizmocuz commented Apr 4, 2024

I know, and the reason could be very well the 'modes' field in the config as it contains only one mode

@tfarray
Copy link
Author

tfarray commented Apr 4, 2024

This is beyond my understanding/knowledge. If you have any documentation related to this, I would be glad to take time and read it.

@gizmocuz
Copy link
Contributor

gizmocuz commented Apr 5, 2024

You could have a look in the MQTTAutoDiscovery.cpp source code.
When using Visual Studio Community, you could set break points when the config is parsed.
You could also read the HASS MQTT Auto Discovery documentation to see what the 'modes' field is for

@waltervl
Copy link
Collaborator

waltervl commented Apr 8, 2024

@gizmocuz When I look at the config payload I read
"mode_state_template": "{{ {1: "heat"}[value_json.value] | default('off') }}",

This would suggest to me that there should be a selector switch be made with "heat" and "off" values....

@tfarray If you look at the Domoticz switch and click on edit button, is the Off value visible? Is the Off value not hidden from the widget (that is a setting for Domoticz Selector switches)

@gizmocuz
Copy link
Contributor

gizmocuz commented Apr 9, 2024

@waltervl , no this is a 'template' to translate the values. It should be in the 'modes' array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants