Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mqtt][homeassistant][zigbee2mqtt] State missing in homeassistant #16633

Open
enboig opened this issue Apr 9, 2024 · 5 comments
Open

[mqtt][homeassistant][zigbee2mqtt] State missing in homeassistant #16633

enboig opened this issue Apr 9, 2024 · 5 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@enboig
Copy link

enboig commented Apr 9, 2024

I have a ikea light configured with zigbee2mqtt (https://www.zigbee2mqtt.io/devices/ICPSHC24-30EU-IL-1.html#ikea-icpshc24-30eu-il-1)

I checked mqtt and homeassistant reports only brightness, while exposes reporots also state.

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state",
      "value_template": "{{ value_json.state }}"
    }
  ],
  "brightness": true,
  "brightness_scale": 254,
  "command_topic": "zigbee2mqtt/cuinaLlumTaulell/set",
  "device": {
    "identifiers": [
      "zigbee2mqtt_0x0c4314fffe0f8ab6"
    ],
    "manufacturer": "IKEA",
    "model": "TRADFRI driver for wireless control (30 watt) (ICPSHC24-30EU-IL-1)",
    "name": "cuinaLlumTaulell",
    "sw_version": "2.3.086",
    "via_device": "zigbee2mqtt_bridge_0x00124b0012c38fda"
  },
  "effect": true,
  "effect_list": [
    "blink",
    "breathe",
    "okay",
    "channel_change",
    "finish_effect",
    "stop_effect"
  ],
  "name": null,
  "object_id": "cuinallumtaulell",
  "origin": {
    "name": "Zigbee2MQTT",
    "sw": "1.36.0",
    "url": "https://www.zigbee2mqtt.io"
  },
  "schema": "json",
  "state_topic": "zigbee2mqtt/cuinaLlumTaulell",
  "unique_id": "0x0c4314fffe0f8ab6_light_zigbee2mqtt"
}

exposes:

  {
    "date_code": "20190401",
    "definition": {
      "description": "TRADFRI driver for wireless control (30 watt)",
      "exposes": [
        {
          "features": [
            {
              "access": 7,
              "description": "On/off state of this light",
              "label": "State",
              "name": "state",
              "property": "state",
              "type": "binary",
              "value_off": "OFF",
              "value_on": "ON",
              "value_toggle": "TOGGLE"
            },
            {
              "access": 7,
              "description": "Brightness of this light",
              "label": "Brightness",
              "name": "brightness",
              "property": "brightness",
              "type": "numeric",
              "value_max": 254,
              "value_min": 0
            }
          ],
          "type": "light"
        },
        {
          "access": 2,
          "description": "Triggers an effect on the light (e.g. make light blink for a few seconds)",
          "label": "Effect",
          "name": "effect",
          "property": "effect",
          "type": "enum",
          "values": [
            "blink",
            "breathe",
            "okay",
            "channel_change",
            "finish_effect",
            "stop_effect"
          ]
        },
        {
          "access": 7,
          "category": "config",
          "description": "Controls the behavior when the device is powered on after power loss. If you get an `UNSUPPORTED_ATTRIBUTE` error, the device does not support it.",
          "label": "Power-on behavior",
          "name": "power_on_behavior",
          "property": "power_on_behavior",
          "type": "enum",
          "values": [
            "off",
            "on",
            "toggle",
            "previous"
          ]
        },
        {
          "access": 1,
          "category": "diagnostic",
          "description": "Link quality (signal strength)",
          "label": "Linkquality",
          "name": "linkquality",
          "property": "linkquality",
          "type": "numeric",
          "unit": "lqi",
          "value_max": 255,
          "value_min": 0
        }
      ],
      "model": "ICPSHC24-30EU-IL-1",
      "options": [
        {
          "access": 2,
          "description": "Controls the transition time (in seconds) of on/off, brightness, color temperature (if applicable) and color (if applicable) changes. Defaults to `0` (no transition).",
          "label": "Transition",
          "name": "transition",
          "property": "transition",
          "type": "numeric",
          "value_min": 0
        },
        {
          "access": 2,
          "description": "State actions will also be published as 'action' when true (default false).",
          "label": "State action",
          "name": "state_action",
          "property": "state_action",
          "type": "binary",
          "value_off": false,
          "value_on": true
        }
      ],
      "supports_ota": true,
      "vendor": "IKEA"
    },
    "disabled": false,
    "endpoints": {
      "1": {
        "bindings": [],
        "clusters": {
          "input": [
            "genBasic",
            "genIdentify",
            "genGroups",
            "genScenes",
            "genOnOff",
            "genLevelCtrl",
            "touchlink",
            "64636"
          ],
          "output": [
            "genScenes",
            "genOta",
            "genPollCtrl",
            "touchlink"
          ]
        },
        "configured_reportings": [],
        "scenes": []
      },
      "242": {
        "bindings": [],
        "clusters": {
          "input": [],
          "output": [
            "greenPower"
          ]
        },
        "configured_reportings": [],
        "scenes": []
      }
    },
    "friendly_name": "cuinaLlumTaulell",
    "ieee_address": "0x0c4314fffe0f8ab6",
    "interview_completed": true,
    "interviewing": false,
    "manufacturer": "IKEA of Sweden",
    "model_id": "TRADFRI Driver 30W",
    "network_address": 10014,
    "power_source": "Mains (single phase)",
    "software_build_id": "2.3.086",
    "supported": true,
    "type": "Router"
  }

