Home made hardware (sensors, actuators)?

Hi, folks,

Most of the talk here is about commercial hardware and how to connect it to HA. I build custom sensors and actuators and would like to connect them to HA… Obviously, I can use whatever protocol, but most of my sensors use a version of arduino and Xbee for communicating with a RPI which also has an Xbee plugged in via a serial port, currently using my own custom protocol and custom SW on RPI. This is what I would like to change.

The question is where could I find the communication protocol definitions so that my custom HW could send messages to and receive responses from HA?

Thanks,
Klaus

Best bet is to use MQTT

1 Like

Right, but I can’t put MQTT on the remote arduino…

Let me give an example… Let’s say I have a rain sensor on the roof with an arduino and XBee. When the rain starts, the arduino sends a custom message via RS232 to Xbee which transmits it wireless to the other Xbee which in turn passes it to the RPI via RS232 again. The message must be in a format that could be processed by something on the RPI. The message consists of sensor identifier, status, version, etc etc… I need the definitions for these messages so that HA understands them…

1 Like

What sort of rain sensor?

If it’s just a tip bucket or resistive sensor it would be easy to cut the complexity. Use mqtt over wifi. Use an ESP device (D1 Mini or NodeMCU-32S are good choices) running esphomeyaml.

You can compile and install the butload of modules direct from the Hassio addon. Configuration is in yaml. Supports over the air updates and HA discovery.

If it’s a piezoelectric rain sensor it might be a bit trickier.

Hi,

I’m sorry, I know I can replace all devices, but this is not the point… I’m thinking about the change of the core RPI with one running HA. And the only reason to actually do this is because I’d like to add one or two commercial devices into the network.

So again: the question is how to make my devices (which talk RS232 and not IP) talk to HA, not to replace everything.

Thanks

You can setup MQTT on the raspberry pi and pass xbee message to the MQTT gateway…

Edit: use this? https://github.com/angryelectron/xbmq-js/blob/master/README.md

1 Like

No need to be at all. Please forgive my misunderstanding.

Excellent pointer! Thanks for it… going reading :slight_smile: