ztalbot2000 / homebridge-cmd4

CMD4 Plugin for Homebridge - Supports ~All Accessory Types & now all Characteristics too
Apache License 2.0
149 stars 13 forks source link

[Bug] Plugin generated warning ... - exceeded maximum of 25. #144

Closed gui28347 closed 2 months ago

gui28347 commented 3 months ago

Describe The Bug: Using latest version 7.1.0 and sample config.min and it generate some warnings: [02/07/2024, 12:04:30] [homebridge-cmd4] This plugin generated a warning from the characteristic 'Heating Threshold Temperature': characteristic was supplied illegal value: number 25.200000000000003 exceeded maximum of 25. See https://homebridge.io/w/JtMGR for more info. [02/07/2024, 12:04:30] [homebridge-cmd4] This plugin generated a warning from the characteristic 'Heating Threshold Temperature': characteristic was supplied illegal value: number 25.200000000000003 exceeded maximum of 25. See https://homebridge.io/w/JtMGR for more info.

To Reproduce: Install latest version of homebridge 1.8.3 / 4.56.4 Install latest version of homebrdige-cmd4 plugin (7.1.0) Restart homebridge, see logs.

Expected Behaviour: Plugin should stop generating alerts due not supported values.

Cmd4 Config: Sample min config provided by you

Environment:

ztalbot2000 commented 3 months ago

Hi,

So the limits are dictated by Homebridge/HapNodeJS who gets them from Apple, so in that sense there is nothing I can do. However, Cmd4 does allow you to override the limits (it's in the docs somewhere). While you can override the limits, when the value gets to Apple, they can choose to ignore it. Other plugins will behave the same.

Ttyl, John

On Tue, Jul 2, 2024 at 6:09 PM gui28347 @.***> wrote:

Describe The Bug: Using latest version 7.1.0 and sample config.min and it generate some warnings: [02/07/2024, 12:04:30] [homebridge-cmd4] This plugin generated a warning from the characteristic 'Heating Threshold Temperature': characteristic was supplied illegal value: number 25.200000000000003 exceeded maximum of 25. See https://homebridge.io/w/JtMGR for more info. [02/07/2024, 12:04:30] [homebridge-cmd4] This plugin generated a warning from the characteristic 'Heating Threshold Temperature': characteristic was supplied illegal value: number 25.200000000000003 exceeded maximum of 25. See https://homebridge.io/w/JtMGR for more info.

To Reproduce: Install latest version of homebridge 1.8.3 / 4.56.4 Install latest version of homebrdige-cmd4 plugin (7.1.0) Restart homebridge, see logs.

Expected Behaviour: Plugin should stop generating alerts due not supported values.

Cmd4 Config: Sample min config provided by you

Environment:

  • Node.js Version: 20.15.0
  • NPM Version: 10.7.0
  • Homebridge Version: 1.8.3
  • homebridge-cmd4 Version: 7.1.0
  • Operating System: Raspbian
  • Process Supervisor: hb-service

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/144, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXZGUEPT7RFBYT2462TZKMQKBAVCNFSM6AAAAABKIL7HACVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DOMRUGQ3DAMY . You are receiving this because you were assigned.Message ID: @.***>

ztalbot2000 commented 2 months ago

I did finally get around to double checking this. I am correct. The warning is from hap-nodejs. They define it based on Apples documentation:

See /var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/definitions/CharacteristicDefinitions.js
function HeatingThresholdTemperature() {
        var _this = _super.call(this, "Heating Threshold Temperature", HeatingThresholdTemperature.UUID, {
            format: "float" /* Formats.FLOAT */,
            perms: ["ev" /* Perms.NOTIFY */, "pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */],
            unit: "celsius" /* Units.CELSIUS */,
            minValue: 0,
            maxValue: 25,
            minStep: 0.1,
        }) || this;
        _this.value = _this.getDefaultValue();
        return _this;
    }

So hap-nodejs cannot change it either, but I did mention that Cmd4 allows you to override this value; though what Apple will do with it is undetermined and not under our control. This information is described in the Developers documentation of Cmd4 and would be:

     "props": {
                        "heatingThresholdTemperature": {
                            "maxValue": 30,
                            "minValue": 0,
                            "minStep": 0.1
                        }
                    },

Take care, John Talbot