We built a new house six years ago, and I put in insane amounts of conduit with Cat6 cables. There are at least one Cat6 to every physical lightswitch for example. Then, I put in a few Arduinos to control stuff, with the intention to make that smart when I got around to it, and now six years have gone by and I’m just getting started. A home is never finished
I have for example two Arduinos controlling light, one is for toggleable lights, the other for dimmable. I figured, I’ll just start with the first to understand how that integrates. The concept I’d like to keep is that one device is responsible for its own operations, it shouldn’t rely on another computer for basic operation, if someone hits a switch, the lights should turn on or off. So, the idea is to add an interface to the Arduino so that it can be integrated in HA. I’m not sure how to do it though, as it appears that the complexity is greater than what available Firmatas can do (though the protocol seems interesting).
Currently, when someone hits a switch (they look like normal switches), a circuit is closed, and that is then registered by an Arduino Mega. To one output pin, I have attached three 8-bit shift registers, so I send a 24 bit number there. This was needed, because not even the Mega has that many pins to allow both >24 inputs, 24 outputs and Ethernet shield.
Currently, it doesn’t have an interface to anything over that Ethernet shield, so I need to change that, as I write an integration for HA.
I went through the Firmata documentation, and it didn’t really get me started, mostly because my device is both a sensor (I need to read the status of the light) and a switch (I need to toggle the light), and there’s no direct mapping to a pin. So, any pointers on how I can get started integrating my own devices would be greatly appreciated!