zwave-js / certification-backlog

Issues and discussions related to Z-Wave certification of HA + Z-Wave JS
1 stars 0 forks source link

Certification device for Thermostat Setpoint CC has a broken entity in HA #2

Open marcelveldt opened 1 year ago

marcelveldt commented 1 year ago

The problem

Problem 1:

I am unable to do this via the UI:

Please set the Setpoint of the emulated Thermostat Setpoint device to '22 °C' for the 'Cooling' Setpoint Type

grafik

Problem 2:

I also can't do this:

Please set the Setpoint for type 'FullPower' to 150 °C

Problem 3:

I am unable to do this via the UI (same check as above, different device):

Please set the Setpoint of the emulated Thermostat Setpoint device to '22 °C' for the 'Cooling' Setpoint Type

What version of Home Assistant Core has the issue?

core-2023.6.0.dev20230503

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Z-Wave JS

Link to integration documentation on our website

No response

Diagnostics information

Node diagnostics for problems 1-2: zwave_js-f0926e113c178046d0d249fcdc42964a-Node 68-6c05e6136d5df1f37b82d089e6893a74.json.txt

Node diagnostics for problem 3: zwave_js-f0926e113c178046d0d249fcdc42964a-Node 69-64741301612ea804321abbab07756732.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

marcelveldt commented 1 year ago

Reproduce as soon as we have the mock controller, it seems that we can't map a few properties for this test device.

AlCalzone commented 1 year ago

You can now reproduce like this:

  1. check out the current master of https://github.com/zwave-js/node-zwave-js
  2. run yarn && yarn build to get everything up to date
  3. save the following file in the repository as server_config_thermostat_sp.js
  4. run yarn mock-server -c server_config_thermostat_sp.js
  5. execute zwave-js-server with tcp://localhost:5555 as the path
  6. hook up Home Assistant to the external zwave-js-server
// @ts-check
const {
    CommandClasses,
} = require("@zwave-js/core");
const {
    ccCaps,
} = require("@zwave-js/testing");
const {
    ThermostatMode,
    ThermostatSetpointType,
} = require("zwave-js");

/** @type {import("zwave-js/Testing").MockServerOptions["config"]} */
module.exports.default = {
    nodes: [
        {
            id: 2,
            capabilities: {
                basicDeviceClass: 4, // Routing Slave
                genericDeviceClass: 8, // Thermostat
                specificDeviceClass: 6, // General Thermostat V2

                commandClasses: [
                    {
                        ccId: CommandClasses.Version,
                        version: 3,
                    },
                    {
                        ccId: CommandClasses["Manufacturer Specific"],
                        version: 1,
                    },
                    ccCaps({
                        ccId: CommandClasses["Thermostat Mode"],
                        isSupported: true,
                        isControlled: false,
                        secure: true,
                        version: 3,
                        supportedModes: [
                            ThermostatMode.Off,
                            ThermostatMode.Heat,
                            ThermostatMode["Auto"],
                            ThermostatMode["Resume (on)"],
                            ThermostatMode["Auto changeover"],
                        ],
                    }),
                    ccCaps({
                        ccId: CommandClasses["Thermostat Setpoint"],
                        isSupported: true,
                        isControlled: false,
                        secure: true,
                        version: 3,
                        setpoints: {
                            [ThermostatSetpointType.Cooling]: {
                                minValue: 10,
                                maxValue: 36,
                                scale: "°C",
                            },
                            [ThermostatSetpointType["Dry Air"]]: {
                                minValue: -9.87,
                                maxValue: 56.78,
                                scale: "°C",
                            },
                            [ThermostatSetpointType["Full Power"]]: {
                                minValue: 20,
                                maxValue: 32.767,
                                scale: "°C",
                            },
                        },
                    }),
                    CommandClasses["Z-Wave Plus Info"],
                ],
            },
        },
    ],
};
marcelveldt commented 1 year ago

If the device has heating mode but not heating setpoint, it means the device setpoint for heating can not be controlled. We should just hide the temperature control in that case.

marcelveldt commented 1 year ago

We can end up in the situation where a device has some setpoint that needs to be set but not (Z-Wave) mode exists for that. Worst case scenario we just make up a new mode to satisfy HA user interface but we don't set it in Z-Wave.

AlCalzone commented 12 months ago

Update: The test no longer throws errors in the UI. I still can't change setpoints though.

Image

MartinHjelmare commented 2 months ago

What should be done here? Is this related to unknown setpoints as mentioned in the linked PR?

https://github.com/home-assistant/core/pull/102672#issuecomment-1779579882

AlCalzone commented 2 months ago

No, those are valid setpoints and valid thermostat modes, but there's no overlap.

Supported modes:

Supported setpoints:

The assumption in the climate entity that each setpoint has a corresponding mode or vice versa is not correct. There exist several devices for which this assumption does not hold. IIRC @marcelveldt mentioned a discussion with a Matter device manufacturer who also mentioned this?

So IMO the task is (although I'm aware this is not an easy one):