I want to control a lamp with Raspberry Pi and a relay. However, I want a single power line to provide power for Raspberry Pi and the lamp.
How can I do that? In other words, I want to construct a WiFi lamp with Raspberry Pi, a relay, and a lamp.
If this is a table lamp and you have access to both the UNSWITCHED active and neutral wires, then you can splice in a small power supply to supply the RPI. The RPI relay then switches downstream of the power supply mains input. As said by others, make sure its an appropriate power supply and the mains wiring is done safely and correctly.
I do not want to reflash a device. Is there a WiFi bulb that I can control without a special vendor software and without reflashing?PhatFil wrote: ↑Wed Apr 17, 2019 4:47 pmMost 'smart' devices based on esp8265/6 wifi socs can with varying ease be reflashed with alternative firmware. Tasmota being a Very popular and fully featured option. - smart sockets advertised for use with an app called "smart Life" or "BrandName-Life" can CURRENTLY, be reflashed OTA without any physical mods or opening of cases.. (Google "Tuya-Convert" for the github repo and utubes detailing the process..)
so spend a fraction of the cost of a 240v ac safe Pi case psu grommets etc needed to make your oringinal proposal safe on 1 x smart socket.
reflash it, host a mqtt broker on your pi and then use any mqtt interface for easy control, use node-red and the alexa-local node for hassle free local alexa control etc..
not as far as i am aware..