Button / Switch change Status ater clicking

Hello Community, i am new to node red and HA but i am trying to learn and make some things at our home smart.

We have a Siemens Logo to control all our window shutters. With Tutorials i have managed to get a connection from Logo to Node Red.

I managed to open and close the shutters with a switch and tried adding a button instead of a switch as well. I do have one problem tho:
When clicking the button, the button stays true which leaves voltage on the input of the Logo. With leaving the voltage on the Logo input, i cannot press the other button to open the shutter back up.

I need a way to have nodered just trigger true then false right away, so Logo can manage closing or opening the shutters. Is there a button for this, or do i have to programm something, so the status of the button turns false right after clicking it?

Thanks for your help and cheers

Steve

Hi tyr0n.

Is this a Node-Red Dashboard button?

I don't think a button has a "state", it just sends a message when you click it, it's up to you how you handle the message.

You could use a Trigger node after the button to send "ON" and then 1 millisecond later send "OFF". No idea if that will do what you need.
Maybe you could share your flow with us, the Node-Red and how it interacts with the Siemens device.

Hi Jbudd, this is my flow so far.

image

In the UI i have to toggle the down switch (on/off) so the shutters start closing.
The same for the up switch. I have to toggle the switch so it starts opening.

So i need another option as the normal switch to open/close the shutter. I thought the button could solve that. But the button seems to keep the voltage on the Siemens Logo, so nothing happens. It stays true or on, after it gets clicked.

I need a push button switch (is that the right name for (german: Taster)) that will send a impulse true / false

Here is my Logo Config:

I am sorry, it is hard for me to explain in english...

Not sure because I don't have a LOGO controller, but isn't it possible to use a single interface node like this?
Untitled 6

I dont think so, because the Logo has one input for down, one input for up. :frowning:
I think i found a work around for what i am looking for. But i am sure there is a better way doing it. The Switch isnt really the right controll.

So you are looking for a "click" button. There are multiple solutions for your case. The easiest way is to add a "delay" node and "change" node. You can adjust the "delay" to milli-second level.

The following flow should work.

Source code:

[{"id":"4c408b1b41d818ec","type":"ui_button","z":"a7dc7375.637e7","name":"","group":"c5dac9f2874b5c3a","order":3,"width":0,"height":0,"passthru":false,"label":"Click button","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":250,"y":200,"wires":[["42970a9aa49d73bb","b97d53254bc23d6e"]]},{"id":"42970a9aa49d73bb","type":"delay","z":"a7dc7375.637e7","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":400,"y":160,"wires":[["28ec56b5bfa828fe"]]},{"id":"28ec56b5bfa828fe","type":"change","z":"a7dc7375.637e7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":160,"wires":[["b97d53254bc23d6e"]]},{"id":"b97d53254bc23d6e","type":"debug","z":"a7dc7375.637e7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":200,"wires":[]},{"id":"c5dac9f2874b5c3a","type":"ui_group","name":"Default","tab":"b15d581341d0093f","order":1,"disp":false,"width":"8","collapse":false,"className":""},{"id":"b15d581341d0093f","type":"ui_tab","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
1 Like

Now it works how i want it to work! Big big thanks to both of u for helping me :slight_smile:

Hi, i have now added all my Shutters into Node Red. I have a long list of 14 of these:

I guess there is no shorter way to configure it...

Now i would like to close the shutter at a specific time. I tried adding a inject with boolean true infront of the Kitchen Down button. But nothing happens when clicking it or when its time.

How can i have the button be pressed at a specific time?

Thanks in advance, Steve

If I understand your problems correctly, you can use one "click" button for each of the window shutters. Assuming shutters are currently open then the first time you hit a button the shutters will close. Next time you hit the button the shutters open. You can use Topic to identify individual buttons whether that is for individual window shutters or action (up or down).

[{"id":"077a386a86d9e87b","type":"ui_button","z":"c0c5d253379bdf31","name":"","group":"59365a7684899b93","order":1,"width":0,"height":0,"passthru":true,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"ONE","x":330,"y":80,"wires":[["06c84f9d54d5337c"]]},{"id":"06c84f9d54d5337c","type":"trigger","z":"c0c5d253379bdf31","name":"Momentary delay","op1":"","op2":"false","op1type":"pay","op2type":"bool","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":530,"y":140,"wires":[["60b0a24a7d5c4886","31e6355eb75651e0"]]},{"id":"bb55244c1acba2bb","type":"ui_button","z":"c0c5d253379bdf31","name":"","group":"59365a7684899b93","order":2,"width":0,"height":0,"passthru":true,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"TWO","x":330,"y":140,"wires":[["06c84f9d54d5337c"]]},{"id":"91269d5f6a9e19af","type":"ui_button","z":"c0c5d253379bdf31","name":"","group":"59365a7684899b93","order":3,"width":0,"height":0,"passthru":true,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"THREE","x":330,"y":200,"wires":[["06c84f9d54d5337c"]]},{"id":"60b0a24a7d5c4886","type":"switch","z":"c0c5d253379bdf31","name":"","property":"payload","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"\"ONE\" in topic","vt":"jsonata"},{"t":"jsonata_exp","v":"\"TWO\" in topic","vt":"jsonata"},{"t":"jsonata_exp","v":"\"THREE\" in topic","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":3,"x":530,"y":240,"wires":[["9aaefdb8d19b9700","48221b4353edf537"],["b424607b6db3414a","87cc07492b531923"],["46b3f662475b8f6a","d531a029247d4f22"]]},{"id":"634759e6c0d1d61b","type":"inject","z":"c0c5d253379bdf31","name":"Again in 2min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/2 0-22 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":160,"y":140,"wires":[["bb55244c1acba2bb"]]},{"id":"9aaefdb8d19b9700","type":"ui_text","z":"c0c5d253379bdf31","group":"59365a7684899b93","order":4,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":550,"y":340,"wires":[]},{"id":"b424607b6db3414a","type":"ui_text","z":"c0c5d253379bdf31","group":"59365a7684899b93","order":4,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":550,"y":380,"wires":[]},{"id":"46b3f662475b8f6a","type":"ui_text","z":"c0c5d253379bdf31","group":"59365a7684899b93","order":4,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":550,"y":420,"wires":[]},{"id":"31e6355eb75651e0","type":"debug","z":"c0c5d253379bdf31","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":140,"wires":[]},{"id":"48221b4353edf537","type":"debug","z":"c0c5d253379bdf31","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":200,"wires":[]},{"id":"d531a029247d4f22","type":"debug","z":"c0c5d253379bdf31","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":280,"wires":[]},{"id":"87cc07492b531923","type":"debug","z":"c0c5d253379bdf31","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":750,"y":240,"wires":[]},{"id":"59365a7684899b93","type":"ui_group","name":"Group 1","tab":"92c649c44f3018f2","order":1,"disp":true,"width":6},{"id":"92c649c44f3018f2","type":"ui_tab","name":"Tab 4","icon":"dashboard","order":4}]

Hope the above helps.