I’m on my phone so can’t do a lengthy reply. All I will add is the developer’s an maintainers ate aware of the problems with rules and nonprogrammer users. Frankly a lot of programmers hate it as well given they are written in a customized version of an obscure language.
The entire reason there is an OH 2.0 instead of a 1.9 is to address some internal architectural changes necessary to get to a state where monkeying Aarons in a bunch of text files is no line needed.
We are not there yet. We are a long way from there. But that is the goal. All the work that went into PaperUI, Habpanel, the introduction of Things and Channels, and the Experimental rules engine are all steps towards that direction. Hell, even Habmin has a way to build rules using a Scratch like environment.
Finally, some users are very happily using Node Red with openHAB.
To elaborate, you need a zwave controller which is a USB device that you plug into your OH server. With that then OH acts as the hub. The docs for the zwave binding list some dongles known to work. The Gen5 Aeon Controller seems to be the most popular around here.
You might also want to look into the z-way binding which is an alternative way to work with zwave in OH. It requires purchasing a controller with a specific license though. Again, see the docs.
Finally, some people, either because the existing bindings do not yet support a needed command class (e.g. SECURITY to include door locks) or because they are transitioning off of a commercial system like Vera, leave their zwave devices connected to one of these external hubs and interact with then using the hub’s API.
If you define parameters in a .cfg file, but later change the key or comment out the key (to the left of the = sign), the old key and value remains in the configuration stored in the server. This can wreak havoc and lead to many otherwise inexplicable problems. Users expect, quite reasonably, that the old key no longer mentioned in the .cfg file disappears from the configuration, but it doesn’t. This is particularly irksome when you use a 1.x binding like MQTT or the Weather binding that allows dynamically named keys, like myhouse.url=…
Thanks a lot, you just saved my night!!
Being a seasoned programmer myself (mainly C/C++ on embedded devices) my main problem with obenHAB is the complexity of the architecture. I once tried to implement a bindig myself, but having no Java/OSGI/Eclipse experience and the notorious lack of time just in resulted in not being able to get started in reasonable time.
Main issue with openHAB is the lack of “forgiveness” of the rule language regarding undefined elements and type casting. I have quite a few rules where are more testings if a value is undefined and typecasts than actual code.
But having said that, openHAB is a great project I like a lot. Coming from MisterHouse and having tried some other home automation projects, it is by far the best I now!
Thanks for your explanations! I already used persistence and this really helped a lot, but I had to implement a delay in some rules to allow for restoring the items. The ? operator is nice, I did not know it! And I will surly test automatic casting in openHAB2!!
Regarding the cache: What would I use if I cleared the cache on every startup ( I am only using textual configuration)?
I don’t understand the question. You can use a script to clear it out on every restart but be aware that all the bindings will reinstall so startup might take a lot longer. You need to define your addons in addons.cfg as well.
Thanks, that answers my question. I just was not sure, what side effects deleting the cache might have. I do not mind, when starting takes longer. My openHAB 1 Installation is nearly never restarted, so that does not matter.
The designer is unfortunately no help for OH2. Not even the ESH and OH methods (logDebug, postUpdate, …) are available and one can’t integrate any actions (sendTelegram, …). For example my security.rules has 55 lines of source code without blank lines. 33 of these are marked as defective.
Version 0.9 which was there for awhile has an issue that pretty much breaks its ability to recognize pretty much everything.
openHAB Designer only works with 1.8.
It is true that and separately installed actions are not recognized yet even with the 0.8 version. But that should only amount to a handful of lines marked as errors and in these cases it will be obvious that it is not a real problem.
Because OH’s errors are not all that helpful in identifying syntax errors having the ability to have something syntax check Rules (and sitemaps and items) for you will save tons of time.
The issue to fix what broke 0.9 is actively being worked and long term there is work to create a web based replacement for Designer.
I may have misremembered. You are running 1.8? In that case I told you wrong and you need openHAB Designer. But I’m pretty sure that isn’t being maintained any longer. I’m not even sure where to download it any longer. I’m sure it’s on bintray or cloudbees. I’m on my phone so can’t really search at the moment.
Could someone take a look at this rule to turn on/off a light based on a motion sensor? BA_HUE_Motion is of course the hue motion sensor and bathroom_light is the hue light. The rule is working all EXCEPT keeping the light as long as motion is detected. I’ve searched around the site and found several ways to do this and tried them but couldn’t get them to work. This is what I’ve pieced together myself. If you have some other .rule code that works I’m game to switch to that. Note that I am checking if the time is between 6am and 11pm if it is then the bathroom_light is 100% if not then it’s 15%.
rule "BALightOn"
when
Item BA_HUE_Motion changed
then
logInfo('BA_HUE_Motion', 'Motion detected in Bathroom')
logInfo('bathroom_light', 'Turning Bathroom Light ON')
var DateTime t11p = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 23, 00, 0)
var DateTime t6a = new DateTime(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), 6, 00, 0)
if(BA_HUE_Motion.state==ON) {
if(now.isBefore(t11p) && (now.isAfter(t6a)) ) {
bathroom_light.sendCommand(100)
if(timer!=null){
timer.cancel
timer = null
}
} else {
bathroom_light.sendCommand(15)
if(timer!=null){
timer.cancel
timer = null
}
}
} else {
if(BA_HUE_Motion.state==OFF){
timer = createTimer(now.plusMinutes(3)) [|
bathroom_light.sendCommand(0)
logInfo('BA_HUE_Motion', 'No Motion in Bathroom for 3 minutes')
logInfo('bathroom_light', 'Turning Bathroom Light OFF')
]
}
}
end