OpenHAB, 230V Relays and external Switches
I'm new to this Forum. I came across mysensors when I started homeautomation with openhab, homematic (german vendor for radiobased actors/switches and dimmers) and mqtt. We are going to expand or apartement and I'd like to add the new rooms into our openhab but without the need to user propreatary components like homematic. I'd like to use arduinos controlling the relayboard and with the serial gateway or mqtt connect them to openhab. Where I'm a bit out of knowledge is the part if I get the relay state for openhab, if I connect a external lightswitch, to switch the lights and sockets. I thought about using a hall sensor for every relays but that is going to be a bit to much I think. Is there a way to get the state directly or am I missing something?
Thanks a lot!
drock1985 last edited by drock1985
Sounds like a fun project you have ahead. I don't use Openhab personally but I do use the relay+actuator (button) sketch for a lamp that I made some time ago. The light switch will show up in your home automation controller as a binary device (on or off, 1/0) and you can send and receive messages from there. You can also connect to the same Arduino a push button switch (ex. Tact button) so that you can toggle the switch physically instead. Pressing the tact button will also update your Openhab status accordingly.
Also make sure for whatever relay you use to observe safe habits when working with mains voltage. I've seen some people have power supplies on this forum fry over time, and that would not be a good situation if you are doing a large amount of these.
Also check out the openhardware.io subforum and website. There are a few users who are already working on such projects like this, and many that will work in commercially available fixtures that you may want. Ex. https://www.openhardware.io/view/77/AC-DC-double-solid-state-relay-module
thanks a lot for the info and the hints to the two solutions you posted.
They look pretty amazing.
I'll order the hardware and keep the threat updated with some pictures and a discription of how I set our house on fire :).
The installation itself is going into the distributionbox of the new building part. As PSU I thought of something like this:
The link is meant to be any advertisment, it's just where I started looking for things.
And as Case for the board it is going to be something like this:
and for the raspi running openhab, homematic and mqtt:
The plan is to have an almost industry like installation, but lets see where I end up
Again thanks a lot.
drock1985 last edited by
Seems like you are on the right track so far. Keep posting with updates/"fire calls" j/k, always enjoys seeing how other people's projects turn out.
Good morning guys,
I got my first test setup yesterday. I didn't go with my initial idea to have the a pcb behind the wallmounted switches but to have everything centralized.
My setup uses a raspberrypi with a script monitoring the GPIOS and sends/receives mqtt messages to/from my broker. So I'm able to tell openhab the current state of the relay and to send commands via openhab and to use multiple raspis and/or arduinos to add relay boards. Even if openhab fails I just need the raspi/arduino to work to switch my lights/sockets. Even if my pi fails I'll be able to switch the relay locally via a switch I'm going to build into the DIN Rail case. And if the relayboard fails I better have a torch :).
Im getting the rest of the components today, as soons as I got everything mounted properly I add some pictures.
So, it's been quite some time. The apartment is done so no more construction work. But I ended up changing the whole setup. My initial setup with pi zeros dind't go so well. It worked 90% of the time but sometimes the relays would bounce although I had them debounced (well I guess not that good) and with the whole cabeling I built an antenna, that started switching whenever some one walked through the room, so back to the basics, added opto couplers an rc's so the antenna behavior was gone, but everytime I pluged something in or out of the 230V Sockets some light would turn on or off. As my wife started to question the whole project I didn't bother to check if the power regulator of the pi was a mess or whatever the problem was. This is yet to be investigated. I bought the eq3 RX/TX boards. connected them to the relay board and the light switches and it works. It's great that I have a working solution but it's sad that it isn't my solution. I add some pics so you see what my Idea looked like.