How to toggle output on button press?

Begonnen von d4vid, 24 Dezember 2014, 15:06:17

Vorheriges Thema - Nächstes Thema

d4vid

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.

JensS

define Input_notify notify <Input> set <Output> toggle
Debian auf APU2C4, HM-CFG-USB2, SIGNALduino, HM-ES-PMSw1-Pl, TFA 30.3121, TFA 30.3125, ITS-150, PIR-5000, configurable Firmata USB & LAN, 1-wire: DS-18B20, DS-18S20, DS-2408, DS-2413, diverse I2C-Komponenten, zigbee2mqtt, ESPEasy etc.

d4vid

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.

JensS

define Input_notify notify <Input> IF (<INPUT> =! 0){set <Output> toggle}
Debian auf APU2C4, HM-CFG-USB2, SIGNALduino, HM-ES-PMSw1-Pl, TFA 30.3121, TFA 30.3125, ITS-150, PIR-5000, configurable Firmata USB & LAN, 1-wire: DS-18B20, DS-18S20, DS-2408, DS-2413, diverse I2C-Komponenten, zigbee2mqtt, ESPEasy etc.

d4vid

And now it's not working. Any other idea?

JensS

Sorry - define Input_notify notify <Input> IF ($EVENT =! 0){set <Output> toggle}
Debian auf APU2C4, HM-CFG-USB2, SIGNALduino, HM-ES-PMSw1-Pl, TFA 30.3121, TFA 30.3125, ITS-150, PIR-5000, configurable Firmata USB & LAN, 1-wire: DS-18B20, DS-18S20, DS-2408, DS-2413, diverse I2C-Komponenten, zigbee2mqtt, ESPEasy etc.

d4vid

Sorry, still not working. No idea why. I'm quite beginner. Event monitor detects button press, but nothing happens.

JensS

#7
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.
Debian auf APU2C4, HM-CFG-USB2, SIGNALduino, HM-ES-PMSw1-Pl, TFA 30.3121, TFA 30.3125, ITS-150, PIR-5000, configurable Firmata USB & LAN, 1-wire: DS-18B20, DS-18S20, DS-2408, DS-2413, diverse I2C-Komponenten, zigbee2mqtt, ESPEasy etc.

d4vid

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.