Rinnai Heating/Cooling Wifi Module

Could it be because the manufacturer and model are the same for each accessory in Homebridge so HA is trying to create a single device with multiple sub entities rather than multiple devices?

Either the manufacter or model must be coming from the docker container hostname, which I had to set to be the same as the hass.io hostname (homessistant), as I was getting an error using anything different. Iā€™ll try setting it to be something different and troubleshoot the container error and see if it populates the manufacturer or model differently.

Cheers,
David

The plugin populates the manufacturer and model with hardcoded values (ie. Rinnai & N-BW2) for all the accessories. I could change it so that the model is unique for each accessory if you think it will help. Maybe it will then create a HA device for each of the pluginā€™s accessories rather than trying to group them all under the one device

Have you tried removing the fan by setting showFan to false in config.json? Just to see if the fan is the cause of the error

So it looks like there are two issues. I set the showFlag flag to false, which stopped the HA error related to HK_DIRECTION_TO_HA - So maybe if you could hard code a value we can test that out.

The integration still only imports the controller and one accessory which is now the AdvanceSwitch. However, it looks like it is a known issue with HomeBridge:

Platform homekit_controller does not generate unique IDs

According to this, each accessory needs to have a unique serial number.

Cheers,
David

@Mantorok - I updated my local index.js to generate a random serial number as per the following:

.setCharacteristic(Characteristic.SerialNumber, Math.ceil(Math.random() * 10000));

After doing this, all the accessories successfully get imported in to Home Assistant. The fan is still busted, so I tracked down the fan.py the error references


# 0 is clockwise, 1 is counter-clockwise. The match to forward and reverse is so that
# its consistent with homeassistant.components.homekit.
DIRECTION_TO_HK = {
    DIRECTION_REVERSE: 1,
    DIRECTION_FORWARD: 0,

I tried seeing where we could force the value in your code, but that was beyond my skillsā€¦

There does also seem to be something odd going on with the zone status refresh in HomeBridge. Zone A is always Off when HomeBridge is reset. And Zone A/B/C seem to change their last setting when switching between Heat/Cool/Fan. Iā€™ll keep an eye on this. There might be some sticky config somewhere.

Cheers,
David

Great work David. Iā€™ll change the plugin so it will generate a unique serial number for each accessory. I thought the fan issue may have something to do with the direction so Iā€™ve already made a change to set a value for it.

Iā€™m not sure what could be causing the Zone A switch always being off after resetting homebridge. Does this happen for iOS devices as well as Android?
You could try turning debugging on and look at the logs to see what the status is reporting for Zone A.

Iā€™ve just released a new version of the plugin which should (hopefully) help with some of the HA issues mentioned above. It also adds some stability improvements when sending commands to the WiFi module.

@David_M, please let me know how it goes.

Fantastic! From my intial testing, I can confirm that a) Fan accessory is imported successfully, and b) Toggling between Heating/Cooling and the Fan is successful.

@Mantorok - Thanks for your help with this. Itā€™s not a direct HA integration, but it seems to work quite reliably. There is a entity sync delay in HA when toggling the accessories with HomeBridge (sometime up to 30secs), but from what Iā€™ve found, it looks like it might be a common issue. Seems to work perfectly within the HomeBridge portal itself.

From what I understand the Rinnai Touch publishes the current temperature to the wi-fi controller, but becaue Iā€™m using a Networker NC6, the temperature remains 0c. Is this right?? If so, itā€™s not ideal,but its only informational and I can get this info from a separate sensorā€¦

Cheers,
David

Thatā€™s great news, glad itā€™s working better now

As for the NC6, does the controller itself show the current temperature on its display? If so it should be in the status that is output by the wifi module. I believe @mitchmario also has this controller (2 in fact) and it shows the temperature for him

Check a sample of your moduleā€™s status json blob to see if itā€™s in there. Itā€™s usually the value associated with key ā€œMTā€ (value is 3 digits). You may just need to enter a mapping override in the config.json file to fix it

Thanks, @Mantorok.

Unfortunately the mobile app doesnā€™t show the current temperature either. Iā€™ve just checked the MT value and it is always 999. No other values look like they represent whatā€™s displayed on the LCD (22c).

('[{"SYST": {"CFG": {"MTSP": "N", "NC": "00", "DF": "N", "TU": "C", "CF": "1", "VR": "0183",
 "CV": "0010", "CC": "043", "ZA": "                ", "ZB": "                ", "ZC": "    
            ", "ZD": "                " }, "AVM": {"HG": "Y", "EC": "N", "CG": "Y", "RA": "N",
 "RH": "N", "RC": "N" }, "OSS": {"DY": "SAT", "TM": "23:35", "BP": "Y", "RG": "Y", "ST": "N",
 "MD": "H", "DE": "N", "DU": "N", "AT": "999", "LO": "N" }, "FLT": {"AV": "N", "C3": "000" } 
} },{"HGOM": {"CFG": {"ZUIS": "N", "ZAIS": "Y", "ZBIS": "Y", "ZCIS": "Y", "ZDIS": "N", "CF":
 "N", "PS": "Y", "DG": "W" }, "OOP": {"ST": "N", "CF": "N", "FL": "00", "SN": "N" }, "GSO":
 {"OP": "M", "SP": "20", "AO": "N" }, "GSS": {"HC": "N", "FS": "N", "GV": "N", "PH": "N", 
"AT": "W", "AZ": "W" }, "APS": {"AV": "N" }, "ZUO": {"UE": "N" }, "ZAO": {"UE": "Y" }, "ZBO":
 {"UE": "Y" }, "ZCO": {"UE": "Y" }, "ZDO": {"UE": "N" }, "ZUS": {"AE": "N", "MT": "999" }, 
"ZAS": {"AE": "N", "MT": "999" }, "ZBS": {"AE": "N", "MT": "999" }, "ZCS": {"AE": "N", "MT":
 "999" }, "ZDS": {"AE": "N", "MT": "999" } } }]',options)

