@4integration:
I was thinking about also using json to publish messages to MQTT, but I can’t reproduce the way you use the JSON module, on calling json:encode, I get:
LuaInterface::CallFunction_Startup-1 device 106 function startup failed [string “…”]:62: attempt to call method ‘encode’ (a nil value)
Are you sure the JSON module you put in your zipfile is the one that is running on your vera?
@ 4integration:
I didn’t put JSON.lua in that directory, so that might just be it, I just uploaded it like the other files. I didn’t get any arrors on the require part, so it seemed to load ok. I will try it again, I just wrote my own small concatenation to create a JSON string, snd was now working on the other end, displaying the events using angular.js.
I will give it another try, thanks for your reply
My framework is now shaping up, I implemented 3 (actually 4) things now. The first is sending out events for all zwave devices that are directly controlled by the Vera. That way my central component on node.js will know those statusses. Works quite will, except for Duwi dimmers, they don’t report back at all if I manually change the lights.
The second is updating the display values of devices such as temperature and power devices. They get updated every few seconds or so. The third one is sending out direct command for some devices, in my case a few switches and shutters that I control from my arduino devices. Here I didn’t use the events only, but implemented the actions per child device. A fourth function I implemented only for making sure both controllers (Vera and my node.js based solution) stay in sync, which is an inform request over MQTT, which leads to the vera status of all devices to be sent over MQTT.
Directly switching on devices on vera I still do via HTTP, as long as the LUA implementation of MQTT client is still not asynchronous (which I feel might be the case forever).
As I’m working on both node.js, angular.js, learning LUA and learning about the vera, and also building the arduinos and my raspberry pi, it might be a while before it all works the way I want, but I’ll try to copy a still very rudimentary version of the plugin asap.
@averell - any chance you’d be able to share your code for the Vera side of things? I’m also building a central “coordinator” for my home control stuff with MQTT for message passing. I just picked up a Veralite to add to my other stuff, and it sounds like you’ve pretty much implemented exactly what I’d like to be able to do - just have the Vera publish all its events via MQTT, so I can consolidate them with my central control. Triggering controls on the Vera is fine with the web api…
Another way of doing it for me as I already have OpenHAB running since about 6 months is to simply use the MIOS binding. Through that I could get OpenHAB to MQTT the status changes.
Just setting up a new HA system that integrates with Open Energy Monitor and some Arduinos and so I would benefit a lot from having MQTT available on my new Vera Edge.
hello gang do you know if the vosmont/vera-mqtt is still working im no able to tu see the “mqttTarget” and “mqttTopic”. and dont see enything in the log