Hey there !
I control my lights with 433 MHz Sockets, which I implemented with the exec Binding into OH.
I’m already able to control them with the App and the HABPanel.
Now, I want to create a switch or a button, which turns off all lights, so when I leave the apartment, I only have to touch one button and not every single button for each lamp.
My setup looks like this:
— THINGS —
Thing exec:command:funkdose_control_1 [ command=“sudo /opt/raspberry-remote/send 00011 1 %2$s”, interval=0, autorun=true ]
Thing exec:command:funkdose_control_2 [ command=“sudo /opt/raspberry-remote/send 00011 2 %2$s”, interval=0, autorun=true ]
…
— ITEMS —
String dose_00011_1 “Stehlampe Schreibtisch” [ “Switchable” ] { channel=“exec:command:funkdose_control_1:input”, channel=“exec:command:device-nas-status:output”, autoupdate=“false” }
String dose_00011_2 “Stehlampe Sofa” [ “Switchable” ] { channel=“exec:command:funkdose_control_2:input”, channel=“exec:command:device-nas-status:output”, autoupdate=“false” }
…
— SITEMAPS —
sitemap default label=“Home”
{
Frame label=“Wohnzimmer” {
Switch item=dose_00011_1 mappings=[“1”=“An”, “0”=“Aus”]
Switch item=dose_00011_2 mappings=[“1”=“An”, “0”=“Aus”]
} … }
My idea is to make a new (virtual) switch called “all_off”, which turns off every lamp with a rule:
rule "all_off"
when
Item all_off received command ON
then
dose_00011_1.sendCommand(OFF)
dose_00011_2.sendCommand(OFF)
end
ITEMS
String all_off "all_off"
SITEMAPS
Switch item=all_off
And here is the problem. The app doesn’t work anymore now and I think theres a mistake in my rule.
I really looking forward to getting some answers.
Dominik