VeraLite to Openhab conversion (using raspberry pi and razberry board)

I am starting this discussion to help address any questions that anyone might have and to talk about the API and possibilities of other options on the market. @Garrett commented on my iViri board asking for a general topic to be opened in regards to this so that we can give visibility to anyone else attempting or wanting to go down this route.

So to start off, I was a VeraLite user with ~37 devices (ranging from zwave lights, dimmers, locks and a thermostat). I am also the developer of the iViri app which brought some rich features to users and opened up the possibilities of the phones that everyone is carrying around with them. It isn’t perfect but I do work hard to make it be a good solution to anyone wanting to leverage technologies that these devices have. I was suffering for 5-10 crashes every hour, with no help from MCV to resolve it other than the standard response of uninstall a plugin. I was fed up and basically told their support what I really thought and decided that I needed to get more control over my setup and customization to allow for true home automation. I don’t personally like depending on others plugins to accomplish something that I see should be a core feature of a controller, instead of just trying to extend the access to the device switches which is all I see the Vera is useful for. After googl’ing for hours and days I came across the openHAB project.

The openhab project is a pure java based OSGI project that is aimed to take remove vendor proprietary and allow for a central hub that just works with each product you want to implement. This ranges from z-wave bindings to phillips hue to opensprinkler, etc… The best part of this project is it’s small footprint. Now I know being a java developer myself that you other java developers are going to rip that statement as being a small footprint, but what I can say is I am running openhab on my raspberry pi with the razberry child board and I am using about half the memory on the raspbian image running on there. The z-wave binding is making advances weekly and it currently working on the encrypted class support for door locks. I had trouble with both door locks and thermostat but I expect both of these to be resolved in the next couple of months. What I have done as a work around is setup the VeraLite to control my 2 locks and the thermostat and with openhab I have setup rules to call the remote api for control of those devices. So now I have everything incorporated but want the native support eventually. Openhab offers a REST API that is completely open, you don’t need plugins as if I need a “Virtual Switch” I just define the switch in my items file and it shows up in the interface. I can control that switch from the website or eventually from iViri which will be getting adapted to work with the openHAB project. I am very excited about its potential and I feel like this will be my permanent solution for HA and if the raspberry pi ends up not being powerful enough I will just move the content over to a desktop PC and slap a zwave usb stick in and watch it work. I am not making my case to make people switch over but I will say that everything that I hear on the boards about how they wish they had a plugin for TTS to airplay devices, openhab has a binding for it, anything you can think of you can do with openhab with ease and if it isn’t already built you can build a binding to make it work. Thoughts?

Oh and one more thing, I have had zero crashes since moving to the raspberry pi for my HA. Also DB persistence is setup with ease and you can graph and do whatever you want with the data by setting up your sitemap. If you are looking for true openness of a HA system, openhab is the way to go in my mind!

Does it have a concept of scenes and does it offer logic for and, or, etc expressions? I’ll have to order a zwave board for my spare pi I have laying around.

  • Garrett

[quote=“garrettwp, post:3, topic:181558”]Does it have a concept of scenes and does it offer logic for and, or, etc expressions? I’ll have to order a zwave board for my spare pi I have laying around.

  • Garrett[/quote]

You make your scenes which are called rules and scripts. Scripts are reusable objects that can be called in any of your rules and rules is based on a java type language. I think but can’t remember it is called XtendJava or something like that. Here is a link to some examples.

The cool part about it is I can do everything that PLEG offers and PLTS just by writing a rule. For timed events you can use CRON style format for when it should be triggers and in each rule you write you can create a timer to make different things trigger at different times and cancel the timers if different events come true during that time. If you have a RPI already I would just recommend a USB stick as that is what most users are testing on and there seems to be the most support but if you go with the razberry child board you can find some good threads on how to set it up or just hit me up and I will guide you. The only downfall right now is adding z-wave devices or removing z-wave devices, you have to run z-way-server or another z-wave software with openhab shutdown to get them added but once you have everything you shutdown that other stuff and bring up openhab and you can start customizing your home. Here is an example of how I setup my items file to bind a switch to the zwave protocol. You would do this with any binding that they offer for your specific device you are trying to implement. This project isn’t for a plug and play user but if you want full control and are of the coding mind set I see this was the way to go!.

Also on a final note they have a designer that you use (based on eclipse) that you open your configurations folder in and then you code inside of the designer. What I do is keep a remote copy of the configurations folder on my Mac and run the designer there and when I make a change I scp it across to the PI and it reloads the rules, items, sitemap and scripts without me restarting openhab which is really cool way of checking your code out and testing it without waiting 10 minutes for the startup to finish. That is the other thing 10 minutes to startup isn’t ideal (and it depends on the size of your network) but if it means stability and no crashes I will buy into it. The reason it takes so long is because it goes through and identifies your z-wave nodes and heals them.

