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.
Hey Guys - Iāve got nothing useful to add here 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.