Hello hello!
I’m using OpenHAB 2.4.0 and have trouble to make visibility
work with multiple items of the same name in the Basic UI.
My goal is to display a custom icon on a Setpoint item, based on the state of a Switch.
Below is my config:
File default.items
:
Number:Temperature Temperature_Should_Office_Helper "Büro Soll [%.1f °C]"
Switch Heating_Office "Heizung" <innogysmarthome> { channel="innogysmarthome:PSS:...:switch" }
File default.sitemap
:
sitemap default label="Home"
{
Switch item=Heating_Office
Setpoint item=Temperature_Should_Office_Helper minValue=18 maxValue=24 step=0.5 icon="heizung_an" visibility=[Heating_Office==ON]
Setpoint item=Temperature_Should_Office_Helper minValue=18 maxValue=24 step=0.5 icon="heizung_aus" visibility=[Heating_Office==OFF]
}
So, I have two Setpoint’s with the same name Temperature_Should_Office_Helper
. One should be shown if the Switch is on, the other should be shown if the Switch is off.
With those conditions in place, I can only click exactly once on the up/down buttons of the Setpoint. When I click a 2nd time, nothing will happen and I see this error in the logs:
==> userdata/logs/openhab.log <==
2019-02-18 12:01:05.850 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/Temperature_Should_Office_Helper' with an invalid status value 'NaN °C'.
The value NaN °C
is also what I see is being sent from the client to /rest/items/Temperature_Should_Office_Helper
, which responds with http 400.
If I remove the conditions, it starts working, with both elements in place:
sitemap default label="Home"
{
Switch item=Heating_Office
Setpoint item=Temperature_Should_Office_Helper minValue=18 maxValue=24 step=0.5 icon="heizung_an"
Setpoint item=Temperature_Should_Office_Helper minValue=18 maxValue=24 step=0.5 icon="heizung_aus"
}
Of course, now I have two Sitepoints…
Does anyone know a solution to this? Or another way to archive the goal of changing the icon?
Thanks,
Daniel