Page 1 of 1

blockly, no event when using "and" combining motion and light status

Posted: Tuesday 03 May 2016 23:46
by Joerideman
I've started to experiment with MySensors and blockly. I only have one sensor and 1 actuator, both are childs of the same node.
I want to turn on the light only if the light was off and if there is motion. If the light is already on then there is no need to send another radio transmission.
The following example does not work.
blockly-1.JPG
blockly-1.JPG (34.52 KiB) Viewed 1771 times
I have tried a few other things that did work.

Code: Select all

If motion sensor = on, Do Set light = on

Code: Select all

If light = off, Do Set light = on
Both work. What am I doing wrong?


Extra info, I use Mysensors 1.5 and Domoticz Version: 3.4834

Re: blockly, no event when using "and" combining motion and light status

Posted: Tuesday 03 May 2016 23:56
by Shaggie_NB
Look at your Blockly.....

You have to use the right logic blocks in the right place...

Image

Re: blockly, no event when using "and" combining motion and light status

Posted: Wednesday 04 May 2016 0:54
by Joerideman
blockly-2.JPG
blockly-2.JPG (36.32 KiB) Viewed 1764 times
I swapped them. Is this okay?

Not so different to me.

Re: blockly, no event when using "and" combining motion and light status

Posted: Wednesday 04 May 2016 1:32
by Treve
This must be working, Where D1 is a bulb. 2nd part you can see how it's build.
blockly.jpg
blockly.jpg (28.06 KiB) Viewed 1753 times

Re: blockly, no event when using "and" combining motion and light status

Posted: Wednesday 04 May 2016 1:36
by Joerideman
Guy I finally saw the difference :)

I start with the 'and' and then the inputs.

blockly-3.JPG
blockly-3.JPG (38.72 KiB) Viewed 1753 times
Thank you all.

@Treve I missed your comment, but that would have helped me.

Re: blockly, no event when using "and" combining motion and light status

Posted: Wednesday 04 May 2016 1:46
by Treve
Joerideman wrote:Guy I finally saw the difference :)

@Treve I missed your comment, but that would have helped me.
I tought "2nd part you can see how it's build." say's enough. you're fault was verry simple.

But it's working know, that's the goal.

Re: blockly, no event when using "and" combining motion and light status

Posted: Wednesday 04 May 2016 1:54
by Joerideman
I meant that I read your reply (message and image) after I figured it out.