Hello All,
i’m new to OH, i’m only been able to install it and setup philips hue lamps via config files and i just discovered the firsts difficults… What i’m trying to do is to grey out the Luce_Camera_Switch when it’s unavailable (turned off by wall switch)
these are my config files
equal to ==, unequal to !=
less than or equal to <=, greater than or equal to>=
less than <, greater than >
Expressions are evaluated from left to right. The Item will be visible if any one of the comparisons is evaluated as true, otherwise it will be hidden.
In the third example above, a control for a lawn sprinkler will be visible if it is Morning, OR if it is Afternoon, OR if the temperature is above 19 °C. Combining multiple conditions, for example Morning AND above 19 °C is not supported. To control visibility based upon combining multiple Items, or on more complex conditions, consider defining and using an additional intermediate Item that is set by a Rule. Rules have a rich set of features that can support more involved scenarios.
would be great to show a text when the item is unreachable and the switch when the switch is reachable (turned on or turned off), but i’m not so practice and i don’t know how to do it…
You hide the switch using “visibility” and show the text item using “visibility” with inverted logic
Edit: (Example)
Text label="Luce Camera" visibility=[Luce_Camera_Switch==OFF]
Switch item=Luce_Camera_Switch label="Luce Camera" visibility=[Luce_Camera_Switch==ON]
But one thing: Are you only commanding this item via the UI or is there any rule in the background? If not you can disable it exactly one time
Edit 2: (i’m to shortsighted today
One drawback of this is that the text and the switch are at different positions in the ui. But i’m not that experienced with it - maybe somebody else can jump in from here
Text label="Luce Camera (Disattivata)" visibility=[Luce_Camera_Switch==NULL]
Switch item=Luce_Camera_Switch label="Luce Camera" visibility=[Luce_Camera_Switch!=NULL]
Slider item=Luce_Camera_Brightness visibility=[Luce_Camera_Switch==ON]
if the lamps is turned off via wall switch (I suppose Luce_Camera_Switch==NULL) it should show only the label, but it’s showing the switch and the slider… I’m a little confused…
2019-02-04 21:56:53.605 [hingStatusInfoChangedEvent] - 'hue:0100:00178829d4e7:3' changed from ONLINE to OFFLINE: Hue bridge reports light as not reachable.
This message comes from the thing itself and if it has no channel that can be connected to this state you need to have a rule that triggers when the thing itself changes. Look for the thing-based triggers:Rules | openHAB
a rough example in your rule would be
rule "Hue light offline"
when Thing "'hue:0100:00178829d4e7:3" changed
then
var status = getThingStatusInfo("'hue:0100:00178829d4e7:3")
if(status.toString.contains("ONLINE"))
{
Luce_Camera_Switch.sendCommand(ON)
}
else
{
Luce_Camera_Switch.sendCommand(OFF)
}
end
I tryed to create a rule like the one you posted, the problem is that I need a 3rd value… ON when it’s turned on, OFF when turned off and NULL or UNDEF or something else when it’s unreachable, but the sendcommand accept only ON or OFF