An OpenTherm (OT) thermostat controls a boiler with a 32 bits command.
This command is sent by Manchester coding.
There are a few topics about handling the code and the commands, e.g.
(all about interrupts)
Above helped me to make an Arduino controlled OT gateway, which is working fine.
For the final step in my home automation project, I need to control 6 OT thermostats (each room has its own thermostat).
At this point it becomes quite complicated, maybe some can help me out!
- with OT, the thermostat is master, the boiler (or now: Arduino) is slave
- there's no way to control the thermostat via Arduino: Arduino is only answering at questions of the master
- each bit (of total of 32 +2 start/stop bits) takes 1msec
- because of manchester coding, a level change could occur at 500 microseconds
- the thermostat is communicating once in a second
- within 800msec, the slave has to answer the master
- the slave MUST anwer the master (otherwise the master stops communicating)
Above was possible with one thermostat. But I encountered lots of problems with multiple (6) thermostats:
- each thermostat acts as a master, which means that different commands of different thermostats arrives 'mixed up' in Arduino (e.g.: when handling bit 17 of thermostat One, startbit of thermostat 2 is incoming).
- while controlling incoming commands, I have to generate an answer for the resp. thermostat, as well controlling the boiler and heating zones.
(- for even more fun, I have to calculate a parity bit for each command)
- finally, I need I2C to communicate with the rest of my HA (another Arduino, Mega). This means: in case of a Mega, only 4 interrupts are left.
Anyone has some ideas or tips? Is it even possible with one Arduino?