Page 1 of 1

Chinese push button as a toggeling swich Solved!

Posted: Tuesday 27 August 2019 15:48
by fotomann100
Hello
I'm new in Domoticz. The most things I have done before worked fine. But there is one thing, that I'm not able to create. I guess it should be very easy, but I don't find a way that is working.

The scenario is very simple: A cheap chinese Pushbutton (connected via RFXcom) should trigger a wireless socket switching on or off: First push on, second push off and so on. For programming the toggle functionality I use a blockly script (right?).

I'm able to generate a script for switching the socket on. But when I try to expand the scipt for toggeling, nothing happens or the socket switches on/off peremanently.

Perhaps somebody can advice me?
Greetings
Stefan

Re: Chinese push button as a toggeling swich - advice for the script needed

Posted: Tuesday 27 August 2019 18:41
by waaren
fotomann100 wrote: Tuesday 27 August 2019 15:48 A cheap chinese Pushbutton (connected via RFXcom) should trigger a wireless socket switching on or off: First push on, second push off and so on.
I'm able to generate a script for switching the socket on. But when I try to expand the scipt for toggeling, nothing happens or the socket switches on/off permanently.
Maybe if you could show what you already have (including names and how the on/off actions looks like) I can come up with something in dzVents.

Re: Chinese push button as a toggeling swich Solved!

Posted: Thursday 29 August 2019 16:44
by fotomann100
Problem solved!
The solution is very simple and you Waaren brought me on the right way: "Maybe if you could show what you already have" was your advice. I realized that there is a log file :-)

Even a short single push sends the code three or four times out. In conjunction with the other parts of the blockly program this results in a endless loop.

The remedy: Instead of reading out the socket status (on/off) directly, I defined a user variable for that. Normally the value is "0" (= switch off). The details you can see in the attached screen shot:

Image

Legend:
Schlafzimmer Taster = Push button 433 Mhz
Schlafzimmer Schaltzustand = User variable 0 = off 1 = on
Schlafzimmer Bett = Wireless socket (433 Mhz RFXcom)

Re: Chinese push button as a toggeling swich Solved!

Posted: Friday 30 August 2019 3:20
by sejtam
Can you share what pushbuttons you are using?

Re: Chinese push button as a toggeling swich Solved!

Posted: Tuesday 03 September 2019 20:12
by fotomann100
Shure: This one: https://www.ebay.de/itm/433Mhz-Fernbedi ... 2749.l2649

It works with RFXcom