I have a toggle issue which I can’t quite figure out how to solve.
I have recently setup the Amazon Echo to control my lights, etc. All my lights are controlled by IHC, and I’m using the IHC / ELKO Binding for OH2, in order to control my house from the OH app.
The IHC uses toggle switches to turn ON / OFF the lights, wall plugs, etc. The way I have handled this so far, is that I have made a rule, which always switches an ON command back to OFF - not pretty, but it works
Here is my config i OH2:
Switch IHC_Kontor1sal "My Room" ["Lightning"] {ihc="0xE35A"}
rule "IHC_Kontor1sal"
when
Item IHC_Kontor1sal changed
then
if(IHC_Kontor1sal == ON){
Thread::sleep(200)
}
else {
sendCommand(IHC_Kontor1sal,OFF)
}
end
Now my issue is that the Amazon Echo receives the following two commands:
“Alexa, turn on My Room”
“Alexa, turn off My Room”
The “off” command does not work with the toggle switching of IHC, as the state is off already due to the rule. Also, it seems wrong to be telling Alexa to turn “on” a light in order to turn if back off again
Any advise on how to handle this? Maybe I should setup my items and rules etc. totally differently?
Yes exactly! Map the outputs, and forget about the inputs. You only need to map inputs, when you want to get information about the state of the input, for example one door sensor. Try it and give me some feedback.
Regards
Thanks a lot. It worked perfectly! Now I can call out the on/off commands and I have also gotten rid of all my previous rules.
Only thing that I can’t figure out is the shutoff all function in my house. The output of the function block in IHC does not shutoff everything when triggered from OH or Alexa.