- Platform information: Raspberry Pi Nano
- Hardware: Raspberry Pi Nano
- OS: Rasbian image from openHABian
- Java Runtime Environment:Zulu Embedded OpenJDK Java 8
- openHAB version: 2
- Issue of the topic: Item item_name changed from true to false does not work
From the rules documentation I’m trying to use a rule like this:
//Item <item> changed [from <state>] [to <state>]
Item item_name changed from true to false
But that causes an error in the openhab.log
2018-04-11 09:29:43.496 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Presence_Joseph.rules' has errors, therefore ignoring it: [7,46]: no viable alternative at input 'true'
I just want to confirm that I can only do:
Item <item> changed from <state>
OR
Item <item> changed to <state>]
but not both. Even though I see the following in the events.log:
2018-04-11 05:05:05.930 [vent.ItemStateChangedEvent] - HUE_Presence_Joseph_iPhone changed from true to false
I ran into the same problem with the syntax “from OFF to ON”. I saw in another thread that using quotes:
Item <item> changed from "true" to "false"
is not supported.
I’m trying to create rules that work when an item changes from true to false but not when it change from true to NULL or from NULL to false. So if there is another way to do that, I’m love to know.
- Please post configurations (if applicable):
- Items configuration related to the issue
String HUE_Presence_Joseph_iPhone <present> (gSkur) { http="<[HTTP://10.0.0.126/api/<API Key>/sensors/13:3000:JS(getHuePresence.js)]" }
-
Sitemap configuration related to the issue n/a
-
Rules code related to the issue
rule "Hue Joseph Presence"
when
Item HUE_Presence_Joseph_iPhone changed from true to false
then
logInfo("HUE", "HUE_Presence_Joseph_iPhone: " + HUE_Presence_Joseph_iPhone.state)
end
-
Services configuration related to the issue
HTTP Binding -
If logs where generated please post these here using code fences: