zigbee2mqtt-frontend icon indicating copy to clipboard operation
zigbee2mqtt-frontend copied to clipboard

[Bug]: Climate schedule sends malformed request to API

Open DerDreschner opened this issue 1 year ago • 0 comments

What happened?

Trying to figure out how the climate scheduling works, I found out that the request send to the API is malformed.

This are the settings I tried to apply: Screenshot from 2023-12-20 05-03-32

The request that was send afterwards according to the console was this:

{
  "topic": "bathroom-wall-thermostat/set",
  "payload": {
    "weekly_schedule": {
      "days": [
        "sunday",
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday",
        "saturday",
        "away_or_vacation"
      ],
      "transitions": [
        {
          "cooling_setpoint": 23,
          "heating_setpoint": 17,
          "time": 0
        },
        {
          "cooling_setpoint": 21,
          "heating_setpoint": 21,
          "time": 480
        },
        {
          "cooling_setpoint": 23,
          "heating_setpoint": 17,
          "time": 1200,
          "transitionTime": {
            "hour": 10,
            "minute": 0
          },
          "heatSetpoint": 17
        },
        {
          "transitionTime": {
            "hour": 18,
            "minute": 0
          },
          "heatSetpoint": 21
        }
      ],
      "dayofweek": [
        {
          "day": "monday"
        },
        {
          "day": "tuesday"
        }
      ]
    }
  }
}

This isn't catched by the backend and results in a malformed zigbee package which I captured through wireguard:

Frame 50231: 63 bytes on wire (504 bits), 63 bytes captured (504 bits) on interface -, id 0
IEEE 802.15.4 Data, Dst: 0xc55a, Src: 0x0000
ZigBee Network Layer Data, Dst: 0x80c3, Src: 0x0000
ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 1
    Frame Control Field: Data (0x00)
    Destination Endpoint: 1
    Cluster: Thermostat (0x0201)
    Profile: Home Automation (0x0104)
    Source Endpoint: 1
    Counter: 139
ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x01)
    Sequence Number: 43
    Command: Set Weekly Schedule (0x01)
    Number of Transitions for Sequence: 0x04
    Days of Week for Sequence: 0x06, Monday, Tuesday
        .... ...0 = Sunday: False
        .... ..1. = Monday: True
        .... .1.. = Tuesday: True
        .... 0... = Wednesday: False
        ...0 .... = Thursday: False
        ..0. .... = Friday: False
        .0.. .... = Saturday: False
        0... .... = Away/Vacation: False
    Mode for Sequence: 0x01, Heating
        .... ...1 = Heating: True
        .... ..0. = Cooling: False
    Transition Time: 0.000000000 seconds
    Heating Setpoint: 0
    Transition Time: 36000.000000000 seconds
    Heating Setpoint: 17
    Transition Time: 64800.000000000 seconds
    Heating Setpoint: 21
[Malformed Packet: ZCL Thermostat]
    [Expert Info (Error/Malformed): Malformed Packet (Exception occurred)]
        [Malformed Packet (Exception occurred)]
        [Severity level: Error]
        [Group: Malformed]

What browsers are you seeing the problem on?

Firefox

Relevant stacktrace

No response

Did you download state.json.zip?

I will not attach state.json.zip

DerDreschner avatar Dec 20 '23 04:12 DerDreschner