dustindclark / homebridge-rinnai-controlr

Rinnai Control-R interface for homebridge
Apache License 2.0
12 stars 7 forks source link

Logic flaw in Min and Max temperature compares #6

Closed buckzilla closed 1 year ago

buckzilla commented 2 years ago

I really really appreciate your efforts with this plugin and if there is anything I can do to help make it better, or support you I will do it please reach out. I did submit this issue previously, but it was closed. I believe there is a logic flaw, please take a second look.

I am not a developer, but in testing multiples of values there appears to be a logic flaw in the Min vs Max temperature settings. I should state that I have my temperature set to 125 F within the Control-R app prior to enabling this plugin and never change it. Also, the Celsius setting appears to be ignored, or at least handled incorrectly. It's somewhat difficult to discern as the output uses Celsius values even though the code is using Fahrenheit. Notice this log output when using 125.1 min and 125.1 max: [3/8/2022, 4:00:39 PM] [homebridge-rinnai-controlr] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: number 51.666666666666664 exceeded minimum of 51.722222222222214.

When using 120.1 min and 120.2 max: [3/8/2022, 4:07:35 PM] [homebridge-rinnai-controlr] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: number 51.666666666666664 exceeded maximum of 49.

Now notice when I change from F to C, and use 51.6 min and 51.6 max: [3/8/2022, 4:04:43 PM] [homebridge-rinnai-controlr] This plugin generated a warning from the characteristic 'Target Temperature': characteristic was supplied illegal value: number 125 exceeded maximum of 51.6.

Plugin Config: This is my desired config, I don't want to change temperature with this plugin, I only want the recirculation.

        {
            "username": "xxx",
            "password": "XXX",
            "recirculationDuration": 15,
            "temperatureUnits": "F",
            "minimumTemperature": 125,
            "maximumTemperature": 125,
            "platform": "RinnaiControlR"
        }

Environment:

guillochon commented 2 years ago

I am getting the same error on my heater too. Would appreciate a fix if possible!

guillochon commented 2 years ago

More info: I see this message spammed constantly:

[homebridge-rinnai-controlr] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was supplied illegal value: number 36.666666666666664 exceeded minimum of 48.888888888888886. See https://homebridge.io/w/JtMGR for more info.
guillochon commented 2 years ago

I'm not sure why this resolved this particular issue to me, but setting the heater's "max temp" mode from 120F to 140F (mode 1b instead of 1A on my 199en) made these messages go away.

dustindclark commented 1 year ago

Min/max should not be configured with the same values. Closing this out as invalid config. If you'd like to disable temperature control, please raise a new feature request, but you could also just not change the temperature in HomeKit. The feature is there if you need it, but you don't have to use it...just like a physical push button controller.