Hi I solved this problem with your help. Thanks! For anybody how search for something similar here my solution:
I use the Networkbinding and do a ping from this binding.
The network.things:
network:pingdevice:1_device "PlugS-01" [ hostname="192.168.xxx.yyy", retry=1, timeout=5000, refreshInterval=60000 ]
network:pingdevice:2_device "PlugS-02" [ hostname="192.168.xxx.yyy", retry=1, timeout=5000, refreshInterval=60000 ]
network:pingdevice:3_device "PlugS-03" [ hostname="192.168.xxx.yyy", retry=1, timeout=5000, refreshInterval=60000 ]
network:pingdevice:4_device "PlugS-04" [ hostname="192.168.xxx.yyy", retry=1, timeout=5000, refreshInterval=60000 ]
network:pingdevice:5_device "PlugS-05" [ hostname="192.168.xxx.yyy", retry=1, timeout=5000, refreshInterval=60000 ]
network:pingdevice:6_device "PlugS-06" [ hostname="192.168.xxx.yyy", retry=1, timeout=5000, refreshInterval=60000 ]
Here The network.items
Group:Switch:OR(OFF, ON) DeviceHealth "Gerätestatus [(%d)]" <status> (All)
Switch 1_device "online" (DeviceHealth) { channel = " network:pingdevice:1_device:online " }
Switch 2_device "online" (DeviceHealth) { channel = " network:pingdevice:2_device:online " }
Switch 3_device "online" (DeviceHealth) { channel = " network:pingdevice:3_device:online " }
Switch 4_device "online" (DeviceHealth) { channel = " network:pingdevice:4_device:online " }
Switch 5_device "online" (DeviceHealth) { channel = " network:pingdevice:5_device:online " }
Switch 6_device "online" (DeviceHealth) { channel = " network:pingdevice:6_device:online " }
The net_status.rules
aktually there is only a Info in the Logfile written. later more…
rule "ONLINE/OFFLINE Alert"
when
Member of DeviceHealth changed
then
if (triggeringItem.state == OFF) {
var message = triggeringItem.name + " ist OFFLINE"
logInfo("RULE", "--> Geräte status: "+ message)
}
if (triggeringItem.state == ON) {
var message = triggeringItem.name + " ist ONLINE"
logInfo("RULE", "--> Geräte status: "+ message)
}
end
An the
Sitemap
the code is shortened
sitemap plug_s label="Plugs " {
Text item=1_device label="Plug 01 [MAP(health.map):%s]" valuecolor=[OFF="red"] visibility=[ 1_device==OFF]
Text item=1_device label="Plug 01 [MAP(health.map):%s]" valuecolor=[ON="green"] visibility=[ 1_device==ON]
{
Frame label="Plug 01"
{
Default item=Plug_S_01_relay label="Plug_S_01 Ein / Aus "
Default item=Plug_S_01_power label="Leistung"
Default item=Plug_S_01_energy label="W Zähler"
}
Frame label="Leistung"
{
Switch item=Chart_Zeitraum_D_W_M_Y label="" mappings=[0="Stunde", 1="12 h", 2="Tag", 3="Woche", 4="Monat"]
Chart item=Plug_S_01_power period=h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==0, Chart_Zeitraum_D_W_M_Y=="Uninitialized"]
Chart item=Plug_S_01_power period=12h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==1]
Chart item=Plug_S_01_power period=D refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==2]
Chart item=Plug_S_01_power period=W refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==3]
Chart item=Plug_S_01_power period=M refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==4]
}
Frame label="Temperatur"
{
Chart item=Plug_S_01_temp period=h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==0, Chart_Zeitraum_D_W_M_Y=="Uninitialized"]
Chart item=Plug_S_01_temp period=12h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==1]
Chart item=Plug_S_01_temp period=D refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==2]
Chart item=Plug_S_01_temp period=W refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==3]
Chart item=Plug_S_01_temp period=M refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==4]
}
}
//Text label="Plug_S : Plug 03"
Text item=3_device label="Plug 03 [MAP(health.map):%s]" valuecolor=[OFF="red"] visibility=[ 3_device==OFF]
Text item=3_device label="Plug 03 [MAP(health.map):%s]" valuecolor=[ON="green"] visibility=[ 3_device==ON]
{
Frame label="Plug 03"
{
Default item=Plug_S_03_relay label="Plug_S_01 Ein / Aus "
Default item=Plug_S_03_power label="Leistung"
Default item=Plug_S_03_energy label="W Zähler"
}
Frame label="Leistung"
{
Switch item=Chart_Zeitraum_D_W_M_Y label="" mappings=[0="Stunde", 1="12 h", 2="Tag", 3="Woche", 4="Monat"]
Chart item=Plug_S_03_power period=h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==0, Chart_Zeitraum_D_W_M_Y=="Uninitialized"]
Chart item=Plug_S_03_power period=12h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==1]
Chart item=Plug_S_03_power period=D refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==2]
Chart item=Plug_S_03_power period=W refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==3]
Chart item=Plug_S_03_power period=M refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==4]
}
Frame label="Temperatur"
{
Chart item=Plug_S_03_temp period=h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==0, Chart_Zeitraum_D_W_M_Y=="Uninitialized"]
Chart item=Plug_S_03_temp period=12h refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==1]
Chart item=Plug_S_03_temp period=D refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==2]
Chart item=Plug_S_03_temp period=W refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==3]
Chart item=Plug_S_03_temp period=M refresh=60000 service="rrd4j" visibility=[Chart_Zeitraum_D_W_M_Y==4]
}
}
}
The Transform Map is as like the map from hmerk.
Look of the Sitemap:
Thanks again…
And I hope I can help someone with that too…