zwave-js / certification-backlog

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

Add support for Thermostat Setback CC #15

Open marcelveldt opened 1 year ago

marcelveldt commented 1 year ago

The Thermostat Setback CC allows overriding a thermostat setpoint (the way I understand it without affecting the original setpoint setting), either temporarily (e.g. on a timer) or permanently.

grafik

There is no way to use/set this in HA, except using the invoke_cc_api service call.

Diagnostics information

zwave_js-f0926e113c178046d0d249fcdc42964a-Node 67-7180da6f98ebab1058d1cfaa753baaeb.json.txt

marcelveldt commented 4 months ago

candidate for expert UI ? review zigbee + matter spec if this is common there as well, if not --> make this a setting in the export UI, otherwise handle it globally

MartinHjelmare commented 2 months ago

What's the status here? Did we review zigbee and matter?

marcelveldt commented 2 months ago

What's the status here? Did we review zigbee and matter?

I couldn't find anything for this in zigbee and matter, seems a (somewhat weird) unique feature for Z-Wave. So: if this is really mandatory for certification; it should be in the expert UI

MartinHjelmare commented 2 months ago

Do we want the expert UI to use the existing service call?

marcelveldt commented 2 months ago

Do we want the expert UI to use the existing service call?

No, if we want to deprecate some of the super advanced service calls at some point that makes it harder. I suggest the expert UI issues the commands directly

wendevlin commented 1 month ago

@marcelveldt what do I need to send then as command? setbackState?

and do I send -128 or -12.8?

        {
          "endpoint": 0,
          "commandClass": 71,
          "commandClassName": "Thermostat Setback",
          "property": "setbackState",
          "propertyName": "setbackState",
          "ccVersion": 1,
          "metadata": {
            "type": "number",
            "readable": true,
            "writeable": true,
            "label": "Setback state",
            "min": -12.8,
            "max": 12,
            "stateful": true,
            "secret": false
          },
          "value": 0
        },
AlCalzone commented 1 month ago

and do I send -128 or -12.8?

Z-Wave JS deals with conversion to the correct format, so you send something between -12.8 and +12. There are 3 special states though that are not encoded in this value, so it would be better to use invoke_cc_api instead, with this method: https://zwave-js.github.io/node-zwave-js/#/api/CCs/ThermostatSetback?id=set

SetbackType looks like this:

export enum SetbackType {
    None = 0x00,
    Temporary = 0x01,
    Permanent = 0x02,
}

SetbackState is a number between -12.8 and 12, or one of these strings:

export type SetbackSpecialState =
    | "Frost Protection"
    | "Energy Saving"
    | "Unused";
wendevlin commented 1 month ago

@AlCalzone I am not able to call the set method correctly: image

I get the error zwave_error: Z-Wave error 322 - setbackType is not a SetbackType (ZW0322)

AlCalzone commented 1 month ago

You're passing a dictionary as the only argument, but it expects two separate non-dictionary arguments

bueeler commented 3 weeks ago

As (https://github.com/home-assistant/core/issues/92808) was closed already, I try to ask here... While I can invoke "setOverride" through "invoke_cc_api" in HomeAssistant, it is not possible to get the current value by "invoke_cc_api". It asks for parameter:

image

However parameter is not needed according to https://zwave-js.github.io/node-zwave-js/#/api/CCs/ClimateControlSchedule?id=getoverride. Is there another way to get currently set override value (setback state)? Unfortunately it is not included as attribute for the climate instance in HA.

AlCalzone commented 3 weeks ago

Just pass an empty list ([]) for the parameters.

bueeler commented 3 weeks ago

@AlCalzone Thanks for the help! Calling the service works with empty list as suggested. But it seems not possible to get the return variable. Service call:

alias: GetOverride
sequence:
  - action: zwave_js.invoke_cc_api
    data:
      command_class: "70"
      method_name: getOverride
      parameters: []
      device_id:
        - 8968d62173a28aae2bc680497d39f227
    response_variable: result
description: ""

Error msg:

GetOverride: Error executing script. Invalid data for call_service at pos 1: Script does not support 'response_variable' for service 'response_variable' which does not support response data.

Is there something wrong in my script, or does zwave_js.invoke_cc_api not work as expected?