Page 1 sur 1

mqtt domoticz/in avec motion sensor

Publié : 30 mars 2020, 14:58
par bend9
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

Re: mqtt domoticz/in avec motion sensor

Publié : 30 mars 2020, 15:33
par vil1driver
Salut,

pas certain que ça marche, j'ai juste tapé
switchcmd mqtt domoticz
dans google et j'ai pris la première réponse venue.. :|

Code : Tout sélectionner

{"command": "switchlight", "idx": 85, "switchcmd": "On"}
le wiki indique la même chose
https://www.domoticz.com/wiki/MQTT#Send ... ch_Command