mqtt domoticz/in avec motion sensor
Publié : 30 mars 2020, 14:58
bonjour
J'ai crée un dummy motion sensor, avec les 2 commandes suivantes j'arrive à le passer "on" ou "off"
curl "http://192.168.0.6:8080/json.htm?type=c ... itchcmd=On"
curl "http://192.168.0.6:8080/json.htm?type=c ... tchcmd=Off"
Mon but c'est d'utiliser mqtt. J'aimerai passer la meme commande mais avec mosquitto_pub comme:
sudo mosquitto_pub -h localhost -m '{"idx" : 12, "switchcmd" : "On" }' -t 'domoticz/in'
Cette commande malheureusement ne marche pas mais elle est bien recu dans domoticz, voir la log:
020-03-30 14:50:04.363 Status: Incoming connection from: 192.168.0.6
2020-03-30 14:50:57.320 MQTT: Topic: domoticz/in, Message: {"idx" : 12, "switchcmd" : "On" }
2020-03-30 14:50:57.321 Error: MQTT: Invalid data received!
Pouvez vous m'indiquer la bonne syntaxe pour passer la commande via mosquitto_pub?
Merci
Cordialement
J'ai crée un dummy motion sensor, avec les 2 commandes suivantes j'arrive à le passer "on" ou "off"
curl "http://192.168.0.6:8080/json.htm?type=c ... itchcmd=On"
curl "http://192.168.0.6:8080/json.htm?type=c ... tchcmd=Off"
Mon but c'est d'utiliser mqtt. J'aimerai passer la meme commande mais avec mosquitto_pub comme:
sudo mosquitto_pub -h localhost -m '{"idx" : 12, "switchcmd" : "On" }' -t 'domoticz/in'
Cette commande malheureusement ne marche pas mais elle est bien recu dans domoticz, voir la log:
020-03-30 14:50:04.363 Status: Incoming connection from: 192.168.0.6
2020-03-30 14:50:57.320 MQTT: Topic: domoticz/in, Message: {"idx" : 12, "switchcmd" : "On" }
2020-03-30 14:50:57.321 Error: MQTT: Invalid data received!
Pouvez vous m'indiquer la bonne syntaxe pour passer la commande via mosquitto_pub?
Merci
Cordialement