mqtt domoticz/in with motion sensor

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
bend94
Posts: 12
Joined: Wednesday 01 June 2016 22:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

mqtt domoticz/in with motion sensor

Post by bend94 »

Hi,

i created a dummy motion sensor, with that commands i can put the motion on or 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"

My goal is to use mqtt. Now i would like to do the same but with mosquitto_pub command like :

sudo mosquitto_pub -h localhost -m '{"idx" : 12, "switchcmd" : "On" }' -t 'domoticz/in'

this syntax doesn't work but the message is received correctly by domoticz, i can see that in the 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!

Do you know what is the good syntax to do that with mosquitto_pub ?
thanks
regards
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: mqtt domoticz/in with motion sensor

Post by waaren »

bend94 wrote: Monday 30 March 2020 14:51 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!
Try with

Code: Select all

mosquitto_pub -m '{"command" : "udevice", "idx": 12, "nvalue": 0 }' -t domoticz/in
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
bend94
Posts: 12
Joined: Wednesday 01 June 2016 22:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: mqtt domoticz/in with motion sensor

Post by bend94 »

hi ok thx working now
one last question: is it possible to add the battery level in a "dummy motion sensor" devices ?

regards
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest