Smart switches++ (adding mains power to ZigBee sensors)

Hi all,

Apologies if this is stupid. It’s doesn’t seem so to me, but I’m looking for any advice/feedback you can provide, especially if I’m massively overthinking it/missing something simple.

Situation: I want to turn a fan on based on a humidity reading. No batteries for the sensors. I have a solid HA instance and good ZigBee network. Lots of sonoff gear dotted around the place.

Idea:

  • sonoff SNZB-02 or similar sensor (have a few spare), with a wired power supply (using a 240V to 3-5V box or similar, something like https://www.illuburg.de/en/produkt/ss5-4c700-700ma-4w/). ZigBee smart switch (sonoff extreme or something) wired into wall switch. Use HA to automate fan based on humidity readings.

Other thoughts:

  • I could take the opportunity to play with an esp32 board and use that to power and process data from a traditional wired humidity/temp sensor. But as this is likely to be buried in a wall I’m not sure this is a great first esp project. I did order for parts for a separate motion detector based project, but that’s another story.
  • it would be great if there existed a smart switch with an additional low voltage out, perhaps there is?
  • doesn’t HAVE to be ZigBee, but I have a solid reliable network and am happy to keep everything off my WiFi (don’t have the kit to set up an IoT vlan just yet)

Does the above sound reasonable? Is there a simpler/more elegant solution? Bathroom fan is already installed. Need to check how it’s wired, but can’t run the LV from this as generally not a great idea and also it’s at the mercy of the switch.

Thanks in advance for any feedback you have.