I would really love to have two MQTT-modules: "MQTT-sender" and "MQTT-receiever".
They should be similar to the "HTTP Request Sender" and "HTTP-switcher".
Moderators: Admin_N, Administrator, Admin_P, Admin_K
skylord123 Wrote:I use this to integrate with home assistant as well as other providers. I ended up creating a docker that runs a python web server to turn the requests from the HTTP Request Sender into MQTT messages. I have the code here: https://hub.docker.com/r/skylord123/xeoma-mqtt/
The reason mqtt would be nice is because instead of sending requests to a single http receiver mqtt messages can be intercepted by various devices. I use this to notify Home Assistant to turn on my front door light when motion is detected on the path to my front door. But I could also have my other devices listen for these messages and act on the same message.
I would prefer having this functionality built into Xeoma. Makes integrating with other systems much easier.
[{"id":"7bf4e37f.71669c","type":"tab","label":"Flow 5"},{"id":"42212607.be6e48","type":"comment","z":"7bf4e37f.71669c","name":"Instructions","info":"In domoticz go to Hardware/create virtual device\nlookup the IDX in the devices tab","x":395,"y":22,"wires":[]},{"id":"871b5baa.9c2418","type":"mqtt out","z":"7bf4e37f.71669c","name":"domoticz/in","topic":"domoticz/in","qos":"","retain":"","broker":"ecc5db38.629e78","x":710,"y":87,"wires":[]},{"id":"3a87e7c1.c088b8","type":"function","z":"7bf4e37f.71669c","name":"Message","func":"var output = msg.payload.split(\"/\");\nvar cam_idx = parseInt(output[2]);\nvar Status_id = parseInt(output[3]);\n\nmsg.payload = {};\nmsg.payload.command = \"switchlight\";\nmsg.payload.idx = cam_idx;\nif (Status_id==1) {\nmsg.payload.switchcmd = \"On\" ;\nmsg.payload.level = 100;\n}\nelse if (Status_id===0) {\nmsg.payload.switchcmd = \"Off\";\nmsg.payload.level = 0;\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":344,"y":150,"wires":[["871b5baa.9c2418","54e58729.f9d1c8"]]},{"id":"54e58729.f9d1c8","type":"debug","z":"7bf4e37f.71669c","name":"DOMOTICZ","active":true,"console":"false","complete":"payload","x":705,"y":214,"wires":[]},{"id":"ca73dfe.0ebeb2","type":"inject","z":"7bf4e37f.71669c","name":"XEOMA","topic":"","payload":"GET /camera/167/0 HTTP/1.1User-Agent: UserAgentFSHost: 192.168.10.7","payloadType":"str","repeat":"","crontab":"","once":false,"x":137,"y":57,"wires":[["3a87e7c1.c088b8"]]},{"id":"f9a8ebce.c24ca8","type":"tcp in","z":"7bf4e37f.71669c","name":"Xeoma_In","server":"server","host":"","port":"5001","datamode":"single","datatype":"utf8","newline":"","topic":"/camera","base64":false,"x":118,"y":191,"wires":[["3a87e7c1.c088b8"]]},{"id":"ecc5db38.629e78","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
Return to Xeoma - General discussion
Users browsing this forum: No registered users and 9 guests