Closed jameswestcott closed 4 years ago
I'll try to fix this in my next update by recognizing "null" as "no battery."
Update to 1.0.4 Setting battery reference to 0 will now disable adding a battery to a device. Please confirm this works for you.
Thanks for doing that so quickly. It seems to have worked for most devices, except for Thermostat, where you get the following error: Wrong battery Specified for device Reference #: 1051 You specified reference: 0 but correct device reference appears to be: 549. Fixing error.
Yeah, there is special code for a Thermostat. I forgot about that. I'll have another look.
I thought that might be the case. Any reason why you only control the two threshold temperature values and not the Target Temperature? Is it because the Home App doesn't appear to use that parameter? Thanks once again for the plug-in. Without it, HomeKit would be pretty useless.
As you your question - why I control only the two threshold values. Actually, I control all three settings, but it depends on the type of Thermostat.
In HomeKit, there are three types of thermostats: 1) Heating Only; 2) Cooling only, or 3) Heating and Cooling.
If the thermostat is Heating Only, or Cooling Only, you control it using only the TargetTemperature. However, if the thermostat controls both heating and cooling, then TargetTemperature does nothing, and you have to control it using the two threshold temperature values.
Also, battery setting on Thermostats is a little different - do you have a specific use case where you need to disable the battery reporting? If so, I'll try to implement the change -- but if you don't have a particular need for this, then I don't want to bother with it.
Don't worry about the battery reporting on the thermostat, it's not an issue. I'm actually making my own virtual thermostat and writing the control logic within HomeSeer. I can turn off the battery reporting on thermometer instead and use the thermostat.
Thanks for info regarding the thermostat temperatures. If you are creating the 3 different types of thermostat by specifying only the heating, only the cooling or both thresholds then it's not working. Only specifying one of the two thresholds creates the same thermostat as specifying both, except HomeKit gets upset.
You're right - I just took another look at the Thermostat code and I think I see some bugs in it that are a problem. I need to go back and look a bit more carefully. Its been a long time since I worked on that code, but I'll see what I can do.
I fixed one of the bugs in the thermostat code. Previously, when the thermostat was Heating-Only or Cooling-Only, the iOS Home app would still lset you choose fro "Off", "Heating", "Cooling" and "Auto". Now you can only select the appropriate options. As an example, here is how I configure a cooling-only thermostat:
{"type":"Thermostat", "ref":1108 , "controlRef":1103, "stateRef":1105, "coolingSetpointRef":1101 }
Setting the battery reference to 0 or null doesn't stop the accessory displaying the battery status. I am trying to stop showing duplicate battery status in HomeKit where a single z-wave device might appear multiple times (e.g. motion, temperature & humidity).