darrylb123 / usbrelay

Control usb relay - based on hidapi
GNU General Public License v2.0
310 stars 98 forks source link

Querying the state of Line #115

Open ostasevych opened 2 months ago

ostasevych commented 2 months ago

Hi! I am looking for the way to detect power outage in the circuit. Can I use this software code with the usb relay like https://www.aliexpress.com/item/1005006781536777.html for this goal? I mean, I will connect plug to the relay, plug it to the mains line. When there's no power it will send me the alert about that?

darrylb123 commented 2 months ago

I don't understand what you are trying to do. Can you attach a sketch of the circuit you propose?

On Sun, 30 Jun 2024, 11:04 pm Oleksa, @.***> wrote:

Hi! I am looking for the way to detect power outage in the circuit. Can I use this software code with the usb relay like https://www.aliexpress.com/item/1005006781536777.html for this goal? I mean, I will connect plug to the relay, plug it to the mains line. When there's no power it will send me the alert about that?

— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/issues/115, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVJS6UGMNZ4Z5VRBHS3ZJ767DAVCNFSM6AAAAABKEC7YLCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DEMRUGY2DONQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ostasevych commented 2 months ago

Quite simple. I would like to detect if there's power in the 220 V circuit, and to send alerts when it appears and disappears.

darrylb123 commented 2 months ago

Ok, then this won't help you. It does not detect voltage at all. A 220v relay with the supply connected to the relay coil, with an esp8266 running tasmota monitoring a relay contact might be closer to what you're looking for.

On Tue, 2 Jul 2024, 12:23 am Oleksa, @.***> wrote:

Quite simple. I would like to detect if there's power in the 220 V circuit, and to send alerts when it appears and disappears.

— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/issues/115#issuecomment-2200293784, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVNA7U2YUVMIP3LJNGDZKFQ4RAVCNFSM6AAAAABKEC7YLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGI4TGNZYGQ . You are receiving this because you commented.Message ID: @.***>

ostasevych commented 2 months ago

Ok, then this won't help you. It does not detect voltage at all. A 220v relay with the supply connected to the relay coil, with an esp8266 running tasmota monitoring a relay contact might be closer to what you're looking for.

On Tue, 2 Jul 2024, 12:23 am Oleksa, @.***> wrote:

Quite simple. I would like to detect if there's power in the 220 V circuit, and to send alerts when it appears and disappears.

— Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/issues/115#issuecomment-2200293784, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVNA7U2YUVMIP3LJNGDZKFQ4RAVCNFSM6AAAAABKEC7YLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBQGI4TGNZYGQ . You are receiving this because you commented.Message ID: @.***>

Oh, thanks for the quick reply. May I ask you to send examples of devices/pcb which have this feature? What I need is just detect presence or absence of the power.