I'm still fairly new to Arduino, having just played around with some simple circuits so far with an Uno. Now I'm trying to figure out whether what I want to do is feasible, before dropping the coin on the new boards needed to support this project.
I want to Homekit enable my fireplace, but not in the same manner as every other reference I've found on the internet. Like many others, my fireplace is controlled by a wall mounted switch, connected to the Millivolt system generated by the thermopile. Most people who have enabled their fireplaces have either:
a) Replaced the fireplace switch with a relay, disabling the switch from working
b) Added a relay in parallel to the switch, which means the method that turns on the fireplace has to be the same one that turns it off.
In my house, neither of these would generate a good user experience for my family. For instance, if somebody walks by and flips the fireplace on from the switch when entering the room, then, when they want it shut off they'd have to go back to the switch instead of using voice commands. Similarly, if they were all snuggled in watching TV, and wanted the fire on and used a voice command, they couldn't then just hit the switch on the way out turning it off.
The existing HomeKit switches we have in our house (Leviton Decora Homekit ones) provide a 3-way type of behaviour. I can hit the switch walking by, and then ask Siri to turn it off, and vice versa. I can't use a smart switch with a millivolt system obviously, so I want to see if I can recreate the same behaviour in software in an Arduino, controlling a relay, and have the wall switch connect to the Arduino instead. There's no mains voltage at the switch, it's just a switch loop from the thermopile and gas valve, so I don't see there being an issue with the hardware side of things. (Other than one question I'll get to further on down.)
My issue is, I'm not familiar enough with how HomeKit is implemented. I've found various libraries for ESP32 and ESP8266 that supposedly can be integrated with the Arduino IDE, but since I only have an Uno on hand currently, they're not ones I can test out yet. What I want to know is if these kinds of libraries support this flip/flop approach I'm attempting? I'd like to be able to effectively have the state of the relay represented in Homekit, and to be able to change the state of the relay from either a Homekit command, OR the fact that whatever GPIO pin I connect the switch to goes High/Low accordingly. Ideally, hitting the switch will either turn on or off the fireplace, depending on the state of the relay and the state of the switch. Like, if the fireplace is currently off, closing the switch will turn it on. Or, if the fireplace is on, closing the switch will turn it off.
Secondly, on the hardware, what type of board should I be looking at for this implementation? The libraries I've found are for either the ESP32 or the ESP8266, but I'm not familiar with them (yet). Do they essentially work similarly to my Uno, just with less onboard features?
My thanks for any feedback.