• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trigger a one-shot device from pilight

I'm trying to use pilight to trigger a garage-door, which is triggered by a one-shot relay contact. So the action should be to activate the relay for about 0.5 sec or so.

This could be an option to the relay protocol, or a separate protocol. It would require a different icon in the gui: a pushbutton instead of a toggle.

Any ideas on this?
I've got some hopefull results with the timer module from martinr63, but the specifying a timer period < 1 sec. is not very accurate. Maybe it would suffice for this application however.

the timer works only with full seconds.
Hi Martin,

Thanks for the reply. I expected this would be the case. Would it be better to implement a separate protocol for short pulse relays activation, or could your timer module be adapted to implement shorter periods?

Hey, this is my approach. I've needed a simple push button that switches devices off. Maybe this is something for you as well?
"avrall-off": {
                        "rule": "IF avrall.state IS on THEN switch DEVICE tv AND bluray AND avr AND lp AND avrall TO off",
                        "active": 1
A second approach is to use an additional "hidden" generic switch. In this case I want a rule ("turn on lamp at 8:15") to be disabled after running once. This is the action to turn on the lamp and a hidden "helper" switch:
"19a-on-timer-8am-once": {
                        "rule": "IF zeit.hour == 8 AND zeit.minute == 15 AND zeit.second == 0 AND rule2switch.state IS on THEN switch DEVICE 19a AND onetimeswitch1 TO on",
                        "active": 1
And this is the rule to disable the rule switch and the hidden "helper" switch:
"ruleswitch2-off": {
                        "rule": "IF rule2switch.state IS on AND onetimeswitch1.state IS on THEN switch DEVICE rule2switch AND onetimeswitch1 TO off",
                        "active": 1

.. just my 5 cents on that .. All switching based on rules is working kinda instantly Big Grin
Hi Karel,

please take a look in the timer thread. I've updated the protokoll. Now you can trigger a device with a minimum time of 0.1 seconds.

Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] On and Off for one device in one rule Oliver 3 495 10-28-2019, 06:55 PM
Last Post: Oliver
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,173 07-31-2018, 06:25 AM
Last Post: curlymo
  Rule with&without device. One working not the other... Tamadite 9 1,440 07-24-2018, 08:55 AM
Last Post: curlymo
  pilight service not starting vlatko.jordanov 2 772 05-26-2018, 01:42 PM
Last Post: vlatko.jordanov
  tabs on pilight SeLi 5 2,770 05-31-2017, 09:25 PM
Last Post: NormBot
  Always trigger event on any device state Phil 8 2,489 03-22-2017, 07:30 PM
Last Post: Phil
  [Solved ]Turn off device at random time manmetdehamer 4 2,273 07-27-2016, 03:35 PM
Last Post: manmetdehamer
  alarm system using pilight rbrueckner 4 2,349 05-14-2016, 12:24 PM
Last Post: diman87
  Rules make pilight freeze koos147 5 2,256 05-04-2016, 08:11 PM
Last Post: curlymo
  ERROR: rule #21 invalid: variable "label" of device "WindMax" cannot be used in even koos147 2 1,960 04-02-2016, 10:24 PM
Last Post: koos147

Forum Jump:

Browsing: 1 Guest(s)