I upgraded to OH2 a couple of weeks ago at the same time connected Alexa. Since then, it turns out, a couple of rules won’t run. I’ve discovered that the following rule will only run if I remove [“Switchable”] from the item. This is is true if use “received update ON” also and turns out to be true of all of my items using [“Switchable”]. Am I doing something wrong or is this a bug?
rule "Set Fireplace Timer"
when
Item Fireplace_Switch changed from OFF to ON
then
fireplaceOff = now.plusMinutes(1)
postUpdate(fireplace_Off_DT,fireplaceOff.toString)
logInfo("Rules", "Set Fireplace timer:" + fireplaceOff)
end
Does the ZWave binding support tagged items?
Quote from the docs:“Tags are only of interest if an add-on or integration README explicitly discusses their usage.”
I don’t see anything obviously wrong with what you’re doing. FWIW, I have NG (Experimental) Rule Engine rules that do fire from items with the “Switchable” tag (specifically for Alexa).
I am running OH2 Snapshot, lots of z-wave devices, tagged for Alexa.
You are correct that having the [“Switchable”] tag after channel string breaks the items.
In your first example (with the fireplace), you have no space between the end of the item name and the quote before the text name. Maybe transcription error on your part BUT I’d suggest inject a space before the opening quote.
Theory: item parsing boundary difference/inconsistency between OH components. Item line parser has to parse item type, item name, optional “human-readable name”, optional type, optional (groups) list, optional [“Tag”], and optional {channel info}. Line parser has to do something like: take everything up to but not including the first blank and validate that against valid item types, then take everything after the first blank until either (a) the next blank – which would be AFTER the quotation mark in your first example or (b) the next delimiter of list of delimiters (which would hopefully include quotation mark). Correct answer should be (b), BUT…
It seems I made two changes at once and blamed the wrong one. It does not like the way that I’ve tried to use the constant iFIREPLACE_DURATION. I suspect the rule is actually running, but crashing or not executing on the first line after “then”.
import org.eclipse.smarthome.model.script.actions.Timer
import org.joda.time.DateTime
val int iFIREPLACE_DURATION = 90
var DateTime fireplaceOff = now.plusMinutes(iFIREPLACE_DURATION)
rule "Set Fireplace Timer"
when
Item Fireplace_Switch changed from OFF to ON
then
fireplaceOff = now.plusMinutes(iFIREPLACE_DURATION)
postUpdate(fireplace_Off_DT,fireplaceOff.toString)
logInfo("Rules", "Set Fireplace timer:" + fireplaceOff)
end