I added multiple Users in a group “gUser”. They are all switch type ping devices via network binding. Android and IOS. Although online, the status changes from off to on and vice versa all the time. Thus my rule ‘to turn on a light when all users are offline and it´s dark’ turns the light on and back of again all the time. How can I fix this?
rule “Einbrecherlicht einschalten”
when
Item gUser changed from ON to OFF
then
if (Dunkel.state == ON) { GF_LivingRoom_Light.sendCommand(ON) }
end
rule “Einbrecherlicht ausschalten”
when
Item gUser changed from OFF to ON or
Time cron "0 30 23 1/1 * ? *" //oder um 23:30
If the setting do not help here is what I have for my home that works well.
My items, using the expire binding to allow 20 minutes before doing something (prevents turning something on/off if detection gets changed b/c I walk to the mailbox)
rule "start gPresent on system start"
when
System started
then
Present.sendCommand(OFF) // assume no one is home
end
rule "gPresent updated, at least one change of state"
when
Item gPresent received update
then
// someone came home
if(gPresent.state == ON && Present.state != ON) {
Present_Timer.postUpdate(OFF) // cancel the timer if necessary
Present.sendCommand(ON)
}
// no one is home and timer is not yet ticking (otherwise endless loop)
else if(gPresent.state == OFF && Present.state != OFF && Present_Timer.state != ON) {
Present_Timer.sendCommand(ON) // start the timer
}
end
rule "Present_Timer expired"
when
Item Present_Timer received command OFF
then
Present.sendCommand(OFF)
end
What OH version are you running?
Is it an upgrade? Invalid addons cause them all to reload every minute. Many people do not read the Release Notes or CLI displayed Warnings when upgrading.
@H102 Do you mean the network.config file and then add your lines? At the moment they don´t exist plus I found two files. One at userdata/config/binding and one at uesrdata/config/org/eclipse/smarthome. I guess the first one.Cannot find any .things file. The folder under conf/things is empty. I gues because I created the thing via the network binding. Shall I delete it and add it manually or where to add the suggested settings for the thing? I´ll try your settings on tuesday and give feedback to both of you here. Thanks again.
I recommend creating Things within openHAB if possible, even if you use files for Items and Rules like I do. Things are easy to mess up, causing strange issues.
There’s a typo in there (comma) but that is the parameter you should be interested in. Retaining a ping result for only two seconds is probably not what you want.
Sorry to bother you again. I cannot find either the file for the network settings nor the thing settings. Can you give me advise where to find them, location and name?
If I have to create them, can you tell me where to put them and the exact file names?
EDIT
That was a bit stupid. Still, I cannot find the files, but in paper UI settings you have most tof the options. Apart from “uses_ios” and “uses_arp_pings”. Is it possible to locate the setting files?
I´ll play around with the settings and then we´ll see.
Not really.
For v1 bindings and actions, you can only use files (*.cfg).
For v2 bindings, you can only use PaperUI (or any other UI to use the API) but *.cfg will be ignored.
(yes there’s .thing files but those obviously have a different syntax and are not really recommended to be used)
I would recommend avoiding v1 bindings and actions if at all possible. OH3, the next major version, will not directly support v1. The code has already been stripped from the source, I believe.