How to set up 1 switch for 2 items?

OpenHAB2.2.0 on raspi2.
Z-Wave Z-Stick USB (with new z-wave binding from chris)
5x Fibaro Roller/Shutter
1x Fibaro single switch 2
4x Fibaro Door/Window Sensor

Hi - I want to “create” 1 switch on HABpanel called “sleep”. If I switch it to ON I would like to shut down all (5) Roller/Shutters. Can anybody tell me how I could realize this ? Is there another option as rules ?! Or is there a possibility to create “scenes” (sleeping / watching TV …)

THX

all are possible. create a dummy switch (not bound to anything) and use it to control everything else.

or use the Group as master control
Rollershutter Groups

1 Like

should I create the dummy switch in HABpanel or must I create a switch item in HABmin ?

trhe dummy switch is in openhab, then used where ever, but check on the rollershutter group above

1 Like

Hello Thomas

Rules are the OH way to handle such complex Scenes.

A way around is the group.

But from my experience, your Scene will grow :wink:

Thanks to all, I‘ve installed the VS Editor and will try to learn the syntax for rules :slight_smile:

Hey Thomas

That’s great to hear. I hope you enjoy it same as many of us.

If you have some questions, we 'll have the answers.

Cheers, Michael

1 Like

@michael_sutter vielen Dank :wink: Thank you. I´ve struggeling with the syntax…
I will do first baby steps but the log always says: “sleep.rules’ has errors, therefore ignoring it: [5,5]: no viable alternative at input ‘Switch’”

My first test - I would like to switch a dummyswitch from off to on, and 2 rollerShutter will close (but as a test - only the node7 (fibaro single switch) should turn on a light - so I will see if it works…

rule "sleep"
when
    Switch Sleep changed from OFF to ON 
then
    zwave_device_1607fba5041_node7_switch_binary1 = ON
end

where´s my newbie fault ? I have not found a syntax declaration so I do “try and error :confused:

as long as you’re referencing the item name properly, you need to send it the command, like this

zwave_device_1607fba5041_node7_switch_binary1.sendCommand(ON)
1 Like

Hm no success … log:

2018-01-06 13:13:09.425 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'sleep.rules'
2018-01-06 13:13:09.470 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'sleep.rules' is either empty or cannot be parsed correctly!
2018-01-06 13:13:09.648 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'sleep.rules' has errors, therefore ignoring it: [5,5]: no viable alternative at input 'Switch'
// my test rules file

rule "sleep"
when
    Switch Sleep changed from OFF to ON 
then
    zwave_device_1607fba5041_node7_switch_binary1.sendCommand(ON)
end

whoops - didn’t spot it first time. Change ‘Switch’ to ‘Item’ in the ‘when’ part!

2 Likes

@DSTM Yes, that´s it - it works. I have to learn much about the rules syntax :slight_smile: Thank YOU !

http://docs.openhab.org/configuration/rules-dsl.html

1 Like