Bedrock's Home automation Project

I think it about time to start a discussion on my home automation project.

I got into automation sadly after i finished my renovations, but when im handy with a hammer who says i cant fix it afterwards :joy: i loved the way @jon has done his light switches so i decided to use his base design and expand on it to make it work for my needs.

i started with getting the lightswitch controller working on the bench. the code im using is 95% Jon’s,

turns out im not that excellent on using a dremel so i plan to stop off at my local metal cutting place and get them to water jet cut my new face plate.

then i recieved my biggest order yet from @freetronics

from here i got my relay controller working, and let me tell you that was a royal pay in the backside,

node red is really nice to use make setting all this up really easy but trying to work something into it that hasn’t really been done before(or at least none that i could find) but this is what 1 relay/light looks like,


the basics of this is openhab publishes to MQTT when the status of the light changes, but because i have a stateless switches i dont care for the value OpenHab is giving me so i set the value to the same as the light switches in this case 20-41 it then publishes to the topic of buttons.

from here i take that and run that into a java script rule engine using a sub flow that takes the msg.payload and then will change the state depending on the last known value, either 0 or 1 i needed to add a delay for 50ms for some reason i cant figure out it then takes that value and publishes that to 2 different MQTT topics 1 is the state topic to update the state in OpenHab the other is the relay topic in this case “Relay1”

after several hundred lines of code that is working and making a custom shield,

I plan on making a pcb for this but gotta start somewhere. i took a piece of advice i red on a topic jon commented on about having a jumper for the WatchDog for when your working on the code, and added a jumper in

now that all this is working, im starting soon on getting the new switchboards in and the electrician is coming in about 2 weeks hopefully.

4 Likes