johannrichard / homebridge-dingz

Emerging Homebridge Plugin for dingz & myStrom WiFi Switch Devices. Replaces the obsolete homebridge-mystrom plugin
https://github.com/johannrichard/homebridge-dingz/wiki
Apache License 2.0
12 stars 6 forks source link

[BUG] Firmware 2.x breaks some features #611

Open shan-vosseller opened 1 year ago

shan-vosseller commented 1 year ago

Describe the bug Since upgrading to Dingz firmware 2.x (in my case 2.0.21) from 1.3.30, the Dingz API appears to have changed and dimming isn't working properly.

To Reproduce Steps to reproduce the behavior:

  1. Dim with homekit or set dim level to a specific %

Expected behavior Light dims for a flash but then goes back to 100%

Plugin environment (please complete the following information):

Note Dingz API changes - http://dingz.ch/en/changelog-en/

johannrichard commented 1 year ago

Thanks for bringing this to my attention. I'm afraid I don't have an ETA until when I can look into these changes and the problems they cause.

shan-vosseller commented 1 year ago

I have sent a note to the manufacturer to see if they are aware of the issue of what change in the new firmware may have caused it. Hopefully, there is just a settings change that I haven't managed to try yet that can address this compatibility change. From further digging, it looks like the new firmware has quite a few issues. I wish I hadn't "upgraded."

Perhaps also helpful- https://github.com/siku2/hass-dingz/issues/18

johannrichard commented 1 year ago

One of the potential culprits is the way the dimmer config is returned when querying http://<IP>/api/v1/dimmer_config. This changed significantly and the way to know whether a light is dimmable or not is not the same anymore.

So all outputs, including non-dimmable ones, are configured as dimmable in HomeKit.

I will investigate further but see potentially added complexity as we must keep track of different firmware versions (again...) to be sure we configure the dingz correctly.

PS: I think it should be possible to return to firmware v1.3.x.

johannrichard commented 1 year ago

Dimmer Config (Old)

{
  "dimmers": [
    {
      "output": "halogen",
      "name": "",
      "feedback": null,
      "feedback_intensity": 100
    },
    {
      "output": "halogen",
      "name": "",
      "feedback": null,
      "feedback_intensity": 100
    },
    {
      "output": "halogen",
      "name": "",
      "feedback": null,
      "feedback_intensity": 100
    },
    {
      "output": "halogen",
      "name": "",
      "feedback": null,
      "feedback_intensity": 100
    }
  ]
}

Dimmer Config (New)

