ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
898 stars 91 forks source link

Thermostat scheduler always displays status off #1042

Closed ma-ca closed 2 years ago

ma-ca commented 2 years ago

Issue

The Thermostat scheduler status is always displayed in status off (disabled) in the Eve app, when opening the app.

However, turning the scheduler on or off works fine. The scheduler on the thermostat (Bitron) is correctly changed.

But after closing and opening the app, the scheduler status is displayed off, even after it was turned on before.

homebridge-hue v0.13.27
homebridge v1.3.5
node v16.13.0

Log Messages

The log shows opening Eve and changing the scheduler on thermostat 38 to --> on --> off --> on.

[08/11/2021, 17:33:16] [Hue] Thermostat 44: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 44:   FF reset
[08/11/2021, 17:33:16] [Hue] Thermostat 26: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 26:   FF reset
[08/11/2021, 17:33:16] [Hue] Thermostat 42: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 42:   FF reset
[08/11/2021, 17:33:16] [Hue] Thermostat 41: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 41:   FF reset
[08/11/2021, 17:33:16] [Hue] Thermostat 38: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 38:   FF reset
[08/11/2021, 17:33:16] [Hue] Thermostat 39: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 39:   FF reset
[08/11/2021, 17:33:16] [Hue] Thermostat 40: homekit program command changed to FF04F6
[08/11/2021, 17:33:16] [Hue] Thermostat 40:   FF reset
[08/11/2021, 17:33:29] [Hue] Thermostat 38: homekit program command changed to 00130106
[08/11/2021, 17:33:29] [Hue] Thermostat 38:   00 begin
[08/11/2021, 17:33:29] [Hue] Thermostat 38:   13 schudule_on true
[08/11/2021, 17:33:29] [Hue] Thermostat 38:   06 end
[08/11/2021, 17:33:39] [Hue] Thermostat 38: homekit program command changed to 00130006
[08/11/2021, 17:33:39] [Hue] Thermostat 38:   00 begin
[08/11/2021, 17:33:39] [Hue] Thermostat 38:   13 schudule_on false
[08/11/2021, 17:33:39] [Hue] Thermostat 38:   06 end
[08/11/2021, 17:33:48] [Hue] Thermostat 38: homekit program command changed to 00130106
[08/11/2021, 17:33:48] [Hue] Thermostat 38:   00 begin
[08/11/2021, 17:33:48] [Hue] Thermostat 38:   13 schudule_on true
[08/11/2021, 17:33:48] [Hue] Thermostat 38:   06 end
ebaauw commented 2 years ago

I think this is a bug, at least there seems to be an inconsistency in the code. Homebridge Hue checks for config.scheduler.on on startup, but for config.schedule_on on polling and handling web socket notifications.

Could you please attach a debug dump file, or at least list the resource for the TRV?

ma-ca commented 2 years ago

I don't have config.scheduler.on.

deCONZ Version: 2.9.1

{
  "config": {
    "battery": 100,
    "heatsetpoint": 2000,
    "mode": null,
    "offset": 0,
    "on": true,
    "reachable": true,
    "schedule": {
      "W124": [{
        "heatsetpoint": 2300,
        "localtime": "T04:00"
      }, {
        "heatsetpoint": 1700,
        "localtime": "T06:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T16:00"
      }, {
        "heatsetpoint": 2000,
        "localtime": "T17:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T18:00"
      }, {
        "heatsetpoint": 1800,
        "localtime": "T19:00"
      }],
      "W3": [{
        "heatsetpoint": 2200,
        "localtime": "T06:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T16:30"
      }, {
        "heatsetpoint": 2000,
        "localtime": "T17:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T18:00"
      }, {
        "heatsetpoint": 2000,
        "localtime": "T19:00"
      }]
    },
    "schedule_on": true
  },
  "ep": 1,
  "etag": "35acaf8ee334b9bf708a7b150308c94b",
  "lastseen": "2021-11-09T16:50Z",
  "manufacturername": "Bitron Home",
  "modelid": "902010/32",
  "name": "Thermostat 38",
  "state": {
    "lastupdated": "2021-11-09T16:50:48.798",
    "on": false,
    "temperature": 2300
  },
  "swversion": "V1b225-20151013",
  "type": "ZHAThermostat",
  "uniqueid": "00:0d:6f:00:0b:f8:a7:20-01-0201"
}
ebaauw commented 2 years ago

I think above commit should fix this, but I cannot test as I don't have a TRV with onboard schedules.

ebaauw commented 2 years ago

In v0.13.28.

ma-ca commented 2 years ago

The problem is solved, thanks.

ma-ca commented 2 years ago

Now again the schedule is always displayed in status off / disabled in Eve app when opening the app, but the schedule is actually on / enabled.

This is homebridge-hue v0.13.39

Debug mode does not display much. This is from homebridge.log in debug mode when opening Eve app.

[5/1/2022, 2:23:33 PM] [Hue] Thermostat 26: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 26:   FF reset
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 41: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 41:   FF reset
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 38: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 38:   FF reset
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 42: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 42:   FF reset
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 40: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 40:   FF reset
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 44: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 44:   FF reset
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 39: homekit program command changed to FF04F6
[5/1/2022, 2:23:33 PM] [Hue] Thermostat 39:   FF reset

This is from REST API for thermostat 38 with "schedule_on": true.

{
  "config": {
    "battery": 100,
    "heatsetpoint": 2200,
    "mode": null,
    "offset": 0,
    "on": true,
    "reachable": true,
    "schedule": {
      "W124": [{
        "heatsetpoint": 2300,
        "localtime": "T04:00"
      }, {
        "heatsetpoint": 1700,
        "localtime": "T06:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T16:00"
      }, {
        "heatsetpoint": 2000,
        "localtime": "T17:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T18:00"
      }, {
        "heatsetpoint": 1800,
        "localtime": "T19:00"
      }],
      "W3": [{
        "heatsetpoint": 2200,
        "localtime": "T06:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T16:30"
      }, {
        "heatsetpoint": 2000,
        "localtime": "T17:00"
      }, {
        "heatsetpoint": 2300,
        "localtime": "T18:00"
      }, {
        "heatsetpoint": 2000,
        "localtime": "T19:00"
      }]
    },
    "schedule_on": true
  },
  "ep": 1,
  "etag": "cb3fd7c73a3ab60913f7edece33cc7fb",
  "lastseen": "2022-05-01T12:20Z",
  "manufacturername": "Bitron Home",
  "modelid": "902010/32",
  "name": "Thermostat 38",
  "state": {
    "lastupdated": "2022-05-01T12:20:41.396",
    "on": false,
    "temperature": 2270
  },
  "swversion": "V1b225-20151013",
  "type": "ZHAThermostat",
  "uniqueid": "00:0d:6f:00:0b:f8:a7:20-01-0201"
}
ebaauw commented 2 years ago

I think #1061 has broken this. That's been included since v0.13.32 from Dec 2021. Even encodes the schedule on state (as well as the offset) in the schedule.

ebaauw commented 2 years ago

Could you please try beta v0.13.40-0?

ma-ca commented 2 years ago

Thanks, solved with v0.13.40-0 beta.