[SOLVED] Make a item show Online instead of a switch

Hi All.
i have a question . I use network binding. on 2.5m4
on the site map i have switches that show the status of my system. but now i am trying to have them rater say Online or Offline.(did search but could not realy see anything.

here are some of my files.
Items :

Switch  Allen                       "Allen"                             (System)    {channel="network:pingdevice:Allen:online"}
String  Allen_Online                "Allen Online"
Switch  Aletchia                    "Aletchia"                          (System)    {channel="network:pingdevice:Aletchia:online"}
Switch  Kodi                        "Kodi"                              (System)    {channel="network:pingdevice:Kodi:online"}

Site map :

Frame label="Online - Live" {
         Default   item=Allen                        label="Allen Iphone"                icon="apple"
         Default   item=Allen_Online                 label="Allen Iphone"                icon="apple"
         Default   item=Aletchia                     label="Aletchia Iphone"             icon="apple"

Rule : (first try)

rule "Allen Online"
	Item Allen changed from OFF to ON
	// do something

Am i in the right direction or way off ?

Look at Mappings here.

Switch item=<itemname> [label="<labelname>"] [icon="<iconname>"] [mappings="<mapping definition>"]

Since you want to post a string you should use


You might also want to change the item definition to

String  Allen_Online                "Allen [%s]"

so that the name stays, but the status string can change from “Online” to “Offline”.

1 Like

Simply don’t use Default but Text plus mapping in your label:


Switch  Allen    "Allen [MAP(online.map):%s]"    <apple> (System) {channel="network:pingdevice:Allen:online"}
Switch  Aletchia "Aletchia [MAP(online.map):%s]" <apple> (System) {channel="network:pingdevice:Aletchia:online"}
Switch  Kodi     "Kodi [MAP(online.map):%s]"     <tv>    (System) {channel="network:pingdevice:Kodi:online"}


Frame label="Online - Live" {
         Text item=Allen
         Text item=Aletchia
         Text item=Kodi



No rule at all.
Please do NOT set a label in the sitemap at all (or use the same as in items, as this is the key feature)