{
  "dimmers": [
    {
      "active": true,
      "name": "Leftie",
      "type": "light",
      "groups": "z",
      "feedback": {
        "color": "none",
        "brightness": 100
      },
      "light": {
        "dimmable": false,
        "dimmer": {
          "type": "linear",
          "use_last_value": false,
          "range": {
            "min": 1,
            "max": 100
          },
          "dynamic": {
            "day": 100,
            "twilight": 100,
            "night": 100
          }
        },
        "onoff": {
          "group_on": {
            "day": true,
            "twilight": true,
            "night": true
          }
        }
      },
      "heater": {
        "type": "nc",
        "function": "heating"
      },
      "pulse": {
        "type": "positive",
        "length": {
          "min": 0.2,
          "max": 0
        }
      },
      "fan": {
        "delay": {
          "pre": 3,
          "post": 5
        },
        "ventilation": {
          "from": {
            "hour": 7,
            "minute": 0
          },
          "to": {
            "hour": 21,
            "minute": 0
          },
          "force_in_24": 0
        },
        "react": {
          "pir_during_slot": false,
          "btn_no_delay": false
        },
        "active": true
      },
      "garage_door": {
        "opening_travel_time": 12,
        "close_timeout": 60,
        "pulse_time": 1
      },
      "valve": {
        "duration": 60
      }
    },
    {
      "active": true,
      "name": "Unstoppable",
      "type": "light",
      "groups": "z",
      "feedback": {
        "color": "none",
        "brightness": 100
      },
      "light": {
        "dimmable": true,
        "dimmer": {
          "type": "led_bulb",
          "use_last_value": false,
          "range": {
            "min": 1,
            "max": 100
          },
          "dynamic": {
            "day": 100,
            "twilight": 100,
            "night": 100
          }
        },
        "onoff": {
          "group_on": {
            "day": true,
            "twilight": true,
            "night": true
          }
        }
      },
      "heater": {
        "type": "nc",
        "function": "heating"
      },
      "pulse": {
        "type": "positive",
        "length": {
          "min": 0.2,
          "max": 0
        }
      },
      "fan": {
        "delay": {
          "pre": 3,
          "post": 5
        },
        "ventilation": {
          "from": {
            "hour": 7,
            "minute": 0
          },
          "to": {
            "hour": 21,
            "minute": 0
          },
          "force_in_24": 0
        },
        "react": {
          "pir_during_slot": false,
          "btn_no_delay": false
        },
        "active": true
      },
      "garage_door": {
        "opening_travel_time": 12,
        "close_timeout": 60,
        "pulse_time": 1
      },
      "valve": {
        "duration": 60
      }
    },
    {
      "active": false,
      "name": "Badum, tssss",
      "type": "light",
      "groups": "z",
      "feedback": {
        "color": "none",
        "brightness": 100
      },
      "light": {
        "dimmable": true,
        "dimmer": {
          "type": "linear",
          "use_last_value": false,
          "range": {
            "min": 1,
            "max": 100
          },
          "dynamic": {
            "day": 100,
            "twilight": 100,
            "night": 100
          }
        },
        "onoff": {
          "group_on": {
            "day": true,
            "twilight": true,
            "night": true
          }
        }
      },
      "heater": {
        "type": "nc",
        "function": "heating"
      },
      "pulse": {
        "type": "positive",
        "length": {
          "min": 0.2,
          "max": 0
        }
      },
      "fan": {
        "delay": {
          "pre": 3,
          "post": 5
        },
        "ventilation": {
          "from": {
            "hour": 7,
            "minute": 0
          },
          "to": {
            "hour": 21,
            "minute": 0
          },
          "force_in_24": 0
        },
        "react": {
          "pir_during_slot": false,
          "btn_no_delay": false
        },
        "active": true
      },
      "garage_door": {
        "opening_travel_time": 12,
        "close_timeout": 60,
        "pulse_time": 1
      },
      "valve": {
        "duration": 60
      }
    },
    {
      "active": false,
      "name": "Mo' mojo",
      "type": "light",
      "groups": "z",
      "feedback": {
        "color": "none",
        "brightness": 100
      },
      "light": {
        "dimmable": true,
        "dimmer": {
          "type": "linear",
          "use_last_value": false,
          "range": {
            "min": 1,
            "max": 100
          },
          "dynamic": {
            "day": 100,
            "twilight": 100,
            "night": 100
          }
        },
        "onoff": {
          "group_on": {
            "day": true,
            "twilight": true,
            "night": true
          }
        }
      },
      "heater": {
        "type": "nc",
        "function": "heating"
      },
      "pulse": {
        "type": "positive",
        "length": {
          "min": 0.2,
          "max": 0
        }
      },
      "fan": {
        "delay": {
          "pre": 3,
          "post": 5
        },
        "ventilation": {
          "from": {
            "hour": 7,
            "minute": 0
          },
          "to": {
            "hour": 21,
            "minute": 0
          },
          "force_in_24": 0
        },
        "react": {
          "pir_during_slot": false,
          "btn_no_delay": false
        },
        "active": true
      },
      "garage_door": {
        "opening_travel_time": 12,
        "close_timeout": 60,
        "pulse_time": 1
      },
      "valve": {
        "duration": 60
      }
    }
  ]
}
shan-vosseller commented 1 year ago

It's pretty inexcusable that they completely changed the api and offered no versioned solution for backwards compatibility. I will see if I can roll back to the earlier firmware version. Of course if they had direct HomeKit available then I suppose we wouldn't need to run it through homebridge.

johannrichard commented 1 year ago

You can request beta access for HomeKit. I’ve configured it (requires some manual work, essentially uploading the HomeKit keys to the dingz) but so far seems to work with my simple setup.

I’ve observed one thing (not sure related to HomeKit or FW2.0) though: sometimes the dingz seems to freeze and even the physical buttons won’t work. The only way to get back to a working system is by using the circuit breaker.

Others have also reported issues related to HomeKit, but for older v2 firmwares.

TheFritz89 commented 1 year ago

Does some one know how to downgrade to FW 1.3.x?