Hi
I was posting here earlier regarding HC2 integration with the DSC alarm. After tricky research with a lot of needed info missing and testing of the Fibaro alarm plugin, I decided to start to write my own integration code. No need to use the crappy EnvisaLink plugin in HC2.
I have used EnvisaLink 4 and used the API to it (95% is same as IT-100 API). You do not need to allow traffic to Internet från the EnvisaLink to Eyezon or so.
Just plug in the EnvisaLink, power it up and you are ready to go directly (well, maybe change password..). The code is running in a virtual device. The code is working very well, has different debug levels and also has log to syslog implemented.
Scenes can use the “traps” from the alarm sensors through global variables. Extending it to read and write anything to/from the DSC alarm is very easy from here. I do however wonder if there is a better way than using global variables (that cannot be created from lua). I mean… there should be a way to directly talk between scenes and VD:s… But I haven’t found any…
Comments and feedback to the code is very much appreciated before I give the code its final touch… But don’t be to hard on me. I am rather new to Lua and HC2. And it is a beta after all that I have spent a day on… The API poll function is used to have control of the TCP socket. Documentation of the code is in the top of the lua file. Right now the code it is rather basic. I will implement buttons and writing to the alarm as well from scenes and also implement more stuff from the API. But as said... I would very much appreciate some feedback before I continue the work.
http://www.incedo.eu/~sjoholmp/Fibaro_Homecenter/LUA/VDs/HC2_DSCengine/
Here are a few log output screenshots: