Page 1 of 1

MQTT autodiscovery of fan and swing

Posted: Tuesday 07 January 2025 16:19
by Syndomo
I've got a Faikin module to control a Daikin airco. It's connected via MQTT to Domoticz. All works fine except that no fan or swing devices are created by the Domoticz autodiscovery (MQTT Auto Discovery Client Gateway with LAN interface).

The MQTT config message looks OK. Based on this message several devices are created: temperature, setpoint, preset (eco-boost-home), and mode (heat-cool-etc). But no fan or swing device - though the message seems to contain the required information.

Full message:

Code: Select all

{"unique_id":"983DAEF01904","dev":{"ids":["983DAEF01904"],"name":"MyRoom","mdl":"12FC","sw":"9f65e5b","mf":"RevK","cu":"http://MyRoom.local/"},"icon":"mdi:thermostat","avty_t":"state/MyRoom","avty_tpl":"{{value_json.up}}","pl_avail":true,"pl_not_avail":false,"~":"command/MyRoom","min_temp":14,"max_temp":32,"temp_unit":"C","temp_step":0.5,"temp_cmd_t":"~/temp","temp_stat_t":"state/MyRoom","temp_stat_tpl":"{{value_json.target}}","curr_temp_t":"state/MyRoom","curr_temp_tpl":"{{value_json.temp}}","mode_cmd_t":"~/mode","mode_stat_t":"state/MyRoom","mode_stat_tpl":"{{value_json.mode}}","payload_on":"1","payload_off":"0","power_command_topic":"~/power","modes":["heat_cool","off","cool","heat","dry","fan_only"],"fan_mode_cmd_t":"~/fan","fan_mode_stat_t":"state/MyRoom","fan_mode_stat_tpl":"{{value_json.fan}}","fan_modes":["auto","low","lowMedium","medium","mediumHigh","high","night"],"swing_mode_cmd_t":"~/swing","swing_mode_stat_t":"state/MyRoom","swing_mode_stat_tpl":"{{value_json.swing}}","swing_modes":["off","H","V","H+V","C"],"pr_mode_cmd_t":"~/preset","pr_mode_stat_t":"state/MyRoom","pr_mode_val_tpl":"{{value_json.preset}}","pr_modes":["eco","boost","home"]}
This is the fan part of the message:

Code: Select all

"fan_mode_cmd_t":"~/fan","fan_mode_stat_t":"state/MyRoom","fan_mode_stat_tpl":"{{value_json.fan}}","fan_modes":["auto","low","lowMedium","medium","mediumHigh","high","night"],
and this is the swing part:

Code: Select all

"swing_mode_cmd_t":"~/swing","swing_mode_stat_t":"state/MyRoom","swing_mode_stat_tpl":"{{value_json.swing}}","swing_modes":["off","H","V","H+V","C"],
What could be the cause ?

-------
Whilst we're at it: I've been searching through the MQTTAutoDiscover.cpp code. There's probably two LOG_ERROR messages for the swing discovery that have been copied over from the fan discovery code where the word fan should be replaced by swing. It concerns lines 3495 and 3543. Not that I get those errors, I just thought I'd signal it.
Reading through the code I can't see why no fan or swing are created in my configuration - but then I'm all but a C++ expert.

Re: MQTT autodiscovery of fan and swing

Posted: Tuesday 07 January 2025 18:55
by waltervl
Better make a GitHub issue if you have MQTT AD issues and follow the instructions in https://wiki.domoticz.com/MQTT_AD_Report_Problems

Re: MQTT autodiscovery of fan and swing

Posted: Tuesday 07 January 2025 18:57
by waltervl
Additional: also check this issue https://github.com/domoticz/domoticz/issues/6069

Re: MQTT autodiscovery of fan and swing

Posted: Tuesday 07 January 2025 19:32
by Syndomo