Rinnai Heating/Cooling Wifi Module

So WAP/Router has also been reset now…

New Logs: https://pastebin.com/P5t5f4NT

tldr; not much change…

Very odd. The plugin seems to be able to connect ok but there’s no status message being emitted from the module

I take it the app is still showing the cloud icon?

Yeah, sounds odd. @Rusti-gotrage - Is your WiFi network restricted in anyway? Are you using a VLAN, that is blocking broadcasts (UDP/mDNS, etc)? The initial UDP discovery seems to work but then subsequent communications time-out.

Try seeing if the module port is open from HomeBridge. Open and terminal from the top right menu and type curl http://moduleIP:27847 - The response should be ‘curl: (1) Received HTTP/0.9 when not allowed’ if it is open.

@David_M - Doing the Curl command in HomeBridge terminal have me no reply… it just locked up and kinda did nothing till I Ctrl-C’d out of it…

As for the WiFi network - I’m not running anything restricted… I’m running a TP-Link Archer C120 Wireless Router connecting to NetGear JGS516PE switches. The Homebridge container is running under Portainer on my R-Pi-3B.

Now - I DID have issues getting HomeBridge talking to HA when HomeBridge was running as a docker container on my NAS… don’t know why, but we did… I thought it might be due to the Pi running of a switch at the FRONT of the house and the NAS running of the switch at the BACK of the house - but… when I had the Pi plugged into the same switch as the NAS - it didn’t work then either…

But I’ve followed the instructions I found for allowing mDNS to work on the switches and still couldn’t get it to work, which is why I switched to running HomeBridge in a portainer session on the Hass-Pi setup…

@Mantorok - interestingly - since rebooting the route - the Phone App is no longer showing a cloud icon, but a WiFi icon…

Still doesn’t seem to have helped HomeBridge though…

/homebridge # curl http://xxx.xxx.xxx.xxx:27847
curl: (56) Recv failure: Connection reset by peer

Sounds like something is up with your docker network settings. Is the docker homebridge container network set to ‘host’ so it’s not NATing? Make sure you’ve fellow this fellow’s guide: Tutorial: add Homebridge to Hass.io using Portainer

There was - which is why I moved the HomeBridge set-up over onto the HASS-Pi using Portainer.
Once I did that, HA and HomeBridge were quite happy talking to each other - but now I have this issue with HomeBridge not talking properly to the Rinnai WiFi unit… :frowning:

Another thing you could try is use my client command line tool to test connectivity to the module. See https://github.com/mantorok1/RinnaiTouchClient. I wrote this some time before the plugin and it uses similar connectivity. Don’t worry about reading all the crap I wrote, just clone the repo and then focus on the “Demo - Simple Command Line tool” bit.

Perhaps try using it first from a PC and see if you can retrieve the status. Then try from the Homebridge command prompt.

Not had the chance to play with your script yet today @Mantorok
Hoping to get to it shortly. In the interim - I made the mistake of logging into the web interface for the unit, and now HomeBridge says THIS:

[8/25/2020, 1:53:11 PM] [RinnaiTouchPlatform] QueueService process { type: 0 }
[8/25/2020, 1:53:11 PM] [RinnaiTouchPlatform] QueueService connect
[8/25/2020, 1:53:11 PM] [RinnaiTouchPlatform] TcpService connect
[8/25/2020, 1:53:11 PM] [RinnaiTouchPlatform] TCP Connection: Failed. connect ECONNREFUSED xxx.xxx.xxx.xxx:27847. Attempt 1 of 3
[8/25/2020, 1:53:11 PM] [RinnaiTouchPlatform] TcpService connect
[8/25/2020, 1:53:12 PM] [RinnaiTouchPlatform] TCP Connection: Failed. connect ECONNREFUSED xxx.xxx.xxx.xxx:27847. Attempt 2 of 3
[8/25/2020, 1:53:12 PM] [RinnaiTouchPlatform] TcpService connect
[8/25/2020, 1:53:12 PM] [RinnaiTouchPlatform] TCP Connection: Failed. connect ECONNREFUSED xxx.xxx.xxx.xxx:27847. Attempt 3 of 3
[8/25/2020, 1:53:13 PM] [RinnaiTouchPlatform] Unable to connect to Rinnai Touch Module. Will try again in 1 minute

So - you know… it’s something new :stuck_out_tongue:
Will download nodejs shortly…

Ah yes, the dreaded ECONNREFUSED error.

To fix it you have 3 options (that I’m aware of):

  1. Reboot your WiFi router (this is how I fix it)
  2. Reboot the Rinnai WiFi module
  3. Leave it and within 24 hours the module will reboot itself