So discovering it don't show a "state" channel and I cannot switch it on:

binary_sensor/0x0c4314fffe0f8ab6/update_available
light/0x0c4314fffe0f8ab6/light
select/0x0c4314fffe0f8ab6/effect
select/0x0c4314fffe0f8ab6/power_on_behavior
sensor/0x0c4314fffe0f8ab6/linkquality
sensor/0x0c4314fffe0f8ab6/power_on_behavior
sensor/0x0c4314fffe0f8ab6/update_state
update/0x0c4314fffe0f8ab6/update

Expected Behavior

A state channel should be discovered to allow switching on the light.

Current Behavior

Only brightness can be changed, but light is always off.

Possible Solution

I don't know if it is a zigbee2mqtt bug which should publish state someway, or addon should create it.

  • Version used: openhab 4.1.2
  • Environment: docker just for testing clean install
  • Operating System and version: ubuntu server
@enboig enboig added the bug An unexpected problem or unintended behavior of an add-on label Apr 9, 2024
@ccutrer
Copy link
Contributor

ccutrer commented Apr 9, 2024

This is working as expected. In openHAB, dimmer channels are a subtype of switches. So you can send ON/OFF to them, and get their current state as OnOffType directly from the dimmer's state. If you happen to have a color bulb, it goes one step further - a Color item is a subtype of a Dimmer, so that's the only channel exposed (if the bulb doesn't support CCT). And you can send a PercentType to set brightness only without changing color, an OnOffType to turn it on/off without touching brightness, or an HSBType to fully set the color and brightness (and turn it on).

@enboig
Copy link
Author

enboig commented Apr 10, 2024

Thanks, I started a topic in forum as it seems it's a "user problem" :-)
https://community.openhab.org/t/problem-adding-a-switch-to-a-dimmer/155304

@enboig
Copy link
Author

enboig commented Apr 10, 2024

I think there is a bug.... moving the slider does nothing
https://community.openhab.org/t/problem-adding-a-switch-to-a-dimmer/155304/9

@enboig
Copy link
Author

enboig commented Apr 15, 2024

I posted more data in the forum post. Is it enough? Do you need anything else to investigate the problem?

@ccutrer
Copy link
Contributor

ccutrer commented Apr 16, 2024

I've got the tab open with your forum post, so I won't forget it. I'll let you know when I get to it if I need more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

2 participants