gizmocuz wrote:To get this good supported, please draw a picture of how this works, also what tools do i need to test/monitor.
Rob, I'll try even as I don't have much experience with it totally, but year 2014 is year of "Internet of Things" and MQTT is totally connected with that. It could bring Domoticz a lot of users/attention.
It's a simple protocol, which works something like between IRC/hub. There's a server (broker), which gets messages "published" by it's clients.
There are publishers, there are subscribers, there are topics.
Topic may be something like:
/home/device/aircondition
/home/device/light1
/home/device/light2
etc.
Now, Domoticz subscribes to a thread as a publisher and as a listener, so if I click on website (domoticz) "light1" ON, Domoticz publishes to broker (Mosquitto on same machine):
/home/device/aircondition, message: ON (or it can be /home/device/$idx, message: on, or whatever - there's no one standard for protocol).
Now, my Arduino (or any other client on the wolrd, even cellphone) subscribes to thread:
/home/device/# (# - so it gets every device ever posted to topic)
I write a simple rule "(if $device == aircondition) { if "on" -.... } etc.
Also, my Arduino can publish a message (if I use physical remote), same as Domoticz.
As it was mentioned in thread, Domoticz is (as heard) easy to integrade with MQTT as it uses nodejs. Maybe sebas and maxtrash can point out more how to do it easily.
Currently the nodejs hangs up from time to time and my messages are not delivered.
And, as a example - output from my arduino:
Code: Select all
-->: Turning DEBUG on!
MQ>: T: /actions/domoticz/mega, M: {"idx": 85, "nvalue": "1"}
>HC: T: 25.8'C, H: 36.7%
MQ>: T: /actions/domoticz/mega, M: {"idx": 37, "svalue": "25.8;36.7;0"}
>BH: Ping!
>EC: Ping!
>BH: T: 26.4'C, H: 33.9%, PIR: 0
MQ>: T: /actions/domoticz/bh, M: {"idx": 55, "svalue": "26.4;33.9;0"}
>IR: Ping!
>EC: 480W/h (total: 1191.8145 kWh) T: 33.5'C
MQ>: T: /actions/domoticz/ec, M: {"idx": 40, "svalue": "480;1191814.60"}
MQ>: T: /actions/domoticz/ec, M: {"idx": 34, "svalue": "33.5"}
That's what seen on mosquitto (broker):
Code: Select all
$ mosquitto_sub -t /# -v
/devices/hac Connected!
/actions/domoticz/mega {"idx": 85, "nvalue": "0"}
/actions/domoticz/bh {"idx": 39, "svalue": "25.9;43.3;0"}
/actions/domoticz/ec {"idx": 40, "svalue": "480;1191896.60"}
/actions/domoticz/ec {"idx": 34, "svalue": "34.0"}
/actions/domoticz/mega {"idx": 37, "svalue": "25.8;37.2;0"}
/actions/domoticz/bh {"idx": 55, "svalue": "26.3;31.7;0"}
More info can be found:
http://en.wikipedia.org/wiki/MQ_Telemetry_Transport
http://mqtt.org/
and in this thread
