FHEM Forum

FHEM => English Corner => Thema gestartet von: d4vid am 24 Dezember 2014, 15:06:17

Titel: How to toggle output on button press?
Beitrag von: d4vid am 24 Dezember 2014, 15:06:17
Hello, I have a question.

I installed FHEM and my setup is raspberry pi and arduino with firmata firmware.
I can toggle output and I can read inputs in FHEM without problems.

Can I somehow use arduino inputs for toggling output? I tried few thing and none of the worked. Well, I want to setup this in FHEM, if not possible I will have to change the arduino program. Any idea would be nice.
Titel: Antw:How to toggle output on button press?
Beitrag von: JensS am 25 Dezember 2014, 19:33:55
define Input_notify notify <Input> set <Output> toggle
Titel: Antw:How to toggle output on button press?
Beitrag von: d4vid am 25 Dezember 2014, 19:56:43
Thanks for reply, but this is somehow not working. I have button, not a switch. So when I release the button, it goes back to "0". And light is on only when button is pressed.
Titel: Antw:How to toggle output on button press?
Beitrag von: JensS am 25 Dezember 2014, 20:11:56
define Input_notify notify <Input> IF (<INPUT> =! 0){set <Output> toggle}
Titel: Antw:How to toggle output on button press?
Beitrag von: d4vid am 25 Dezember 2014, 21:06:53
And now it's not working. Any other idea?
Titel: Antw:How to toggle output on button press?
Beitrag von: JensS am 25 Dezember 2014, 21:08:24
Sorry - define Input_notify notify <Input> IF ($EVENT =! 0){set <Output> toggle}
Titel: Antw:How to toggle output on button press?
Beitrag von: d4vid am 25 Dezember 2014, 21:25:54
Sorry, still not working. No idea why. I'm quite beginner. Event monitor detects button press, but nothing happens.
Titel: Antw:How to toggle output on button press?
Beitrag von: JensS am 25 Dezember 2014, 23:22:50
My English is not good and I am a beginner.
Try:
define Input_notify notify Input IF ([Input] ne "0")(set Output toggle)
Input is the name of your Button and Output is the name of your lamp.
Titel: Antw:How to toggle output on button press?
Beitrag von: d4vid am 26 Dezember 2014, 09:15:16
Weird, nothing works. Did I missed something?

for example," define <notify> notify <input> set <output> on-for-timer 30 " works. Anything else just won't.