Plugin(s) for "custom" devices

I?ll open by saying I?ve tried reading various bits of information I?ve found on the Internet and I?m utterly confused about Vera plugin development.

Anyway, it?s probably best to start of with my current situation. I am looking to move from my own system to Vera. Mine is pretty simple. It uses XPL and if I want to add a new device or interface to the server, I simply add a few details (eg. schema and a list of commands) to a database and the server has all it needs. The interfaces (eg rfxtrx, visonic) and in some cases I suppose devices, eg. ?windmill? run as stand alone programs, communicating with the server via XPL.

Most of my needs are catered for by Vera but I?m stuck on 2 and it?s conceivable that I could want to add my own ?watchamacallit? at any time. The 2 items are:

A motion sensor. In terms of layout and control, the MotionSensor:1 would be fine except I need to communicate with it via TCP.

Essentially a binary switch with a status display (I can start/stop my ?windmill? via an on off switch but I do want to know the basic information as to what it is actually doing, eg. idle, stopping, autorotate.). Again I?m looking at TCP communication.

My first question is whether I?d be better off considering these purely as new devices or whether it would be better to start off with some form of ?jonbanjo/Vera? interface that would control my odds and ends? I could come up with something simple that would say run on a PI, handle my bits and be willing to talk to a Vera plugin via some basic cr/lf protocol but I?m clueless on the Vera side.

Where to begin?

You might take a look at openLuup: http://forum.micasaverde.com/index.php/topic,34463.0.html which is an emulation of the Vera / MiOS / Luup environment, but open source and runs on any platform which can run Lua (ie. anything.)

All the UI is provided by AltUI: http://forum.micasaverde.com/index.php/topic,33309.msg244114.html#msg244114 (which can also run on a real Vera.)

Since it’s a Vera emulation, all the plugin API is the same, but the advantage is that it runs on a much more stable platform and you can just let Vera get on with the Z-Wave stuff (although a rudimentary plugin for the Razberry board is also available.)

Many Vera plugins run without modification on openLuup, and some of them are available on the “Alternative App Store”: http://forum.micasaverde.com/index.php/topic,38102.msg284741.html#msg284741 where it’s easy to post new plugins for people to use. There are several plugins which could act as models for the type of IO you need for your existing setup.

All the code for openLuup, AltUI, and AltAppSTore are available on GitHub, and a good socket library is part of the system: LuaSocket: Network support for the Lua language

…you’d have to like Lua programming, though :slight_smile:

I’ve only taken a quick look but openLuup most certainly looks interesting - thanks!

I’ll try to investigate that before, depending on how I go, come back with more questions.


I’ve no idea how I’ll take to Lua. I’m from expert in any but I usually cobble things up in Java, python or php.

Hi,

One thing you can quite easily do is manually create a Vera standard device for the motion sensor (plenty instructions on manual device creation) and then make your own implementation file to communicate with your whatchamacallit motion sensor over IP. Using http Get commands is done very simply in LUA, again plenty of examples.

One way I learned LUA is install an app that is close to what I think I need my solution to do and then delete it again. You can then download the files from your Vera via Apps > Develop Apps >Luup files. If you careful you can also then delete the files from your Vera via SSH or SCP to keep your until clean.

There is a lot of useful info on the Wiki and a lot of knowledge with the forum users.

Have fun,

Cheers Rene

Thanks. maybe a bit OT but I think between the 2 answers, I think I now have a pathway to Vera which at this stage is probably the most important thing for me.

It will take me a bit of time as I want to get some Z Wave stuff before making the move but I’ll switch from my stuff to Vera for the Z Wave and rfxtrx. I can live without the sensor for a while and operate the windmill via Android (I just loose automatic start/stop times). In the meanwhile I’ll get myself another PI as a platform to play with OpenLuup on.

Nothing like a plan is there ??? More seriously, I’m feeling more confident that I will be able to get everything sorted.