We have moved at community.getvera.com

Author Topic: Stories of openHAB conversion, co-existence & augmentation  (Read 8742 times)

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Stories of openHAB conversion, co-existence & augmentation
« on: March 14, 2015, 06:07:03 am »
How are the rest of your openHAB efforts going?

I have done almost no effort since the begginning of 2015 !
Efforts of the last week:
- I uninstalled my Freebox Vera plugin and  even unplugged the Freebox binding in OpenHAB because I don't really need it. I replaced one required feature of my Vera plugin (reachable statte of network devices) by the network health binding.
- I uninstalled my DLNA Vera plugin because I don't really need it now.
- I enhanced one TTS messages (weather message)
- I start playing with the openHAB voice control.
- I moved to your last binding version and switched my rule code to use your new send MiOS action.

My next steps will still be more setup and rules enhancement than binding development/enhancement:
- install a Qubino Z-Wave device to control one electric radiator
- install 2 smoke sensors in my house and control them with my RFXtrx
- move from my RFXtrx Vera plugin to the RFXCom openHAB binding
- add more TTS messages in my home automation system
- enhance my openHAB voice control rule
- think about how I could use my hue lights to provide information

I still have wishes to make development efforts but that is not yet my priority. I could start by adding few features to the Freebox binding. It should be easy and so a good entry point to binding develoment. The next big step could be to try creating a new binding for my Powermax Pro alarm system but I am not yet sure to be able to do it !
« Last Edit: March 15, 2015, 05:26:56 am by lolodomo »

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #1 on: March 14, 2015, 02:21:48 pm »
@lolodomo,
Well, you've made more progress than me!

I did, however, completely cutover to using @watou's openHAB Nest Binding this morning, and turned off/de-installed his MiOS Nest Binding.  There were definitely a few Rule authoring tricks to navigate in that process.

Next on the list for today is to cutover my top-5 frequently triggered Scenes, and augment the openHAB Example Wiki pages with the specifics of those scenes (to help others along the trail)

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #2 on: March 14, 2015, 04:07:49 pm »
I cut over most of my automation to openhab. The only thing Vera runs is my zwave network and the DSC plugin. I translated my ISY plugin over to node.js communicates over mqtt and integrates well with openhab.

- Garrett


Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #3 on: March 14, 2015, 05:51:47 pm »
I cut over most of my automation to openhab. The only thing Vera runs is my zwave network and the DSC plugin. I translated my ISY plugin over to node.js communicates over mqtt and integrates well with openhab.

Hey Garrett,
Very interested in hearing the stories of your translation as well.  Most Rules are easy to convert, but I've found that some need a l more attention to convert due to subtlety in the Rule syntax or, due to some of the quirks of the system (eg. "Unititialized" states etc)

Right now I'm imagining a "MiOS Examples" Wiki page similar in style to the one that @watou created, but with specific sections for the following (with fully worked examples):

a) Augmentation
openHAB Rules that "add" to existing MiOS Scenes.  This could be stuff like TTS, Charting, Historic data access (etc) where you take advantage of functionality on openHAB, but largely leave Vera alone.

b) Co-existence
Replacing MiOS Scenes with openHAB Rules, but keeping the Devices.  This would likely be the biggest category, given the strength of Vera's Z-Wave engine (for now)

c) Replacement
These are already coming through, with examples like SEG Data Publication, and @watou's openHAB Nest Binding (I ended up just converting stuff over wholesale)



Overall goal is to simplify the setup for people wanting/researching transition options, so they don't try to boil the ocean up front.

Anyhow, definitely interested in getting your input and write-ups into this.  Some stuff is easier than others, but it sounds like you've also eliminated things like the Web PowerSwitch which I really want to hear about ;-)

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #4 on: March 15, 2015, 05:55:31 am »
In my case, I was able to delete all my Vera scenes and replace them by openHAB rules.
What is still in Vera:
- of course my Z-Wave devices => no plan to change that
- RFXtrx  control => should try the RFXCOM binding
- Sonos control => should try the Sonos binding but I must keep the Sonos plugin at least for TTS.
- Alarm control => should keep the Vera plugin as no openHAB binding exists today for that alarm.

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #5 on: March 15, 2015, 11:31:56 am »
One difficulty with OH rules is that we have no real idea what we can do and what we can't. I have not found a list of available classes for example. We have only code examples.

In Vera it is easier, we know that we have to respect lua syntax and we have the lua library + the specific luup calls.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #6 on: March 15, 2015, 12:34:57 pm »
One difficulty with OH rules is that we have no real idea what we can do and what we can't. I have not found a list of available classes for example. We have only code examples.

In Vera it is easier, we know that we have to respect lua syntax and we have the lua library + the specific luup calls.

and that's a lot of why I want to get examples up there.  It's a lot of trial-and-error unless you have something to copy (similar to using the Luup extensions)

The biggest challenge (to me) is that the are references to it being XTend like, but really it's just XText based (and so is XTend).  There are functional differences, so some constructs don't work if you follow the XTend examples found on the net....   

ie. Similar, yet different

I was wrangling with filters yesterday, for example, and it took a bunch of experimentation.