The best part is you can reference your object straight from the items file by its name and you can get its different states. They also provide updating just a switch in the GUI without actually performing the operation on the device. It is just so flexible and I wanted to let other users know there is light on the otherside of the tunnel if you are not happy with the controller provided by Vera but want to stay in an open environment but have invested a lot of money into the z-wave technology.

/**

  • Rule to watch for sunset times and turn on outside lights 15 minutes ahead of time
    */
    rule “React to sunset”
    when
    Time cron “0 0 17 * * ?” // Every day 16:00 hours, evaluate sunset
    then
    var year = now.getYear
    var month = now.getMonthOfYear
    var day = now.getDayOfMonth
    var datum = year+“-”+month+“-”+day+" “+strSunset.state
    logInfo(“Sunset”,“datum = " + datum)
    var DateTime sunset = parse(year+”-”+month+“-”+day+“T”+strSunset.state)

     if(tIndoorLightsOn != null) 
     {
     	logInfo("Sunset","Timer tIndoorLights cancelled") 
     	tIndoorLightsOn.cancel()
     }
    
     logInfo("Sunset","Timer tIndoorLights created") 
     tIndoorLightsOn = createTimer(sunset.minusMinutes(15)) [|
     	logInfo("Sunset","Timer tIndoorLights executed") 
        	sendCommand(Light_Outside_Master_Bath, ON)
         sendCommand(Light_Outside_Front, ON)
         sendCommand(Light_Outside_Back, ON)
     ]
    

end

The hot-deploy mostly comes from OSGi, but its’ extremely handy not to have to restart the whole stack in order to pickup common configuration and/or code changes.

Makes for a very handy development cycle… one that’s built fundamentally into the way the product works :wink:

One thing that’s handy is that any state represented in Rules is scoped. So you can readily share stuff, and avoid naming collisions on the scope (important for larger, more complex, deployments)

The Bindings (Items) are a bit of a PITA, and sorely in need of something to describe, and generate them. …especially when you have a device with a [growing] list of things that can be bound to (like a Vera and it’s Device StateVariables). Kai et-al are working on that, as part of it’s morph into Eclipse’s Smarthome platform.

@guessed would you be interested in working on a binding with me for the Vera? We have communicated previously about openhab before I started the project but I think we could get a binding for Vera that would help bridge together without moving fully over to a new controller for z-wave. The only reason I moved completely over is because of my communication with Vera support or lack of support, something didn’t sit well with me about that experience so that is why I moved over to openhab, plus I received a raspberry pi for my birthday and I love having full control.

It was on my books to start bridging it next week (the wife will be travelling in Europe). Originally I was waiting for the Eclipse SmartHome stuff to materialize, based upon a discussion with Kai earlier this yr, but it should be easy enough to evolve anything developed when that’s more fleshed out.

We have communicated previously about openhab before I started the project but I think we could get a binding for Vera that would help bridge together without moving fully over to a new controller for z-wave. The only reason I moved completely over is because of my communication with Vera support or lack of support, something didn't sit well with me about that experience so that is why I moved over to openhab, plus I received a raspberry pi for my birthday and I love having full control.
Exactly, we've talked about that option before. In this case, it would be to pair the Z-Wave part of Vera, which is actually fairly solid, with OpenHAB... but the side-effect would be that ALL Vera devices would be exposed up through OpenHAB, making a transition/cutover easier for those wanting to go that route (without waiting for each plugin to be re-written).

It also gives me the option to keep the extended Antenna, since Dongle-based ZWave is … limited in range (read the Perceptive Automation threads for more recent examples), but folks here have a long history because of Vera 1.

It’s going to be one hell of a large Items file, so it’ll be interesting to see how OH handles that :wink:

More than happy to collaborate, but I wanted to get a [crude] prototype going first, just to feel out the waters. As I’d PM’d previously, I’ve already tried the HTTP-based integration, using OHab’s HTTP interface, to pull in Temp/Energy data and I wouldn’t recommend that as a long term direction (it’ll work fine as a WUI integrator though)

I totally agree that the HTTP interface is not a long term options but I had no options in my case but to upgrade to vera3 or utilize hardware that I already own and I opt’ed for the second. If you want to start collaborating on this you can reach me at support@instruodev.com. I monitor that email address and respond relatively quickly.

Similar issue, except I’d outgrown a Vera3 and was moving stuff “outward” to RaspPi (Energy Collection), SmartEnergyGroups (Energy Reporting/Graphing) and various other servers (like my Mac Mini) in order to keep Vera stable.

Who knows, maybe I’ll finally have a use for my 3yr old Ionics Stratus Plug computer :wink:

I’ll email you once I have something limping along. I first need to rebase to OH 1.5, since they’ve put a lot of stuff into that rev.

[quote=“guessed, post:9, topic:181558”]Similar issue, except I’d outgrown a Vera3 and was moving stuff “outward” to RaspPi (Energy Collection), SmartEnergyGroups (Energy Reporting/Graphing) and various other servers (like my Mac Mini) in order to keep Vera stable.

Who knows, maybe I’ll finally have a use for my 3yr old Ionics Stratus Plug computer :wink:

I’ll email you once I have something limping along. I first need to rebase to OH 1.5, since they’ve put a lot of stuff into that rev.[/quote]

Cool, I am currently running 1.5 SNAPSHOT.

Guessed,

Are you using a z-wave stick with your OpenHab setup?

  • Garrett

Looking into OpenHAB, it looks like an old friend of the forum (Chris creator of DataMine) has been working on HABmin which is an admin interface for OpenHAB.

  • Garrett

Yes. I ran my tests a few months ago using an old Aeon Labs Z-Stick from my Vera 1.

It was setup as a secondary, so I didn’t have to worry about inclusions etc.

Yup, and the ZWave stuff also, he’s been busy.

@evanes is also there, he created the original EnOcean gateway.

I suspect there are a few more ex Vera plugin developers waiting in the wings, since it’s really been ramping over the last yr (esp with the recent inclusion into the Eclipse family, and their roadshows)

I think I am going to give this a try. I have some reading to do. How well does the Aeon Labs Z-Stick work? I am going to test on a raspberry pi, but would like to be able to change hardware if needed which the usb stick will allow.

  • Garrett

[quote=“garrettwp, post:15, topic:181558”]I think I am going to give this a try. I have some reading to do. How well does the Aeon Labs Z-Stick work? I am going to test on a raspberry pi, but would like to be able to change hardware if needed which the usb stick will allow.

  • Garrett[/quote]

From my reading and investigation most on the RPI platform are utilizing the USB z-wave stick and only a smaller limited number of people are using the razberry child board. I probably too would have went with a USB stick but at the time of my purchase of the razberry child board I was looking at the zwave.me solution which is what I used to include the devices and then moved onto openHAB for the actual management.

I am falling into similar issues with my VeraLite (memory issues). I’m sure a vera3 would solve my issues, but I do happen to have an extra raspberry pi laying around.

@jpete7683, what are you doing about remote access? Are you just doing port forwarding, or is there a more secure route that you are using?

[quote=“SirMeili, post:17, topic:181558”]I am falling into similar issues with my VeraLite (memory issues). I’m sure a vera3 would solve my issues, but I do happen to have an extra raspberry pi laying around.

@jpete7683, what are you doing about remote access? Are you just doing port forwarding, or is there a more secure route that you are using?[/quote]

So some things to look forward to. The Openhab project is beta testing a cloud service (beta is closed to any new testers) so for my own purposes I am removing the VeraLite from talking to the MCV fwd’ing servers since it still controls my locks and thermostat, and I have a static IP address for my house and I am just port forwarding the https secure port that openhab offers. The mobile app for openhab is just a webkit that displays basically what you see in the openhab GUI, so I am working on adapting iViri in a manner to openhab so that we have native support for the REST API on iOS and also allow for geofences to be used to know when you are away or home and also ibeacons for proximity awareness of openhab. I started working on it today so it shouldn’t be too hard, just need to change the data model over and get the GUI built to show the data model. When the cloud service becomes GA I will probably move to that if they don’t charge, if they charge I will just keep using my secure ports on my static IP. You can also setup a user/pass and work that way with it and I am sure the oAuth probably is already available or will be available eventually with the use of the cloud service.

About as well as it did with Vera. My Network is fairly consistent though (Leviton), and I only did a limited #days of testing, so I wouldn’t rely upon that data.

As @jpete7683 said above, the tools aren’t there to make it plug-n-play for new device registration just yet, so it’s a little more fiddly to subscribe new devices, or tweak existing ones (etc).

That said, Z-Wave range is going to be a problem with this setup and the Dongle, just as it was with Vera1. That’s part of the logic for building a bridge to Vera - get access to a mature Z-Wave stack, along with access to the Antenna mods and Z-Wave registration/tweaking UI’s… at least in the short term.

[quote=“guessed, post:19, topic:181558”]About as well as it did with Vera. My Network is fairly consistent though (Leviton), and I only did a limited #days of testing, so I wouldn’t rely upon that data.

As @jpete7683 said above, the tools aren’t there to make it plug-n-play for new device registration just yet, so it’s a little more fiddly to subscribe new devices, or tweak existing ones (etc).

That said, Z-Wave range is going to be a problem with this setup and the Dongle, just as it was with Vera1. That’s part of the logic for building a bridge to Vera - get access to a mature Z-Wave stack, along with access to the Antenna mods and Z-Wave registration/tweaking UI’s… at least in the short term.[/quote]

You’ll have to excuse any kind of stupid statements I may make as I have very little knowledge of this. However, If you use the Vera as a bridge, are you still limited to the z-wave devices that vera supports or are you talking about having a way to basically just use the vera as a passthrough for the z-wave communications?

Once again, sorry if it’s a dumb question.