[Solved] Problem Cannot retrieve visibility item in sitemap

I tried to create a warn message of my sensors if a battery is getting low

here are my item

String string_house_sensorbattery "Batteristatus Sensoren" <battery> (group_house)
Group:Switch:AND(ON, OFF) group_house_sensorbatterylow (group_house)
Group:Number:MIN group_house_sensorbatterypercentage (group_house)

my sitemap

Text item=string_house_sensorbattery
        Text item=Z_way_number_DoorWindowSensor14_battery
        Text item=Z_way_number_DoorWindowSensor15_battery
        Text item=Z_way_number_DoorWindowSensor16_battery
        Text item=Z_way_number_DoorWindowSensor17_battery
        Text item=Z_way_number_DoorWindowSensor18_battery
        Text item=Z_way_number_DoorWindowSensor19_battery
      Text item=string_house_sensorbattery label="Mindestns eine Batterie ist leer" visibility=[Battery == low] labelcolor=[Battery==low="red"]

my rule

rule "change battery icon string_house_sensorbattery"
    Item group_house_sensorbatterylow received update or
    Item group_house_sensorbatterypercentage received update 
    if (group_house_sensorbatterylow.state == OFF || (group_house_sensorbatterypercentage.state as DecimalType) <= 10.00)

and i get this error:

Cannot retrieve visibility item Battery for widget org.eclipse.smarthome.model.sitemap.Text

what is wrong???

Quite simply, you do not have an item called “Battery”, I’m guessing you mean to put string_house_sensorbattery there.
Next to that, as you have a string item, the syntax should be


And same applies to labelcolor of course

1 Like

Thank you…

is this line

if (group_house_sensorbatterylow.state == OFF || (group_house_sensorbatterypercentage.state as DecimalType) <= 10.00)


It doesn’t seem wrong at first. (although dealing with Numbers/DecimalType and so on can be tricky)
Does it give you an error in the logs?

No, in visual Code it is marked Red…doesn’t Matter IT does what IT should do

You might want to remove as DecimalType then.