I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
Any suggestions on where to look ? I'm not interested in a wireless solution, as it is likely to be used in places where signals are not reliable.
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
Any suggestions on where to look ? I'm not interested in a wireless solution, as it is likely to be used in places where signals are not reliable.
On 1
(FWIW I'm leaning towards the Shelly Plus Plug, at around £20. IIRC
there's a euro version too. It's the only one I've found that seems not
to need cloud servers.)
Any suggestions on where to look ? I'm not interested in a wireless solution, as it is likely to be used in places where signals are not reliable.
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
Any suggestions on where to look ? I'm not interested in a wireless solution, as it is likely to be used in places where signals are not reliable.
Thanks
Adrian
Adrian <bulleid@ku.gro.lioff> wrote:
I'm looking for a USB controlled mains switch (230V AC) that I canI don't understand the difference. Surely anything that's going to
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one
that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
turn something on/off needs to be "one that sits in line (between the
device and the supply)" doesn't it?
Do you mean (the ones that cost 100 Euros or more) something that
already has a mains plug and socket on it? I think they're going to
be expensive simply because they aren't much in demand. What 'the
world' wants is a WiFi connected switch and they're two a penny of
course.
Any suggestions on where to look ? I'm not interested in a wirelessI think you'll probably have to bite the bullet and get a relay board
solution, as it is likely to be used in places where signals are not
reliable.
of some sort. Does it **have** to be USB? There's lots of quite neat
relay hats for the Pi.
On 1/18/25 23:07, Adrian wrote:
Any suggestions on where to look ? I'm not interested in a wireless
solution, as it is likely to be used in places where signals are not
reliable.
What do you mean not reliable? Active interference? Otherwise if you
have a device close enough for USB, it will be close enough for
Bluetooth or WiFi.
On 18/01/2025 23:07, Adrian wrote:
I'm looking for a USB controlled mains switch (230V AC) that I can >>connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem
to fall into two categories, either a relay device which means having >>rewire the device (which I'd rather avoid), priced around 30Euros or
one that sits in line (between the device and the supply). The latter >>appears to be in excess of 100Euros, which is considerably more than I >>want to pay.
Any suggestions on where to look ? I'm not interested in a wireless >>solution, as it is likely to be used in places where signals are not >>reliable.
Oh, and if you only need a PI for local control, with no networking,
don't forget the PI can be an AP and run a nearby wireless device
without a central router.
(FWIW I'm leaning towards the Shelly Plus Plug, at around £20. IIRC
there's a euro version too. It's the only one I've found that seems not
to need cloud servers.)
Adrian <bulleid@ku.gro.lioff> wrote:
I'm looking for a USB controlled mains switch (230V AC) that I canI don't understand the difference. Surely anything that's going to
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one
that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
turn something on/off needs to be "one that sits in line (between the
device and the supply)" doesn't it?
Do you mean (the ones that cost 100 Euros or more) something that
already has a mains plug and socket on it? I think they're going to
be expensive simply because they aren't much in demand. What 'the
world' wants is a WiFi connected switch and they're two a penny of
course.
Any suggestions on where to look ? I'm not interested in a wirelessI think you'll probably have to bite the bullet and get a relay board
solution, as it is likely to be used in places where signals are not
reliable.
of some sort. Does it **have** to be USB? There's lots of quite neat
relay hats for the Pi.
On 19/01/2025 11:25, Pancho wrote:
On 1/18/25 23:07, Adrian wrote:
Any suggestions on where to look ? I'm not interested in a wireless >>>solution, as it is likely to be used in places where signals are not >>>reliable.What do you mean not reliable? Active interference? Otherwise if
you have a device close enough for USB, it will be close enough for >>Bluetooth or WiFi.
Sadly that is not a given. You wont get much wifi to a board inside a
tin box, but you could make a hole for a USB cable...
serial over USB can probably do a hundred meters at a pinch, too.
In message <vmitka$2719a$11@dont-email.me>, The Natural Philosopher <tnp@invalid.invalid> writes
On 19/01/2025 11:25, Pancho wrote:
On 1/18/25 23:07, Adrian wrote:
Any suggestions on where to look ? I'm not interested in a wireless >>>> solution, as it is likely to be used in places where signals are not What do you mean not reliable? Active interference? Otherwise if
reliable.
you have a device close enough for USB, it will be close enough for
Bluetooth or WiFi.
Sadly that is not a given. You wont get much wifi to a board inside a
tin box, but you could make a hole for a USB cable...
serial over USB can probably do a hundred meters at a pinch, too.
By WiFi, in this case, I'm referring to my home WLAN.
This isn't a new install, I'm looking at extending what I do with that particular Pi. I've tried using the Pi on WiFi in that location and it
can disappear off the network for prolonged periods of time. Likewise
if I'm stood next to it with my mobile, it has reverted to 4G rather
than WiFi for data, so the location is not really practical for a WiFi
based solution.
Using the Pi as an AP could work, that isn't something I've tried yet.
The Pi lives in a plastic IP55 box, so I would hoped that short range (couple of feet) WiFi / Bluetooth would work.
I'm looking for a USB controlled mains switch (230V AC) that I can connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to fall into two categories, either a relay device which means having to rewire
the device (which I'd rather avoid), priced around 30Euros or one that
sits in line (between the device and the supply). The latter appears to
be in excess of 100Euros, which is considerably more than I want to pay.
Any suggestions on where to look ? I'm not interested in a wireless solution, as it is likely to be used in places where signals are not reliable.
In message <6pru5l-oju1.ln1@q957.zbmc.eu>, Chris Green <cl@isbd.net>
writes
Adrian <bulleid@ku.gro.lioff> wrote:
I'm looking for a USB controlled mains switch (230V AC) that I canI don't understand the difference. Surely anything that's going to
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one >> that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
turn something on/off needs to be "one that sits in line (between the >device and the supply)" doesn't it?
The cheaper option involves cutting the plug off the item, and hard
wiring it into the board. I've got two problems with that. Firstly, it means that I can't readily reuse that item elsewhere as I'd have to
replace the plug (a bit of a faff if it is temporary move), and secondly
if I'm trying to control something fed via a wall wart then it gets
messy unless I leave the wall wart powered all the time (which I'd
rather not do), and switch between it and the device.
No, but USB seemed to be the most likely solution as it works equally as well for Non-Pi situations. Power may also be an issue. My initial requirement is for a low power device, which (without checking the
numbers) might be within the capability of running directly from the Pi,
but I can foresee needs where that won't be the case, so a standard
solution has its attractions.
The advantage of wireless is you get isolation for free, so you don't need
to worry about mains backfeeding into the Pi, which makes construction >cheaper. It doesn't need to be wifi, there are also options using 433MHz >'remote control' frequency, which is point to point and longer range:
https://energenie4u.co.uk/catalogue/product/ENER002-2PI >https://www.ebay.co.uk/itm/396124241128
also with power measurement: >https://energenie4u.co.uk/catalogue/product/ENER002-2PI-RT
The transmitter speaks GPIO and there's Python code to control them from the >Pi.
... the options seem to fall into two categories, either a relay device which means having to rewire the device (which I'd rather avoid), priced around 30Euros or one that sits in line (between the device and the
supply)
Adrian,
... the options seem to fall into two categories, either a relay device
which means having to rewire the device (which I'd rather avoid), priced
around 30Euros or one that sits in line (between the device and the
supply)
Whut ? As others have already mentioned, you could take a short extension cord and put the relais* in that cord. Makes it reusable too.
* also consider a solid-state relais.
Also, you say USB controlled. How do you imagine that ? As some kind of special USB device (for which it is hard to find a driver) ?
Perhaps consider a simple USB-to-serial thingly*, where you can use the DTR line to signal the relais board to switch on. After that you can use the
RPi build-in serial API to switch the relais.
* I would strongly suggest to use one of RPi's gazillion I/O pins for it,
but as you specifically mentioned USB controlled ...
The only thing you will need to do (and which costs money) is to put the relais (and the USB-to-signal-line thingamagochy ?) in a shielding plastic box. 220 is lethal even when you touch it by accident. :-) And make sure the 220v and the relais-driving low-voltage electronics are well seperated. Your RPi doesn't like 220v either. :-o
Regards,
Rudy Wieser
Also, you say USB controlled. How do you imagine that ? As some kind of
special USB device (for which it is hard to find a driver) ?
As I have said previously, it's easy. E.g. https://www.amazon.co.uk/Control-Intelligent-Channel-Controller-Support-default/dp/B07PWPF2DT
Load 'usbrelay' to control (apt-get install usbrelay')
Do*NOT* use stuff above its voltage rating.
On 20/01/2025 06:26, R.Wieser wrote:
Do*NOT*Â use stuff above its voltage rating.
Look at the damn pictures of the relays, you can see the ratings and the model number used.
SR-05VDC-SL-C
   5V DC SONGLE Power Relay SRD-05VDC-SL-C (5 Pin mit NC / NO)
   Contact form: 1a, 1b, 1c
   Rated load: 10A 250VAC/28VDC,10A 125VAC/28VDC,10A 125VAC/28VDC
   Contact resistance: <= 100 mOhm
   Electrical life: 100,000
   Mechanical life: 10,000,000
   Coil rated voltage: 3-48VDC
   Coil power: 0.36W, 0.45W
   Coil pick-up voltage: <= 75%
   Coil drop-out voltage: >=10%
   Ambient temperature: -25 degrees Celsius to +70 degrees Celsius
   Coil and contacts:1500VAC/min
   Contact and contacts: 1000VAC/min
   Insulation resistance: >=100M (ohm)
https://www.play-zone.ch/de/5v-dc-power-relay-songle-srd-5vdc-sl-c.html
On 20/01/2025 06:26, R.Wieser wrote:
Do*NOT* use stuff above its voltage rating.
Look at the damn pictures of the relays, you can see the ratings and the model number used.
Do*NOT* use stuff above its voltage rating.
Look at the damn pictures of the relays, you can see the ratings and the
model number used.
You mean you didn't follow the "See more product details" under "About this item" link ?
Ah, there is also a "product parameters" paragraph (down the page).
And no, the relais themselves being specced for 220V doesn't mean shite when the board its on has its low- and high-voltage tracks too close together.
The high-voltage tracks are MUCH fatter than the low voltage tracks
on the PCB, as you can clearly see in the photo of the underside of
the board,
and high and low voltage sections of the board are well separated.
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
The cheaper option involves cutting the plug off the item, and hard
wiring it into the board. I've got two problems with that. Firstly, it means that I can't readily reuse that item elsewhere as I'd have to
replace the plug (a bit of a faff if it is temporary move),
and secondly
if I'm trying to control something fed via a wall wart then it gets
messy unless I leave the wall wart powered all the time (which I'd
rather not do), and switch between it and the device.
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or one that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
Any suggestions on where to look ? I'm not interested in a wireless solution, as it is likely to be used in places where signals are not reliable.
Thanks
Adrian
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or
one that sits in line (between the device and the supply). The latter >appears to be in excess of 100Euros, which is considerably more than I
want to pay.
Any suggestions on where to look ? I'm not interested in a wireless >solution, as it is likely to be used in places where signals are not >reliable.
Thanks
Adrian
In message <TjgqpoLGRDjnFwvW@ku.gro.lloiff>, Adrian
<bulleid@ku.gro.lioff> writes
I'm looking for a USB controlled mains switch (230V AC) that I can
connect to a PI to turn a mains power supply on and off.
I've done a bit of digging around on the net, and the options seem to
fall into two categories, either a relay device which means having to
rewire the device (which I'd rather avoid), priced around 30Euros or
one that sits in line (between the device and the supply). The latter
appears to be in excess of 100Euros, which is considerably more than I
want to pay.
Any suggestions on where to look ? I'm not interested in a wireless
solution, as it is likely to be used in places where signals are not
reliable.
Thanks
Adrian
OP here with a follow up.
After some ruminating, I decided to give the Local Bytes Smart plug a
try. I've got it happily working now, although I did have to install
(yet) another Pi to act as the control hub (Home Assistant if anyone is interested). I'm now waiting for a fresh delivery of a Pi3 to install
as a WiFi AP (the Pis in the locality are all Pi2).
One useful feature of the Local Bytes offering is that you can see to
power being consumed by the device it is controlling (although mine
suggests that I'm on 245V), but I've yet to work out how to access that
via a command line, rather than web interface.
Thanks again for the suggestions.
Adrian
OP here with a follow up.
After some ruminating, I decided to give the Local Bytes Smart plug
a try. I've got it happily working now, although I did have to install >>(yet) another Pi to act as the control hub (Home Assistant if anyone
is interested). I'm now waiting for a fresh delivery of a Pi3 to
install as a WiFi AP (the Pis in the locality are all Pi2).
One useful feature of the Local Bytes offering is that you can see
to power being consumed by the device it is controlling (although mine >>suggests that I'm on 245V), but I've yet to work out how to access
that via a command line, rather than web interface.
Thanks again for the suggestions.
Adrian
Did you opt for ESPHome or Tasmota firmware?
I use Tasmota, but I use Domoticz rather than Home Assistant. From what
I read ESPHome is tailored for Home Assistant and uses REST API rather
than MMQT like Tasmota.
A Pi4 can handle a lot of different services on the same machine,
installed in Docker Containers. So you don't necessarily need lots of
Pis. If the Pi4 isn't enough, there are more powerful Pis.
=Pi3 I had to go shopping. I hope that for what I'm going to be usingit for (apart from the AP), a Pi3 will be more than enough.
interested). I'm now waiting for a fresh delivery of a Pi3 to install
as a WiFi AP (the Pis in the locality are all Pi2).
On 2025-02-10, Adrian <bulleid@ku.gro.lioff> wrote:
interested). I'm now waiting for a fresh delivery of a Pi3 to install
as a WiFi AP (the Pis in the locality are all Pi2).
I hope you plan to run other services on the Pi3 as well - used purely as an >access point, the pi is not the best choice. For a low number of stations >and low throughput, it works, but dedicated wireless access points have >better wifi hardware (and probably cost less).
So far as I've been able to find out, HA is only installed as an image
on the SD card (using the RPI Imager), rather than manually installed on
an existing Pi image (e.g. apt install ...), so that means that the Pi
can only be used for what HA allows you to do. Therefore, one downside
(for me) with HA is that I don't seem to be able to gain SSH access to
the PI. I can access it via the web interface, and I can install a ZSH shell on it, but that is in (I think) a Docker Container. What I would
like to be able to do, which I can with my other Pis, is to run regular health check stuff, CPU temp, free memory, free card space that sort of stuff. I can do that from the Docker Container, but I can't set up a
cron job to do it, and I haven't even tried getting it to email me a
daily summary.
HA can be installed in several ways.
Adrian <bulleid@ku.gro.lioff> wrote:
So far as I've been able to find out, HA is only installed as an image
on the SD card (using the RPI Imager), rather than manually installed on
an existing Pi image (e.g. apt install ...), so that means that the Pi
can only be used for what HA allows you to do. Therefore, one downside
(for me) with HA is that I don't seem to be able to gain SSH access to
the PI. I can access it via the web interface, and I can install a ZSH
shell on it, but that is in (I think) a Docker Container. What I would
like to be able to do, which I can with my other Pis, is to run regular
health check stuff, CPU temp, free memory, free card space that sort of
stuff. I can do that from the Docker Container, but I can't set up a
cron job to do it, and I haven't even tried getting it to email me a
daily summary.
HA can be installed in several ways.
On 2/13/25 12:15, Theo wrote:
Adrian <bulleid@ku.gro.lioff> wrote:
So far as I've been able to find out, HA is only installed as an imageHA can be installed in several ways.
on the SD card (using the RPI Imager), rather than manually installed on >>> an existing Pi image (e.g. apt install ...), so that means that the Pi
can only be used for what HA allows you to do. Therefore, one downside
(for me) with HA is that I don't seem to be able to gain SSH access to
the PI. I can access it via the web interface, and I can install a ZSH
shell on it, but that is in (I think) a Docker Container. What I would
like to be able to do, which I can with my other Pis, is to run regular
health check stuff, CPU temp, free memory, free card space that sort of
stuff. I can do that from the Docker Container, but I can't set up a
cron job to do it, and I haven't even tried getting it to email me a
daily summary.
I had no idea why I chose Domoticz over HA, it was a few years ago, but
you present a compelling argument.
My rpi4 Domoticz install is a 12 line docker-compose.yml.
I already had MQTT.
Domoticz works, lets me switch things on and off, immediately or
scheduled, and provides me with historical usage graphs. Which is all I >really want.
Dunno if it relates to you, but I had a similar SSH problem.
I had a Gitea Container (a pretty UI git repo manager) needing to
reserve the standard SSH port for git to work, this took over the host
rPi host standard SHH port. My solution was to assign the Gitea
container its own LAN IP address using a Docker Macvlan network drive,
thus the Gitea container and the host rPI could each use the default
SSH port as they had distinct IPs.
In message <vol5gc$2v89p$1@dont-email.me>, Pancho <Pancho.Jones@protonmail.com> writes
On 2/13/25 12:15, Theo wrote:
Adrian <bulleid@ku.gro.lioff> wrote:
So far as I've been able to find out, HA is only installed as an image >>>> on the SD card (using the RPI Imager), rather than manually HA can be installed in several ways.
installed on
an existing Pi image (e.g. apt install ...), so that means that the Pi >>>> can only be used for what HA allows you to do. Therefore, one downside >>>> (for me) with HA is that I don't seem to be able to gain SSH access to >>>> the PI. I can access it via the web interface, and I can install a ZSH >>>> shell on it, but that is in (I think) a Docker Container. What I would >>>> like to be able to do, which I can with my other Pis, is to run regular >>>> health check stuff, CPU temp, free memory, free card space that sort of >>>> stuff. I can do that from the Docker Container, but I can't set up a >>>> cron job to do it, and I haven't even tried getting it to email me a
daily summary.
I had no idea why I chose Domoticz over HA, it was a few years ago,
but you present a compelling argument.
My rpi4 Domoticz install is a 12 line docker-compose.yml.
I already had MQTT.
Domoticz works, lets me switch things on and off, immediately or
scheduled, and provides me with historical usage graphs. Which is all
I really want.
I've managed to get a PI to ask HA to turn my switch on and off, but
I've not been able to get the PI to read the data used to generate the graphs, which I'd like to be able to do. It would be useful to at least know if the switch is already on before I try to turn it on again !
Bonus points for being able to get the power consumption of the device
it is controlling.
Dunno if it relates to you, but I had a similar SSH problem.
I had a Gitea Container (a pretty UI git repo manager) needing to
reserve the standard SSH port for git to work, this took over the host
rPi host standard SHH port. My solution was to assign the Gitea
container its own LAN IP address using a Docker Macvlan network drive,
thus the Gitea container and the host rPI could each use the default
SSH port as they had distinct IPs.
Until installing HA, I've never (knowingly) had any dealings with Docker.
Try Domoticz, it is supposed to be much simpler than HA. Not as feature
rich as HA, but maybe a better fit for a simple home setup. (Caveat:
I've never used HA).
Docker is brilliant! If they had had it when I was working, I wouldn't
have needed to wear my brown trousers every release day, at least not
so much :-). Although, I'm sure the bright young things of today will
have introduced new complexity, so it is still easy to mess things up.
Nowadays, for me, it can make installing third party software simple,
as opposed to a nightmare of conflicting environment.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,015 |
Nodes: | 10 (0 / 10) |
Uptime: | 68:13:03 |
Calls: | 13,252 |
Files: | 186,574 |
D/L today: |
705 files (233M bytes) |
Messages: | 3,335,419 |