Oh ok. If it doesnā€™t show in the mobile app then the plugin wonā€™t be able to display it either. The plugin will look for an MT value 999 and return null which Homebridge interprets as 0.0c. You could try contacting your supplier or Brivis/Rinnai and ask why the current temp is not showing in the mobile app. It could just be service config option on the controller or something.

An enhancement Iā€™d like to add to the plugin is to sync the time on the controller with the host machine the plugin is running on. I find the internal clock on my controller is fast so Iā€™m always adjusting it to the correct time.

There was mention by @FrontBottom in an earlier post of an STM command for setting the day/time which Iā€™ve tried to get to work but with no luck yet.

@mitchmario posted instructions (see post #36) on how to disassemble the Android APK file but its for Windows and I use a Mac. Does anyone still have a copy of the code that relates to the STM command that they can post somewhere?

I no longer have the files but you can recompile it on mac with these instructions. It would be great to have the time synchronised!

Thanks @mitchmario. I managed to disassemble the APK file and access the API.dll and found the following code:

    private void STM_ObjectsSetup(CCommandInterface commandInterface)
    {
      commandInterface.AddGroup2Item("SYST", "STM", "Networker Clock Setting");
      this._STM_DY = new CDataDay("DY");
      this._STM_TM = new CDataTime("TM");
      this._STM_SV = new CDataBool("SV", "YN");
    }

It appears that in addition to setting the Day and/or Time you also need to send a ā€œSaveā€ command. However, I tried doing this in various ways but it still wouldnā€™t update the day/time on the controller. Hereā€™s an example of the commands I tried:

N000001{"SYST":{"STM":{"TM":"03:00"}}}
N000002{"SYST":{"STM":{"SV":"Y"}}}

I suspect my controller doesnā€™t support setting the day/time externally which may explain why this feature doesnā€™t exist on the mobileā€™s TouchApp and why thereā€™s no STM key under the SYST key in the status json blob.

For anyone trying to get the thermostat working in Home Assistant via HomeBridge, it looks like the homekit_controller integration only works synchronously, and thermostat and zone states will only be updated every minute, which is what Iā€™ve observed with the debug logs on.

There has however been a redevelopment of the integration for the last six months and has a pending release. The new code will cater for asynchronous state updates. Some info below.

https://github.com/home-assistant/core/issues/26532

Hey Guys - Iā€™ve got nothing useful to add here :slight_smile: Looks like you are on the right track with the code extract. i canā€™t remember if I played around with it at the time or not. The command string yourā€™ve created looks about right. Did you also try ā€œSTMā€ for setting day? Iā€™m not sure if it wanted a string or ENUM (integer) for the day

Thanks @FrontBottom, yes Iā€™ve tried "STM" for setting day (both with 3 letter and integer) but no luck. Also tried "CFG" which also contains the day and time but couldnā€™t get it to update the controller either.

Does the Android Rinnai app allow you to set the day and time of the controller? I use the iPhone one which doesnā€™t have that feature.

Iā€™ve only got iPhone too. Iā€™m guessing that since it doesnā€™t let us set it by that App, it isnā€™t possible for our kind of controller. I assume there is some sort of controller that allows setting date/time

For me, I donā€™t even have date/time set correctly on my controller, so in the app it ā€œcorrectlyā€ shows the random date/time I have set on the controller ā€¦

Hey @Mantorok - Have you considered writing some MQTT support in to your project? While it is something that will help with HA integration, itā€™s also something that might help with others trying to integrate their Brivis HVAC with the various home automation controllers out there by using a common protocol.

With your plugin Iā€™ve been able to create a node-red flow to control our Brivis ZonePlus 516 module based on the presence of family members. When I upgraded the system to have a cooler addon with zones I had to give up using an Ecobee with smart away features, but now Iā€™ve been able to replicate it somewhat, with even more potential, which Iā€™m pretty stoked about.The next neat Ecobee feature I need to tackle is randomly turning the circulation fan on when in an idle stateā€¦

Thanks again.

You could try contacting your supplier or Brivis/Rinnai and ask why the current temp is not showing in the mobile app. It could just be service config option on the controller or something.

I rang and spoke to their technical support department and itā€™s by design unfortunately. If you have an NC-3 or NC-6 controller it wonā€™t display the current temperature in the app. Only when paired with the Rinnai Touch controller panels will it show. The temperature reading must remain local to the older controllers.