Now I've got the heatmiser component working with home-assistant, I want to ready a v2 release which will enable it to also work with other devices other than just heatmiser thermostats.
There are two categories of component:
- Master - the UH1 device, which is the serial interface from the home-automation system to the thermostats.
- Slave - currently just the thermostats, but will also be timing switches, humidity sensors .etc
Currently the system is setup as below in heatmiser.py, with the interface to the serial port set in the setup_platform() method of the heatmiser interface:
As you can see, I've left the hot water out. Because the serial port is held open my heatmiser.py there's likely to be a contention issue.
What I'd like to do is split the UH1 serial port out into a separate component, that opens up the serial port and makes it available to other components, I'd then set the UH1 component as a dependency of heatmiser.py. I could then create a switch device for heatmiserHW.py to control the TM1 timing box. This solution would look more like:
The final option is that I simply add the hotwater device as part of the heatmiser component, - i.e. create a new class for TM1 in heatmiser.py that doesn't have the Thermostat base class, but one of a switch. The thing stopping me from picking this option is the folder structure. heatmiser.py currently lives in components/thermostats/ - and if I were to add a switch class in here it could start getting messy.
Advice please :)