Dynamic usage of wallplugs

Hi There,

christmas is near and my wife demands some wallplugs with automation to switch all the lights and stuff …

Now i try to create something like dynamically link mobile wallplugs to a virtual switch, so that i cann use the same plug for the xmas tree and in summer for the pool pump. And create a logic that enables me to switch the plug with a “virtual” switch, one or more timers (time should be defined freely) and by other scenes with adefined hierarchy.

Has someone out build such a solution? If yes any advice is welcome.


Sure,I’m using a zwave wall plug for exactly that.
Any plug can be toggled from rules based on time, motion or whatever event. independent of the GUI.
And you can add virtual switches (simply omit the binding spec part) and run a rule if you switch that on in GUI.
That’s supposed to be straightforward stuff … what’s your question, then ?
For electrical installation instructions, I recommend to go watch that ol’ Chevy Chase movie …

Ok, so my description was not very clear. I try it again.

Assume the i habe three mobile wallplugs (one, two and three). While in summe they are used in the garden for some stuff in winter they should be used for xmas ligthing things. Thats still pretty forward.

But i do not want to define exactly which of the plus is for wich purpose. So my idea is: Pick a plug from the box, Lets assume it is Plug one, use it for the xmas tree and the go to openhab and assign plug one using something like a dropdown menu to he virtual xmas tree switch. With this approach i am very felxible without coding things every time new.

I think thats my bigged problem at the moment.


Honestly, I still don’t see your problem. Either call the items mobile_plug1, mobile_plug2 etc. or similar and use those generic names in your rules.
Or setup two items (named say pool_pump and xmas1) for the same plug (i.e. 2 lines in items file with different names but identical binding or channel config), then just use ‘pool_pump’ in your summer rules and ‘xmas1’ in your xmas lighting rules. No need to ever change the rules.

You’re looking for a kind of indirect addressing.

You can realize it e.g. with functions, where you define the functionalities for the pool pump or the Christmas tree. At the functions you can have an item as an (dynamic) parameter.

See as example:

I don’t see any indirect adressing needed here, just define a switch for your plug (" mobile_1" or whatever) and use it on a UI with ANOTHER displayed name.
That way you can easily switch from one use to the other ( change the UI LABEL from pool to xmas-tree) and still have the descriptive name of the item/switch so that you know which switch is actually used.
I use that setup and it took me just minutes to install the hardware (Xmas stars in all windows) and even less for the setup in OH. All those plugs were preconfigured and I had only to set the actual window-name on the UI. WAF went up big time!