Logic Machine Forum
Alexa and windows control - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Application Store (https://forum.logicmachine.net/forumdisplay.php?fid=11)
+--- Thread: Alexa and windows control (/showthread.php?tid=2901)



Alexa and windows control - MichelDeLigne - 14.10.2020

As any one been able to control properly a window through Alexa?

The problem I am facing is that when I ask Alexa to close the window, I get on the bus a 0 sent to the group address.
Unfortunately, in KNX a 0 means go "up" when you control a window, which opens it.

I do use the Power State skill, as it is the only one I think that deals with bits.

It looks like I need to invert somehow the given value to get the proper results when dealing with windows. 
Any suggestions on how to do it properly?

Thanks.
Michel.


RE: Alexa and windows control - Erwin van der Zwart - 14.10.2020

You could create a virtual object that receives the command from Alexa and control the actual window object from there with this event based script:
Code:
grp.checkwrite('1/1/1', not event.getvalue())
This command will send a inverted value to your bit object


RE: Alexa and windows control - Sral1987 - 15.10.2020

Or your just create a custom Command in the Alexa App. There you can complete the sentence Close the Window or Shut down the Window. then just choose send 1 and done.


RE: Alexa and windows control - MichelDeLigne - 16.10.2020

Thanks for the support, I will test both solutions.


RE: Alexa and windows control - MichelDeLigne - 17.10.2020

(16.10.2020, 08:06)MichelDeLigne Wrote: Thanks for the support, I will test both solutions.

FYI, checkwrite is not the best approach: If someone moves partially the window, it does not use the same group address to do so.
Because of this, LM does not detect a change of value and does not send anything when the order comes from Alexa, because he thinks the window is still in the original position.

The proper solution is to use an instruction that always sends the value to the group address, like: 

Code:
grp.write('13/0/5', not event.getvalue())

This works fine in any cases.
Michel