Anyhow, a  bunch of real-world examples should suffice for most, avoiding the need to document the can's-n-cant's of the actual language (since they'll presumably be mostly represented by the real-world use-cases)

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #7 on: March 15, 2015, 02:44:35 pm »
A few of my starter/simpler rules are now listed in:
    https://github.com/openhab/openhab/wiki/MiOS-Binding-Example

I'll add more when I get cycles, but feel free to augment the list as needed.

Offline Aaron

  • Hero Member
  • *****
  • Posts: 1985
  • Karma: +61/-193
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #8 on: March 15, 2015, 03:27:53 pm »
I was under the impression that Richard was porting PLEG?
Garrett... Are you making Authomation compatible with OH?

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #9 on: March 15, 2015, 03:47:58 pm »
I was under the impression that Richard was porting PLEG?

I'm sure Richard will update folks on his existing Forum thread when that changes.  The last post seems to be from a few months back.

In the meantime, for those adventuresome folks, there's a lot of stuff that can be readily converted over (co-existed, etc) and it's not hard once they there are examples to follow.  Just like Vera 4-6+ yrs back, it took longer to get the first ones "done" so others had an easier time to follow along 8)

Offline dgrufman

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #10 on: March 15, 2015, 06:08:29 pm »
All,

Just wanted to add a thank you, to all who have been contributing to the project here (guessed, lolodomo, gdupray, garrettwp...). I would never have tried to make the jump from Vera to OpenHAB. Vera felt severely limited and slow, but with a PI2 and OpenHAB and the great conversion tool (thanks again guessed) home automation is fun again and feels more like something that has a future.

I will try to contribute something going forward, but expect to go back to lurking for a bit  ;)

I wholeheartedly support an examples page and thanks again.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #11 on: March 16, 2015, 03:27:37 am »
A few of my starter/simpler rules are now listed in:
    https://github.com/openhab/openhab/wiki/MiOS-Binding-Example

I'll add more when I get cycles, but feel free to augment the list as needed.

Ok, I added a bunch more as I'm hand-transcribing my declarative & Lua-based MiOS Rules, including:
  • Turning Lights ON with Motion events, and automatically OFF after a period
  • As per above, but with parts of the Rule executing only at Night Time
  • The SmartEnergyGroups/SEG replacement Rule for the MiOS Lua code that did the same
  • Disabling/Enabling Nest when Windows are opened/closed (resp)
  • Augmenting MiOS Alarm events with openHAB TTS Functionality.

These types of Scenes are fairly common on MiOS systems, so people should be able to pickup a few parts for their own use.

I'm specifically interested in hearing feedback (and optimizations) as to how these compare from folks who've already written/converted their MiOS Scenes completely to openHAB Rules.

The one issue I'm aware of is that many of the rules won't survive a reboot and/or restart.  Luckily, my Odroid hasn't rebooted in weeks, and it only restarts when I make a hard reconfiguration of openHAB.  I also have fallback Scenes & Rules that shut stuff down daily "just in case".

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #12 on: March 16, 2015, 10:10:10 am »
Quote
The one issue I'm aware of is that many of the rules won't survive a reboot and/or restart.

This, user timers, and sequence expressions are my primary focus on PLEG in OpenHAB.

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #13 on: March 20, 2015, 05:58:41 pm »
A few of my starter/simpler rules are now listed in:
    https://github.com/openhab/openhab/wiki/MiOS-Binding-Example

Quote
Turning Lights ON with Motion events, and automatically OFF after a period

Here is my own rule that works well with the Fibaro (eye) motion sensor and Vera UI5 (1.5.672). The delay is setup as a parameter of the Fibaro Z-Wave device. As a bonus, the light is switched ON only if the Fibaro detects a minimum light level.

Code: [Select]
rule "D?tection mouvement chambre"
when
Item DetecteurChambre changed
then
if (previousState.toString == "CLOSED" && DetecteurChambre.state.toString == "OPEN") {
var Number luminosite = LuminositeChambre.state as DecimalType
if (luminosite < 30) {
LampeChambre.sendCommand(ON)
}
}
else if (previousState.toString == "OPEN" && DetecteurChambre.state.toString == "CLOSED") {
LampeChambre.sendCommand(OFF)
}
end

I first used your solution but it was not working as well.


PS: I discovered with your example the possibility to call  kTimer.reschedule. In my case, I was first killing the timer and then crating again. Your solution looks better.
« Last Edit: March 20, 2015, 06:07:54 pm by lolodomo »

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Stories of openHAB conversion, co-existence & augmentation
« Reply #14 on: March 22, 2015, 09:56:03 pm »
Just updated the examples that were using using Timer.reschedule(...).

If you're using this in your rules, then you'll want to use the Lock objects from:
    https://github.com/openhab/openhab/wiki/Taking-Rules-to-New-Heights

These Locks have been integrated into my MiOS Examples, for the simpler cases. 

Without them, you can get 2x (or more) timers created, and the last-one-wins.  The first one carries on, and eventually does whatever it was going to do... In my case, it turns off the TV somewhat unexpectedly, since I have a rule that keeps the TV on if it continues to see motion in a room