|
Post by demondreamer on Jan 25, 2015 8:27:56 GMT
OpenHAB for me has been a finicky unpleasant piece of software to work with. I have a hard time getting good feedback from the program as to whats wrong and there seems to be precious few examples on the Internet of things that actually work. I can't be the only one tearing my hair out trying to get it to reliably do even the simplest things.
Lets make this thread into a troubleshooting discussion on the quirks of OpenHAB.
|
|
|
Post by demondreamer on Jan 25, 2015 8:56:22 GMT
Here's my latest: I have a shop with big sliding doors. I want to know when they are opened or closed. I tried to use magnetic switches and a nice simple on/off signal but for various reasons that didn't work. I switched to ultrasonic sensors and now I have a range value instead of open/closed. That's fine because I can just do a >12 inches = open and <= 11 inches = closed in the rules in OpenHAB, right? Nope. OpenHAB will not process any values <10. Why? I have no idea. opnehab.log file shows the event bus is receiving the values, from 0 to 60 inches. But no matter what I tried it would not pick it up in the .rules file. My workaround was to add +10 inches to the sensor reading in the Node Arduino's sketch, so the lowest reading OpenHAB will ever see is 10. shop.items Number shop_frontdoors_ping_mqtt "Front doors gap distance [%.1f]" {mqtt="<[mymosquitto:home/rfm_gw/nb/node17/dev40:state:default]"} Number shop_frontdoors_inches Contact shop_frontdoors_status "Front Doors" shop.rules - working /* ------------- Doors -------------------- For an unknown reason OpenHAB won't process a value received from the ultrasonic sensors less than 10.00. This means I can't have the door reported as closed when the sensor is sending 1.00-9.00. To work around this I added 10 inches in the Arduino sketch when it computes the distance. */
rule "Front Doors Opened" when Item shop_frontdoors_ping_mqtt received update then if(shop_frontdoors_ping_mqtt.state >= 20) { sendCommand(shop_frontdoors_status, OPEN) } else if(shop_frontdoors_ping_mqtt.state < 20) { sendCommand(shop_frontdoors_status, CLOSED) } end
shop.rules - not working /* ------------- Doors --------------------*/
rule "Front Doors Opened" when Item shop_frontdoors_ping_mqtt received update then if(shop_frontdoors_ping_mqtt.state >= 10) { sendCommand(shop_frontdoors_status, OPEN) } else if(shop_frontdoors_ping_mqtt.state < 10) { sendCommand(shop_frontdoors_status, CLOSED) } end
shop.sitemap sitemap shop label="Shop" { Frame label="Doors" { Text item=shop_frontdoors_status Text item=shop_frontdoors_ping_mqtt } } events.log 2015-01-25 00:44:40 - shop_frontdoors_ping_mqtt state updated to 26.00 2015-01-25 00:44:40 - shop_frontdoors_status received command OPEN 2015-01-25 00:44:34 - shop_frontdoors_ping_mqtt state updated to 26.00 2015-01-25 00:44:34 - shop_frontdoors_status received command OPEN 2015-01-25 00:44:37 - shop_frontdoors_ping_mqtt state updated to 26.00 2015-01-25 00:44:37 - shop_frontdoors_status received command OPEN 2015-01-25 00:53:54 - shop_frontdoors_ping_mqtt state updated to 2.00 -- 2015-01-25 00:53:56 - shop_frontdoors_ping_mqtt state updated to 4.00 |---where's the "received command CLOSED"? 2015-01-25 00:53:57 - shop_frontdoors_ping_mqtt state updated to 6.00 --
-Demondreamer
|
|
|
Post by Admin on Jan 27, 2015 1:20:11 GMT
OpenHAB for me has been a finicky unpleasant piece of software to work with. I have a hard time getting good feedback from the program as to whats wrong ... I wonder if the "received command CLOSED" ever happens? Is it an issue of it not happening on a timely manner, or not happening at all? This would be a good question to post on the OpenHAB google group, actually. groups.google.com/d/forum/openhabNot sure I ever pointed this forum out. It's the main place place for English speakers on OpenHAB issues.
|
|
|
Post by demondreamer on Feb 16, 2015 21:17:41 GMT
Does anyone know what imports I'm supposed to be using in my rules files? It's only occasionally mentioned in looking at examples. I don't know if I'm supposed to just know what to import, or there is some standard that you put at the beginning and leave it for when you need it or what. Is there any disadvantage to adding every import I come across in the event something may need it?
Demondreamer
|
|
|
Post by demondreamer on Feb 17, 2015 18:19:46 GMT
I'm trying to get timestamps to work now in OpenHAB. There's a site that concisely sums it up here: www.element14.com/community/community/design-challenges/forget-me-not/blog/2014/08/31/time-stamping-security-events-on-openhabIt's a method Eric uses in his OpenHAB examples as well so I'm assuming it's working for others. Here's my problem. It updates the timestamps based on my trigger just fine, but then it updates EVERY timestamp every time the NTP refresh interval occurs. The refresh interval is set in the openhab.cfg here: ################################ NTP Binding ########################################## # # refresh interval in milliseconds (optional, defaults to 900000 [15 minutes]) ntp:refresh=900000 # the hostname of the timeserver ntp:hostname=us.pool.ntp.org If I change the refresh interval to 100000, then it updates every 1.6 minutes, that's how I tested to make sure this is what's triggering. BTW, don't set the refresh to 0. It doesn't disable it, it makes it constantly spam refreshes. I'm currently testing 86400000ms (24 hours) I can't find any information on the entirety of the Google that answers this. Any ideas? -Demondreamer
|
|
|
Post by camblonie on Feb 18, 2015 12:39:50 GMT
I've got this same thing on my issue list when I get back to it this weekend. I think the problem is the rule triggering on any status update rather that an actual state change.
The imports is a mystery. I used Habmin way back and it seemed to populate with some imports on its own. It may be smart enough to pull what you need based on the type of rules you are making. Habmin is a decent interface, I'll probably play with it again soon.
|
|
|
Post by demondreamer on Feb 18, 2015 18:55:21 GMT
As far as I can tell by looking at the events.log, the rule isn't triggering. It looks like any DateTime item is being automatically updated when the NTP refresh is done. Setting the NTP refresh to 86400000 ms (24 hours) stopped the timestamps from being updated except when the actual rule is triggered, for 24 hours. Seemed to work yesterday. I've changed the NTP refresh now to 2592000000 ms (30 days). We'll see if there is any unintended consequences from that.
-Demondreamer
|
|
|
Post by user1234 on Aug 23, 2015 19:35:46 GMT
for some reason my BLE wont pair any suggestions?
|
|