Since i dont have a neutral wire in my switch, i have decided to install a shelly on the other end of the wire, near the fitting.
However, i have a question about this. I have a switch that switches on/off two different fittings. I will need to install a shelly in both of them i assume
The question is… Would it work well with HA? It will need to switch on/off two switches at the same time, which i understand can be done, but, would it add any latency or could i have any other problem?
You’ll probably find the switch wiring goes to one of the fittings, and the other is a spur off that. You should be able to wire the Shelly in the fitting that the switch wiring goes to (subject to space: see below), and that will operate both lights.
Please be super careful with mains wiring: if you weren’t already aware with how it’d be wired, you might get a surprise when you open the fitting — if it’s a UK ring circuit with the ceiling rose as the connection point, there will be a lot of wires in there and not much room for a Shelly:
Thanks for the advice. I thought it might work with only one relay but i needed to check
The other option i have is installing a wire cable to the switch, but i dont know how difficult it would be and if it would fit in the switch box, as i think its smaller. Would it be a better option?
Without seeing inside the boxes, there’s no way to tell. For example, if this is an older house you might have separate junction boxes (see link under the wiring image I posted) so accessing the rose wouldn’t help. If it’s an upstairs light and you have access to the loft, things become much easier.
Cut the power (and make certain you have!), open up the fittings and have a look.
It’s likely to be hard to run a new cable to the switch. Most house builds will have the cable pinned behind protective metal conduit, and you won’t be able to pull a new wire through without open-wall surgery.
Last question, slightly related to this. I want to add a PIR motion sensor to this as well. Do i need to physically attach that to a wire? I have seen some diagrams where this is needed
My installation will be shelly - home assistant - PIR Motion sensor and i was not expecting to have the PIR motion sensor connected to any wire. I was expecting it having a battery and talking to the shelly switch via HA
Exactly this. The whole idea of HA is it connects everything. For example, I have a Shelly-like homemade device controlling a table lamp in my hall. Whilst I’m waiting for the bits to arrive to build a light sensor, I have an old Android phone sitting on a windowsill running Sensor Node Free and reporting light levels to HA over MQTT. I’ve defined the sensor, and use a front-end input_number with a couple of automations to switch that light based on light levels if the house is occupied or sun-up state if we’re out.
When the new sensor is up and running, I just need to replace the phone’s MQTT sensor definition with the new one that’ll be coming in over ESPHome API, and the table lamp will be switched using a “real” sensor without touching any of its connections.
Same goes for your PIR or whatever else you connect to HA: these are all inputs, and you get complete freedom in using those inputs to influence your outputs (e.g. the Shelly-switched light).
So i get that i dont need to have the Motion sensor connected to the wire, right?
My use case is to have a motion sensor that talks to the shelly switch via HA and switches on/off the lights.
I also want to have a functionality to disable the Motion sensor, so i can manage the switch from my mobile
Looks similar to what you are doing
My next question would be… is it better to build your own ESP32 motion sensor or buy one and connect it to HA? If the answer is to buy a new one, are all the sensors compatible with shelly?
The motion sensor should be completely separate from the Shelly, yes.
Whether you build you own or buy one is your call. It’s HA compatibility you need to care about — the Shelly is just one of potentially many output devices that your HA install can operate. HA is informed by the sensor that there is motion, and your automation tells HA to switch on the Shelly as a result.
Another example: houses with gas central heating traditionally have a room thermostat hard-wired into the circuit to switch the heating on and off dependent on temperature. I’ve built my own system: I have a sensor in my hall that reports the temperature over wifi (ESPHome) to HA, which in turn operates the relays in the heating controller (also DIY ESPHome over wifi) appropriately. All connections are to and from HA.