hey guys,
I am trying to integrate OpenMQTTGateway with Domoticz Via MQTT.
I will try to explain my project. I Have 4 x 5v 16Mhz Arduino pro minis in weatherproof boxes on the property, they each have:
- 1x hc-sr501 Passive Infrared Sensor
- 1x 433,92Mhz transmitter
- 1x 5v Solar panel
- 1x 5v
- 1x 18650 lithium ion battery
The sketch running on the Arduinos is using the same rc-swtch library as OpenMQTTGateway.
The Basic sketch functions:
- go to sleep
- Wakeup every 4 hours and TX battery Voltage
- Waekup for TX Motion alerts after sunset (these will later turn on appropriate floodlights)
My basic idea was to TX a 5-bit unit-id before either sending battery info or motion alerts, this way you could distinguish between the multiple units and their values. I am no longer sure that is the right way to go, any insight there would be greatly appreciated.
So i have this as my setup, the Arduino sketches sending 433 codes to openMQTTGateway,
OMG then connects to the broker using “domoticz/in” topic.
So as of now Domoticz is receiving the MQTT messages perfectly…
But it seems like Domoticz doesn’t know what to do with them unless it has an IDX value.
the IDX value corresponds to actual or virtual devices in domotics.
so from mosquito (my broker) if i send:
mosquitto_pub -h -m '{ "idx" : 1, "nvalue" : 0, "svalue" : "25.0" }' -t 'domoticz/in'
It will update the device with that idx value with the svalue information.
my thoughts are this, if i can take a 8-bit Unit-ID and convert it to a IDX value, and also get my battery voltage in Millivolts (16bit), and or special motion code (16bit) for a total of 24bit message.
so my messages out to domoticz on mqtt would look like something like this:
{"idx" : 1,"svalue" : "3810"}
for my timer based battery check.
Is this possible to do in OpenMQTT gateway?
am i just trying to reinvent the wheel here? or is there a better option for the messaging idea.
I can post the code of my Arduino sketches if anyone is interested in seeing them.
I think i might be able to accomplish this by modifying the omg code a little bit, but not sure where to begin, or if there is already a protocol for 433 to do what i want and i am just peeing against the wind here trying to create a scheme!
Thanks in advance for any responses!