• 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


Relay
#1
Just a very simple question with regards to the relay protocol: I think it would make sense to add a "inversed" option to the protocol configuration. Which should set the pin of the gpio to the inversed value.

The reason is this: if you drive your relay trough an common transistor chip like the ULN2803, your output will be "inverted" in the sense that a high signal, results in a low state on your relay and vice versa.

By allowing the gpio pin to be inversed, the on-off states match the actual situation. The point is that if all power is off (relay without power, pi without power) you want your heating system to be connected to the "Normally Closed" side of the relay. And as the transistors will sink current rather than sourcing it, you will end up with an inversed signal...
 
Reply
#2
Already supported:
http://wiki.pilight.org/doku.php/relay

"default-state “off” State Default state of the relay"
 
Reply
#3
(05-20-2014, 09:31 PM)curlymo Wrote: Already supported:
http://wiki.pilight.org/doku.php/relay

"default-state “off” State Default state of the relay"

Ah... I noticed the setting, but thought it had to do with the state it will be set in upon "starting the application". But it is in fact the inverter.

The webinterface behaves a bit different though. When I boot the system with "default-state" to "On", the webui shows "On". The relay is off. (as expected with this switch). Now when i switch the webUI from "On" to Off", nothing happens. Which is expected, because the webui now matches the state of the relay. When i switch the relay back to "On" in the ui, the relay switches and all is fine.

So I think there's then a minor bug with the webui upon rebooting?
 
Reply
#4
The webgui shouldn't care of the state of the protocol. It just read the on/off from the config. Can you check http://x.x.x.x/config to see if that is correct?
 
Reply
#5
(05-20-2014, 09:55 PM)curlymo Wrote: The webgui shouldn't care of the state of the protocol. It just read the on/off from the config. Can you check http://x.x.x.x/config to see if that is correct?

Ok, did a couple of tests.

- If I set the the relay to OFF in the webui and it does indeed switch correctly (off), and I reboot the PI, then the relay will still be off after the reboot and the webui will show off after the reboot.

- If I set the the relay to ON in the webui and it does indeed switch correctly (on), and I reboot the PI, then the relay will be OFF after the reboot but the webui and the config will show ON.


So it looks like I'm having a problem with the value read from the config ("ON") and the actual state off the pin/relay...
 
Reply
#6
The reboot issue can't be fixed, because relay normally don't respond with the state their in. Is that the only issue with the relay protocol?
 
Reply
#7
(05-21-2014, 01:36 PM)curlymo Wrote: The reboot issue can't be fixed, because relay normally don't respond with the state their in.

It's just that the state doesn't match what the GUI says. And for my heater, I would prefer enforcing it is off at reboot (or process shutdown) time. It is now off, so that's fine, but would be better if the gui matches the state. But indeed, it's a minor issue, it will correct itself after the first on-off cycle anyway.

(05-21-2014, 01:36 PM)curlymo Wrote: Is that the only issue with the relay protocol?

So far, yes... ;-) waiting for the transceiver kit to setup the rest..
 
Reply
#8
It's still not very clear what the exact issue is Smile
 
Reply
#9
Hello!!

I´ve got following problem:

I have a LED connected to Pin24 (GPIO 5).

"gpio write 5 1" toggles the LED on
"gpio write 5 0" toggles the LED off

That works fine...but

"pilight-send -p relay -g 5 -t" toggles the LED off
"pilight-send -p relay -g 5 -f" toggles the LED on

Why is that inverted?

Greetings Smile
 
Reply
#10
It reacts to the default state you can set yourself:
http://wiki.pilight.org/doku.php/relay_v6_0
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Relay Pulse Balauue 5 5,161 03-06-2016, 10:21 PM
Last Post: wo_rasp

Forum Jump:


Browsing: 1 Guest(s)