Hassio-zigbee2mqtt: Add support for Webbased frontend experimental feature

Created on 21 Sep 2020  路  6Comments  路  Source: danielwelch/hassio-zigbee2mqtt

Description of problem:
Add support for Webbased frontend experimental feature using ingress

Required updates

  • [ ] Docs.md update to include this new method for Permit Join and other operations
  • [ ] Changelog.md to document new
  • [ ] Update config.json with new changes
  • [ ] Test locally to make sure ingress when frontend calls backend operations

config.json changes

experimental:
  new_api: true
  frontend:
    port: 8080
    "experimental": {
      "new_api": "bool?",
      "frontend": {
        "port": "int?"
        }
    },
"ingress": true,
"ingress_port": 8080,
"panel_icon": "mdi:zigbee",
enhancement

Most helpful comment

This is now working in latest edge, but with the configuration workaround specified above.

All 6 comments

I looked into this, but I was under the impression that addon configurations only support two levels of nesting, hence "port": "int?" would be ignored.

@messismore I didn't test yet as I was looking into some pipeline optimizations, but best is to set it up and try it on a local build. I might get to it later today or tomorrow.

@messismore you are correct, I re-tested and it's still the case:

20-09-23 10:18:02 WARNING (MainThread) [supervisor.store.data] Can't read /data/addons/local/zigbee2mqtt-edge/config.json: expected string or buffer for dictionary value @ data['schema']['experimental']['frontend']. Got {'port': 'int?'}

@Koenkk is it possible to change the setup? Ideally would be something like:

experimental:
  new_api: true
  frontend_port: 8080

Based on the code in z2m if you have experimental.frontend you load the extension and if port is not specified it falls back to 8080.

I was able to get the frontend started by using:

"ingress": true,
  "ingress_port": 8080,

and

"experimental": {
      "new_api": true,
      "frontend": true
    },
    "experimental": {
      "transmit_power": "int?",
      "output": "str?",
      "new_api": "bool?",
      "frontend": "bool?"
    },

However it seems the setup is not ingress friendly. I'm still debugging to understand why. It might be that api calls are trying to get through on the wrong path.

Later edit: This seems to relate to specific code for calling the API. See: https://github.com/nurikk/z2m-frontend/issues/14
I will try with Fiddler or Charles to redirect that call and see if I can get it working.

This is now working in latest edge, but with the configuration workaround specified above.

This is now released with 1.15.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smarti picture smarti  路  11Comments

highground88 picture highground88  路  7Comments

Johnnyyr picture Johnnyyr  路  9Comments

danielwelch picture danielwelch  路  8Comments

wolverinevn picture wolverinevn  路  10Comments