Recommendation for a protocol to implement for a custom lighting controller

Tags: #<Tag:0x00007fc91070a860> #<Tag:0x00007fc91070a478>

My house built 1960c. has a lighting system done by Touchplate that was probably the cutting edge in its day. It still works just fine, no real complaints. I recently have figured out how to hijack the system to allow for web-based control of it via an Arduino and some relay boards. I would like to control this from openHab but before I go about creating a custom thing I figured I’d ask if anyone would have a recommendation on a way to do this. My thought is I would like to re-implement an existing, standard protocol so that I just need to adapt the existing protocol in to my specific needs (1 device with 24 lights). This way open hab would just see my device as just some generic device it already understands rather than creating my own thing. Any thoughts?

What functions do you want to communicate about?

For the must part people use MQTT for something like this. But the best is going to depend on your answers to rossko57’s questions.

Cool can you describe what you have done so far?

I have http://www.banggood.com/Geekcreit-Mega-+WiFi-R3-Module-ATmega2560+ESP8266-32Mb-Memory-USB-TTL-CH340G-p-1205437.html

For similar tasks

From my understanding of Touchplate is each control point is a momentary toggle to turn something on or off.

You could interact with the REST api of openHAB directly.
You could use MQTT
You could connect the serial of your Arduino and use the serial binding.

Dose the relays toggle the signal or are you using it to run the light.

As you suggest its a hijack I will assume that you are using it to toggle the switch. It was an awesome idea to post here to get advice. Stop doing it that way and start thinking about all the functionality you want to have on the system.

Lets look at a light
I want to be able switch the light to a state eg “Turn the light off” Weather it is off or on it will end up being the off state. I you only have toggle control you have to try and remember if the light is on or off somehow it can be done but it is a pain.

MQTT would be my choice with the https://homieiot.github.io/ standard if I was to start from scratch.
That way all you have to do in openHAB is setup a bridge and everything should show up in your openHAB inbox

@rossko57 Since these are just switches not dimmers, the only actions I care about would be on, off, and toggle. And then of course reading the status of the lights.

@denominator you are correct. It uses “low voltage” (they are actually 65vac, high enough to spark, I wouldn’t consider that low voltage).switches to toggle latching relays. So I have a relay board that the arduino actuates for 250ms which I found to be the most reliable simulation of a button press. On the mains side I use a set of optocouplers to detect whether the light is on. This gives me both sensing and acting so I can actually have definative “on” and “off” rather than just toggle. I’m tracking with what you are saying about turning the light on and off, I’ve run into that issue before. Rest assured I’ve got that aspect of in sorted.

It sounds like MQTT is certainly general opinion. I’m familiar with MQTT, the light weight message broker. Though I haven’t used it before. From what I am reading with homieiot it sounds like it will explain to openHab both what the device is, and what all functionality it has yes?

Yes that is how it works.

Its simple if you can understand it. Its simple ON/OFF commands

Only let your Arduino publish to the STATE topic

Alrighty. Thank you for the guidance I will go study up on MQTT and Homie. If I run into any snags I’ll give you a holler.