help for convert MQTT message to MQTT discovery

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

Moderator: leecollings

Post Reply
david31
Posts: 11
Joined: Thursday 07 January 2016 11:32
Target OS: Linux
Domoticz version: 3.8153
Contact:

help for convert MQTT message to MQTT discovery

Post by david31 »

Hello

I have many scripts MQTT and ESP qui old MQTT protocol with example:
{"command": "switchlight", "idx": 701, "switchcmd": "On" }

My idx is a swith and name is Portilon:

I have tested with prefix "domoticz"
mosquitto_pub -h 127.0.0.1 -p 1883 -t "domoticz/switch/Portillon/set" -m ON

any message is received, any error

i have read the wiki https://www.domoticz.com/wiki/MQTT https://www.domoticz.com/wiki/Zigbee2MQ ... todiscover https://www.home-assistant.io/integrati ... -discovery
User avatar
waltervl
Posts: 5903
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: help for convert MQTT message to MQTT discovery

Post by waltervl »

Why change to AutoDiscover, these old messages are Domoticz native so are all fine.
Autodiscover is build on the principle you send first a config message so Domoticz will create a device end then send a state messsage to update the device. I would just keep using these messages.

But perhaps the firmware on the ESP is already Autodiscover compatible, just switch it on.
Firmwares that support Autodiscover:
ESPHome, ecowitt2mqtt, EsPurna, IOTLink, MiFlora MQTT Daemon, OpenMQTTGateway, Teleinfo MQTT, Wyzesense2MQTT, Arduino HAMqttDevice
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