BTW, to avoid the ECONNREFUSED error make sure nothing else is trying to connect to the Rinnai module via WiFi. This is why I said shut down the Phone app.

Also, make sure Homebridge is shut down before using my NodeJS client tool

I find restarting the HomeBridge container seems to resolve the dreaded ECONNREFUSED error for me.
btw. THANK YOU Mantorok for your brilliant work on this !!
Loving it !!

Hey @Rusti-gotrage, did you manage to sort out the issue you were getting?

Regards
Mantorok

Morning @Mantorok,
Sadly no - and then work intervened and I had to take a break from working on it…
Should have some time this week to work on it.
As of this morning, I had to do a full restart of my HASS R-Pi3B due to a lock-up at around 2.18am for some reason. When it came back online, no more ERRCON messages, but I’m back to the TCP Connection Timeout messages…
And being a n00b, I’m unsure how to run your raw scripts :stuck_out_tongue:

I’m suspiciously certain that the issue may have to do MORE with mDNS working on my network than with your module itself… Given the HomeBridge initial connections seem to begin there, rather than being straight layer3 TCP/IP traffic…?

Especially given the issues I had getting HomeBridge to talk to Home-Assistant when HB was running from the NAS docker, talking to HA on the R-Pi3B… which I resolved by moving HB to the HASS-Pi in Portainer, thus removing my network equipment from the equation!

I’ve gone through all the documentation I can find for both my TP-Link Archer 1200 Router/WAP as well as the NetGear JGS516PE Switch and it SHOULD be allowing mDNS to pass through the equipment - and yet - here we are…

Interestingly enough, using mDNS Browser app in Chrome, I DON’T see ANYTHING from the IP the Rinnai unit is running on…

  • Shakes head * I dunno… Am feeling like a stupid person at the moment… it seems like it should be simple, but it’s just … not… working…!

[Edit: I AM a stupid person - my original post was looking at the IP the HASS-Pi/HB unit is running from! Sigh! Corrected!]

Version 3.0.6 of the plugin has been released. This fixes a couple of bugs:

  • If a TCP connection throws an exception or times out the connection wasn’t being closed which could cause the plugin and Homebridge to crash
  • If a status JSON blob contained a sequence number of zero the message was considered invalid and was ignored.

@Rusti-gotrage, that 2nd bug could be the cause of your issue. From your logs it was looking like the TCP connection was open but you weren’t receiving any status blobs. If you’ve never sent a command to the Rinnai module (eg. from the Phone app) then the sequence number may be zero.

Ooookay… so at some point in the morning HB decided to restart itself, so I had gone from “TCP Connection: Failed. TCP Connection timed out” back to “ECONREFUSED”…

So I did the update to 3.0.6 and it still said “ECONNREFUSED”

So I rebooted the entire HASS-Pi system (including the HB Portainer).
The system came back online and HB was STILL saying ECONNREFUSED.

I checked the phone app for the Rinnai and it was showing the cloud icon, so when my wife was away from her PC making Hot Chocolate (ie; wouldn’t notice the internet dropping out), I rebooted the Router/WAP…

Now I’m back to “TCP Connection: Failed. TCP Connection timed out.”
And the phone is STILL showing the cloud icon :frowning:
As a note: every time I exit the phone app, I’m jumping into the App Info and FORCE STOPPING the phone app so it’s not also communicating with the Rinnai unit…

OMG… it just did something!

ok - So it seems to have connected, grabbed a whole stack of data, then gone back to it’s old behaviour…

BUT - it DID connect!!

So I’m quietly rapt to the back teeth! It’s PROGRESS!! :sunglasses:

[Update]
So it’s connected about 6 times all up in the last 75mins…
Noticed an interesting line in the last connection:

“(node:1999) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 updated listeners added to [RinnaiTouchService]. Use emitter.setMaxListeners() to increase limit”

@Rusti-gotrage, that is looking more like it. I think that during the discovery phase it added and removed a bunch of accessories which caused it to hit a limit on the number of event listeners. Maybe I should increase the limit?

Try restarting Homebridge and see if it clears the error.

@Mantorok - I changed the connection settings too… to “-1” - never close connection! :stuck_out_tongue:

That seems to have done WONDERS for it… now it’s going like a fire-cracker!!
:partying_face:

Interestingly, it’s NOT reading the CURRENT temperature from the system…?

Now I just need to figure out why Home-Assistant isn’t picking up the new device/entities in MQTT…