SOLVED, I need help to get things status in Basic UI

i need help to get things status so when the things go to OFFLINE / ONLINE then the lebel of the item in Basic UI (sitemap) will change the color (not the valuecolor that is set in my sitemap and working)
how do i do that?
thanks.

You can’t. sitemap only takes notice of Items.

So you’d need a rule that watches for Thing status changes

and updates some Item that you can then use to control labelcolor= of your sitemap widgets.

3 Likes

thanks this is my rule that help me after i change it to my thing

rule "shelly:shelly1:f4cfa2749b0e"
when
  Thing "shelly:shelly1:f4cfa2749b0e" changed 
then

      var thingStatusInfo = getThingStatusInfo("shelly:shelly1:f4cfa2749b0e")

if ((thingStatusInfo !== null) && (thingStatusInfo.getStatus().toString() == "ONLINE")) {
    logInfo("ThingStatus", "shelly_shelly1_f4cfa2749b0e_relay_output is online.")
  shelly_shelly1_f4cfa2749b0e_relay_output.postUpdate(ON)
} else {
    logError("ThingStatus", "shelly_shelly1_f4cfa2749b0e_relay_output is offline or doesn't exist.")
  shelly_shelly1_f4cfa2749b0e_relay_output.postUpdate(NULL)

}
end
1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.