blockly 'flipflopping'

Moderator: leecollings

Post Reply
rolfb
Posts: 14
Joined: Wednesday 26 September 2018 16:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

blockly 'flipflopping'

Post by rolfb »

Hi all,

I have a nameless 433mhz physical switch from an earlier house. It has 3 buttons: one with a on/off sign, one up and one down.
This is recognised in Domoticz: the on/off sends on or off alternating, the other buttons send only 'on'.
I focus on the on/off button here.

I want to use that button to toggle a 433Mhz switched light, using blockly. I have tried several setups, but it keeps on 'flipflopping' between on and off stages untill I disable this script. I cannot see what I do wrong , can someone please help me out? (If this setup is completely wrong thinking, that's fine too. Any help is good.)
NB: I'm not into LUA or dzvents, that;s why I hope to achieve this in blockly.
NB: "sleutelhanger" is the physical switch on which I push the button, "boekenkast" is the light that needs to be turned off and on.
Image
Attachments
blockly.png
blockly.png (50.55 KiB) Viewed 1549 times
Dave21w
Posts: 369
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: blockly 'flipflopping'

Post by Dave21w »

I don't dispute what you are saying but are you sure the switch itself actually sends an On and then an Off on the next press, all the wireless switches I have ever come across only send one type of command and the device that receives it flips its state each time it gets the signal. Also why are you not using the toggle function in blockly like this :-

If Sleutelhanger_nw_on = On
Set Boekenkast Woonkamer = Toggle

You do not need anything else and a standard If (without the else if) will work fine.
rolfb
Posts: 14
Joined: Wednesday 26 September 2018 16:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: blockly 'flipflopping'

Post by rolfb »

Hi Dave,
thanks for helping.
I assume it sends an off and an on; the data column in the device-page shows these 2 values alternating. Is that then a correct assumption?
For the toggle solution I need to upgrade first I think... (will do soon, then try again).
rolfb
Posts: 14
Joined: Wednesday 26 September 2018 16:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: blockly 'flipflopping'

Post by rolfb »

OK, that upgrade went smooth. :-)
I took your advice and .. it works as a charm.
Don't know if I made it too hard on myself, or that I am saved by the toggle-option in blockly, but it works.
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests