I’ve spent many hours in NodeRed building status polling flow and then using that to hack it together a Generic Thermostat. So much time i could have just written a custom component 10 times.
So, over the past 2 days I’ve bee looking into the possibility of a custom component. and well…
I think HA makes too many requests and the Touch device automatically bans it. - I never faced this issue with NodeRed.
Now, maybe I can get past this … but
I once wrote code for a living but that was 12+ years ago.
I’m more than likely moving to Singapore within a month or so.
My real-life paying project goes live tomorrow.
I need some serious help with Python. I like it, but i’m no programmer remember
I must admit, between the custom climate component I found GitHub, the great work done above and the developers.home-assistant.io website it hasn’t been that difficult. I just wish I had the correct development environment.
The Climate entity doesn’t support Zones. So I suspect we would need two components:
Main Climate component
Switches for Zone control
Give me a week or so and I’ll do my best to be in a position to share my code. I will not be in a position to support or maintain it. But hopefully someone else can keep the ball rolling.
Hey Jason - cool work! I’d be happy to keep working on it if you can get the component “framework” going; that was where I kind of gave up. I also was once a software developer
As for Home Assistant not supporting climate zones, I’ve noticed Apple Homekit and Google Assistant don’t support multiple zones either. My suggestion would be to have a seperate climate component for each zone. That way the zones can just be named ‘Upstairs’, ‘Downstairs’, etc which will work well for Apple and Google. As for the Home Assistant UI a switch system would be great or eventually a modified multi-zone component.
I think I saw a video of that somewhere recently … maybe a Lovelace “showoff” vid on Reddit? They could click on a zone button, and the thermostat view would change to that zone
I’ll start off by saying I haven’t actually touched Home Assistant at all, however this thread has been a huge help - especially with the work that @FrontBottom put in.
Off the back of that, I’m trying to build a Homebridge plugin to interface the Python code as a proof of concept. It’s probably not best practise to have NodeJS executing Python code, so it’s something I intend to get around at some stage soon. The Homebridge plugin seems to turn on & off the Rinnai unit, change the temperature and the mode. It’s buggy, but the basics are at least in place. Code for that is at https://www.npmjs.com/package/homebridge-rinnai-touch (corresponding GitHub link is attached there)
With regards to zone control, after having a think I’ll be creating zones via switches as they should adequately perform the functions we’d expect there.
So a big thanks to everyone here who has slaved away at trying to reverse engineer the Rinnai Touch unit. It seems we’re definitely on the right track now!
Awesome stuff. This is the first time I’ve ever put any sort of code “out there”, so it is great to see it being built on (I also appreciate the attribution in your repository ). With your and @jsn.forsyth work, it’s given me a bit of a push to move things forward. Since I published those gists I have made some reasonable changes , so I’ll aim to incorporate your changes Andrew into my code base and re-publish as a proper git repo.
@jsn.forsyth - should we consoildate your code base too ?
I 100% agree we need to consolidate our efforts.
My thinking is… the immediate objective is to build a minimal viable product as a custom component. The scope of which (I propose), is to poll the touch device for status in order to have a semi-working thermostat in HA. This will serve as the technical template that we can all debug and improve into a full blown solution.
Just to reply to myself - @andrewgould - I’ve updated those Gists. Up to you if you want to work that back into your code. Effectively I’ve added your Cooling handling back into my latest code.
Probably best if we’ve got it in a shared repository so we can have it under proper source control (gists don’t quite count in my books).
As the code came from you anyway I’ve given you access to my Python repository, and anyone else seeking to contribute can submit pull requests.
I’m definitely intending to take my work further on the Homebridge plugin – and have an active JS fork of the Python code – but that’s not to say that any efforts here should cease. Shared backends between Home Assistant and Homebridge will be essential.
The more work that’s put into this, the better. I first asked Brivis about a wifi interface in January 2017 (and was super keen for HomeKit support), and this thread has seen the foundations necessary for third party support.
Everyone that’s contributed here should be really proud of themselves.
The above image shows two Home Assistant tasks running simultaneously (SyncWorker_16 & SyncWorker_30), one task doing a status update and one attempting to set the HVAC mode to COOL.
These simultaneous connections cause the device to block further requests. Only fixed by a touch reboot.
I don’t really have the time nor the python knoweldge to ensure only 1 connection is made.
Most of the code relates to error handling, debug logging and sleep comments in an attempt to not preform simultaneous connections.
Don’t use the app or at least turn off wi-fi so HA and the app don’t both attempt simultaneous connections.
My move to Singapore has been confirmed, so I doubt i’ll spend much time on this going forward. I don’t really want control, i’m more after device status which it more or less does.
Thanks it works when I include http in the IP address like ‘http://192.168.1.1/’
I think it connects but then disconnects straight away -
2020-02-03 20:10:53 DEBUG (SyncWorker_15) [custom_components.rinnai_touch_climate.climate] Socket created
2020-02-03 20:10:53 DEBUG (SyncWorker_15) [custom_components.rinnai_touch_climate.climate] Error connecting to server: [Errno -2] Name does not resolve
Strange, when I enter the IP without http:// I just get this error -
Error while setting up platform rinnai_touch_climate
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 158, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/local/lib/python3.7/asyncio/tasks.py”, line 442, in wait_for
return fut.result()
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/rinnai_touch_climate/climate.py”, line 85, in setup_platform
config.get(CONF_PORT))])
File “/config/custom_components/rinnai_touch_climate/climate.py”, line 256, in init
self.update()
File “/config/custom_components/rinnai_touch_climate/climate.py”, line 285, in update
airconMode(self, hgom)
File “/config/custom_components/rinnai_touch_climate/climate.py”, line 205, in airconMode
if len(gss) > 0:
TypeError: object of type ‘NoneType’ has no len()