Ithowifi, MQTT Auto discovery and python Topic is solved

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

Moderator: leecollings

Post Reply
DBND
Posts: 3
Joined: Friday 02 January 2026 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Ithowifi, MQTT Auto discovery and python

Post by DBND »

When installing the Ithowifi device, it works almost out of the box with Domoticz, based on MQTT auto discovery. Almost.
The sensors are read, and a multi level device is created for control. However for me the control does not work, as the control commands as published in the MQTT AD are not correctly parsed by Domoticz it seems. This may be an issue with the template in MQTT, but could equally be a python issue on the Domoticz side. Especially since issuing the commands using MQTT explorer directly does work.

In summary (also published on github for the Ithowifi SW https://github.com/arjenhiemstra/ithowifi/issues/289):
  • the humidity and temperature are created. visible and updated.
    the fan status is created with settings and updated.
The device buttons provide the command with a capital, and this does not work:
homeassistant/cmd
cmd = Medium
or cmd = Low

Publishing from within Domoticz, from devices works:
homeassistant/cmd
cmd = medium
cmd = low

pushing the button within Domoticz for Timer 10 minutes results in the the command
cmd = Timer 10min
So not the expected command timer1.

So it seems that the commands are not correctly programmed in the autodiscovery, I guess something goes wrong in this part of the config, and perhaps specifically the last line:
"pr_modes": [
"Low",
"Medium",
"High",
"Timer 10min",
"Timer 20min",
"Timer 30min"
],
"pr_mode_cmd_t": "homeassistant/cmd",
"pr_mode_cmd_tpl": "{%- if value == 'Low' %}{{'low'}}{%- elif value == 'Medium' %}{{'medium'}}{%- elif value == 'High' %}{{'high'}}{%- elif value == 'Timer 10min' %}{{'timer1'}}{%- elif value == 'Timer 20min' %}{{'timer2'}}{%- elif value == 'Timer 30min' %}{{'timer3'}}{%- endif -%}"

Either it is not parsed (but why do I still get a command then), or incorrectly parsed?

My current Domoticz versions for reference:
Version: 2025.2 (build 16818)
Build Hash: 2f9016a8b
Compile Date: 2025-10-19 11:41:46
dzVents Version: 3.1.8
Python Version: 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]

Could this be a python version issue? I really do not know, and do not have sufficient knowledge on the topic. What I can do, is testing, if anyone has some suggestions.
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Ithowifi, MQTT Auto discovery and python

Post by waltervl »

Domoticz does not support value templates with logic in it. It needs plain values.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DBND
Posts: 3
Joined: Friday 02 January 2026 12:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Ithowifi, MQTT Auto discovery and python

Post by DBND »

Thanks. I guess I will need to use MQTT mapper or Node-Red in between then to map. Will try (but before that I have some other issues to solve)
User avatar
waltervl
Posts: 6676
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Ithowifi, MQTT Auto discovery and python

Post by waltervl »

You could try to send your own config topic with a simplified command value templates as the logic seems simple. Perhaps you also have to change the selector switch.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest