Page 1 of 1

New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Monday 08 May 2023 16:22
by waltervl
Just an heads up for the Beta users using MQTT Autodiscover: With the Setup button on the MQTT AD Hardware page you can see the configuration devices available for your environment.
For screenshots and more information see wiki:
https://www.domoticz.com/wiki/MQTT#MQTT ... very_Setup

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Monday 08 May 2023 17:48
by mgugu
Not working for me: No device shown when I click setup
Image

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Monday 08 May 2023 19:30
by waltervl
Then your devices do not have these options.

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Wednesday 17 May 2023 14:39
by rwblinn
No devices listed although added to Domoticz.
Raspberry Pi 4B, Domoticz 2023.1 Build 15234 BETA.

Please advice what is missing in the MQTT configuration.

Ran mqtt_ad_record.sh with output mqtt_ad_record_all.log:

Code: Select all

2023-05-17T14:23:55+0200	1	domoticz/sensor/sensorGardenT/config	{"name": "Garden Temp", "device_class": "temperature", "state_topic": "domoticz/sensor/sensorGarden/state", "value_template": "{{value_json.temperature}}", "unit_of_measurement": "°C", "unique_id": "SGT001"}
2023-05-17T14:23:55+0200	1	domoticz/sensor/sensorGardenH/config	{"name": "Garden Hum", "device_class": "humidity", "state_topic": "domoticz/sensor/sensorGarden/state", "value_template": "{{value_json.humidity}}", "unit_of_measurement": "%", "unique_id": "SGH001"}
2023-05-17T14:24:13+0200	0	domoticz/sensor/sensorGarden/state	{"temperature":20, "humidity":50}
2023-05-17T14:25:13+0200	0	domoticz/sensor/sensorGarden/state	{"temperature":20, "humidity":61}
...


Here another Domoticz log entry.

Code: Select all

2023-05-17 14:33:38.153 Debug: MQTTADGateway: topic: domoticz/sensor/sensorGarden/state, message: {"temperature":21, "humidity":56}
2023-05-17 14:33:38.282 Debug: MQTTADGateway: topic: domoticz/out, message: {
2023-05-17 14:33:38.282 "Battery" : 255,
2023-05-17 14:33:38.282 "LastUpdate" : "2023-05-17 14:33:38",
2023-05-17 14:33:38.282 "RSSI" : 12,
2023-05-17 14:33:38.282 "description" : "",
2023-05-17 14:33:38.282 "dtype" : "Humidity",
2023-05-17 14:33:38.282 "hwid" : "6",
2023-05-17 14:33:38.282 "id" : "SGH001",
2023-05-17 14:33:38.282 "idx" : 37,
2023-05-17 14:33:38.282 "name" : "Garden Hum",
2023-05-17 14:33:38.282 "nvalue" : 56,
2023-05-17 14:33:38.282 "stype" : "LaCrosse WS2300",
2023-05-17 14:33:38.282 "svalue1" : "1",
2023-05-17 14:33:38.282 "unit" : 1
2023-05-17 14:33:38.282 }
2023-05-17 14:33:38.282
2023-05-17 14:33:38.382 Debug: MQTTADGateway: topic: domoticz/out, message: {
2023-05-17 14:33:38.382 "Battery" : 255,
2023-05-17 14:33:38.382 "LastUpdate" : "2023-05-17 14:33:38",
2023-05-17 14:33:38.382 "RSSI" : 12,
2023-05-17 14:33:38.382 "description" : "",
2023-05-17 14:33:38.382 "dtype" : "Temp",
2023-05-17 14:33:38.382 "hwid" : "6",
2023-05-17 14:33:38.382 "id" : "SGT001",
2023-05-17 14:33:38.382 "idx" : 38,
2023-05-17 14:33:38.382 "name" : "Garden Temp",
2023-05-17 14:33:38.382 "nvalue" : 0,
2023-05-17 14:33:38.382 "stype" : "THR128/138, THC138",
2023-05-17 14:33:38.382 "svalue1" : "21.00",
2023-05-17 14:33:38.382 "unit" : 1

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Wednesday 17 May 2023 15:25
by waltervl
This option configuration option is only for devices with supported MQTT messages (i read somewhere about mqtt AD number devices).
So only if your sensor or switch is supporting this. Check the change in the source code: https://github.com/domoticz/domoticz/co ... 739e0c06af

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Wednesday 17 May 2023 16:03
by rwblinn
Thanks for clarity on the component type number.

Performed a test with component type number:
MQTT-AD Configuration & State Message

Code: Select all

mosquitto_pub -r -h localhost -p 1883 -t "domoticz/number/sensorGardenH/config" -m '{"name": "Garden Hum 2", "device_class": "humidity", "state_topic": "domoticz/number/sensorGarden/state", "value_template": "{{value_json.humidity}}", "unit_of_measurement": "%", "unique_id": "SGH002"}'

mosquitto_pub -h 127.0.0.1 -p 1883 -t "domoticz/number/sensorGarden/state" -m '{"humidity":99}'
mosquitto_pub -h 127.0.0.1 -p 1883 -t "domoticz/number/sensorGarden/state" -m '{"humidity":91}'
mqtt_ad_record.sh
Ran mqtt_ad_record.sh with output mqtt_ad_record_all.log:

Code: Select all

2023-05-17T15:47:51+0200        1       domoticz/number/sensorGardenH/config    {"name": "Garden Hum 2", "device_class": "humidity", "state_topic": "domoticz/number/sensorGarden/state", "value_template": "{{value_json.humidity}}", "unit_of_measurement": "%", "unique_id": "SGH002"}
2023-05-17T15:49:17+0200        0       domoticz/number/sensorGarden/state      {"humidity":99}
2023-05-17T15:50:54+0200        0       domoticz/number/sensorGarden/state      {"humidity":91}
Status
The device SGH002 is listed in the MQTT-AD hardware controller devices list:
Device=SGH002, Name=Garden Hum 2, Value=91, Unit=%.

Observations
* The new device SGH002 is not listed in the Domoticz Devices List (so no Idx).
* If the device value changes, via mosquitto_pub, there is no MQTT message send via domoticz/out (checked the Domoticz log).
* If the device value is updated in the MQTT-AD hardware controller devices list by selecting the entry, enter new value, press Update = the value is not updated when pressing Refresh nor a Domoticz log entry.

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Wednesday 17 May 2023 16:20
by waltervl
It supposed to send an MQTT message back after clicking on UPDATE. But it could be because your configuration is not correct.
Check ZWave-JS or Zigbee2MQTT how they use and configure those number device to configure the sensor (time-outs, limits, levels etc)

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Friday 05 July 2024 11:54
by Hencor
I have a small additional question regarding this topic.
Is there a possibility to change the values inside this setup section with dzvents or something?

Re: New Setup Feature for MQTT Autodiscover in 2023.1 Beta

Posted: Monday 08 July 2024 11:25
by waltervl
You can send MQTT payloads when you install mosquitto clients and use mosquitto_pub to the MQTT AD host (eg ZWAVE-JS-UI or Zigbee2MQTT)
To install mosquitto_pub use

Code: Select all

apt-get -y install mosquitto-clients
Docker:To install mosquitto_pub in the Domoticz Docker container use the customstart.sh script, see
https://www.domoticz.com/wiki/Docker#cu ... _container
The example includes mosquitto-clients install