Virtual Light

Hi All,

I am trying to add light on sample svg plan for understanding purpose. Hardware is not ready yet.
I like to add lights (virtually) in svg plan and will turn it to ON and OFF.

How to add virtual lights in openhab?. Is there binding available for virtual lights?.

Can you please help me on this ?.

Thanks,
Dhanasekar

No need for bindings. Just create an switch item. If it’s not liked to any channel it is called virtual item.

1 Like

For virtual items, I need create .item file in /etc/openhab2/… I cannot create virtual items in openHAB portal…

yes in an .item file.

Bob,

I have created virtual light in .item file. When I click the light in svg floor plan, state of light is not changing ( not glowing). How to confirm virtual lights are bind properly in svg floor plan.

Thanks,
Dhanasekar

what is the contents of your .items entry for this virtual light ? what is the corresponding definition in the svg floor plan ?

.items details:

  1. Switch Light_GF_Corridor_Ceiling “Ceiling” (GF_Corridor, Lights) [“Light”]
    2.Switch Light_C_Workshop “Workshop” (gC, Lights) [“Light”, “Lighting”]

svg floor plan details:

.css details:

.sample-light-on{
fill: organe !important:
}
.light-on {
fill: #ffe600 !important;
}

Hi Bob,

I am waiting for your input. Can you please provide your suggestion ?

After debugging, I have found that light ON/OFF events are taking place when I click on the light in the svg floorplan, but lights are not glowing.

2018-11-22 14:31:56.286 [ome.event.ItemCommandEvent] - Item ‘Light_GF_Corridor_Ceiling’ received command OFF
2018-11-22 14:31:56.287 [vent.ItemStateChangedEvent] - Light_GF_Corridor_Ceiling changed from ON to OFF
2018-11-22 14:31:56.287 [GroupItemStateChangedEvent] - Lights changed from ON to OFF through Light_GF_Corridor_Ceiling
2018-11-22 14:31:56.423 [ome.event.ItemCommandEvent] - Item ‘Light_GF_Corridor_Ceiling’ received command ON
2018-11-22 14:31:56.425 [vent.ItemStateChangedEvent] - Light_GF_Corridor_Ceiling changed from OFF to ON
2018-11-22 14:31:56.425 [GroupItemStateChangedEvent] - Lights changed from OFF to ON through Light_GF_Corridor_Ceiling
2018-11-22 14:31:56.623 [ome.event.ItemCommandEvent] - Item ‘Light_GF_Corridor_Ceiling’ received command OFF
2018-11-22 14:31:56.629 [vent.ItemStateChangedEvent] - Light_GF_Corridor_Ceiling changed from ON to OFF
2018-11-22 14:31:56.629 [GroupItemStateChangedEvent] - Lights changed from ON to OFF through Light_GF_Corridor_Ceiling

I think you need an icon indicator in your item that points to one of the icons that have ON/OFF variants. Like this:

Switch	SW_u_01_LIGHT_Attic	"Attic   "	<light>	(gSwitch)		{channel="zwave:device:512:node28:switch_binary" }

The left-angle-bracket light right-angle-bracket is the missing piece in your item.

I have tried in below ways and still light is not glowing in floorplan,

Method 1:

Switch Light_GF_Corridor_Ceiling    "Ceiling"      <light> (GF_Corridor, Lights)   ["Light"]
Switch Light_C_Corridor_Ceiling     "Ceiling"      <light> (gC, Lights)            ["Light"]

Method 2:

Switch Light_GF_Corridor_Ceiling    "Ceiling"      <light> (gSwitch) 
Switch Light_C_Corridor_Ceiling     "Ceiling"      <light> (gSwitch)