[OH3] Z2M Home Assistance auto discovery creates channel as a trigger

Hello.

Setup:
OH3 3.2
Z2M 1.21.0

Aqara curtain motor Xiaomi ZNCLDJ11LM control via MQTT | zigbee2mqtt.io

The thing is discovered as:

UID: mqtt:homeassistant_zigbee2mqtt_5F0x00158d00027275d9:main:zigbee2mqtt_5F0x00158d00027275d9
label: VadimBlind
thingTypeUID: mqtt:homeassistant_zigbee2mqtt_5F0x00158d00027275d9
configuration:
  topics:
    - sensor/0x00158d00027275d9/update_state
    - cover/0x00158d00027275d9/cover
    - sensor/0x00158d00027275d9/linkquality
    - binary_sensor/0x00158d00027275d9/update_available
  basetopic: homeassistant
bridgeUID: mqtt:systemBroker:main
{
    "availability": [
        {
            "topic": "zigbee2mqtt/bridge/state"
        }
    ],
    "command_topic": "zigbee2mqtt/VadimBlind/set",
    "device": {
        "identifiers": [
            "zigbee2mqtt_0x00158d00027275d9"
        ],
        "manufacturer": "Xiaomi",
        "model": "Aqara curtain motor (ZNCLDJ11LM)",
        "name": "VadimBlind",
        "sw_version": "Zigbee2MQTT 1.19.1"
    },
    "json_attributes_topic": "zigbee2mqtt/VadimBlind",
    "name": "VadimBlind",
    "position_template": "{{ value_json.position }}",
    "position_topic": "zigbee2mqtt/VadimBlind",
    "set_position_template": "{ \"position\": {{ position }} }",
    "set_position_topic": "zigbee2mqtt/VadimBlind/set",
    "unique_id": "0x00158d00027275d9_cover_zigbee2mqtt"
}

the channel cover is created as trigger.

but I cannot create an item for it, it says:

how can I link the item to this channel? as I want to open/close blind

Thanks!

Hello,
did you find a way to do what you are asking …

I have a similar issue with lightbulb …

Hi, unfortunately, no.

I just created generic mqtt thing and configured all channels manually.

Hello Nik

similar questions here. I installed Paulmann Velora lights and try to make them work in OH3.4
They come with home assistant functionality and so far everything works. I can control them over the zigbee homepage on http://OHServerxxx:7080/#/dashboard just fine. ON/OFF, color temp, dimming works great.

And home assistant discovers the Paulmann Veloras, however, it only shows useless “things” for each light together with their “item” showing only the links quality. Which is nice but of no use to really control the damn things.

Now I am stuck right after setting up a generic MQTT thing. I can get as far as creating the thing. But if I try to set up a working channel I am not sure, what exactly I should enter into the required fields in openhab ( MQTT State Topic, MQTT Command Topic, Incoming Value Transformations). The generic things appears as “online”. It gets even worse when trying to set up an item accordingly (:+( … nothing happens if I click the switch button.

In MQTT Explorer I can see the following:
Under “zigbee2mqtt/bridge”:

{
  "brightness": 23,
  "color": {
    "h": 33,
    "hue": 33,
    "s": 79,
    "saturation": 79,
    "x": 0.448,
    "y": 0.4076
  },
  "color_mode": "color_temp",
  "color_temp": 350,
  "linkquality": 55,
  "state": "ON"
}

And under “home assistant/light/0x123/config” it reads:

{"brightness":44,"color":{"x":0.448,"y":0.4076},"color_mode":"color_temp","color_temp":350,"linkquality":39,"state":"OFF"}

Does anyone have an idea?

Any help greatly appreciated!
Merry Christmas
Cleo

Hi Armin (Cleo) & All,

I was struggling with exactly the same problem with a Philips Hue bulb in the last 2 days and it took me some time to sort out the workaround, that’s why I profit from this thread to share what I did as workaround as well as my concern that there may be a more fundamental bug somewhere.

My Hue bulb of model 929002469202 (No color - only dimmer) is correctly recognized in Zigbee2mqtt and works, but openhab 3.4 also only discovers the channels of limited use (Link quality, Last seen, update …) but nothing to control the bulb. For test purposes I tested with version 3.3 … and there it discovers additionally a color channel but as trigger (as the title of this thread suggests) - hence also useless as there can be no item created from this. The latest 4.0 snapshot behaves by the way the same as 3.4.

Reading around I found a couple of threads which all stalled with the same conclusion (or workaround) “configure all channels manually” what is however not trivial for a newcomer, especially as some of the procedures are related to the file-based configuration.
What helped me most was finally the article HomeAssistant MQTT Component: RGBW Color channel set to trigger and especially the YAML code in the article. Based on this did the following:

  1. I created a generic MQTT thing via the web interface
  2. Went to the code tab of the thing and added channels based on the template in the article

Critical is to go in and edit manually the “commandTopic” and “stateTopic” to fit the own installation but to honor the bridge and to adopt the code the kind of bulb - in my case I did not even need javascript code as this bulb has a fixed color. I ended up with the following code:

UID: mqtt:topic:cad71c3aff:aabdc659aa
label: LED Salle à manger
thingTypeUID: mqtt:topic
configuration:
  payloadNotAvailable: offline
  payloadAvailable: online
  transformationPattern: JSONPATH:$.state
  availabilityTopic: zigbee2mqtt/LED SaM/availability
bridgeUID: mqtt:broker:cad71c3aff
channels:
  - id: status
    channelTypeUID: mqtt:switch
    label: State
    description: null
    configuration:
      retained: false
      postCommand: false
      formatBeforePublish: '{"state": "%s"}'
      commandTopic: zigbee2mqtt/LED SaM/set
      stateTopic: zigbee2mqtt/LED SaM
      transformationPattern: JSONPATH:$.state
      off: OFF
      on: ON
  - id: brightness
    channelTypeUID: mqtt:dimmer
    label: Brightness
    description: null
    configuration:
      retained: false
      postCommand: false
      min: 0
      formatBeforePublish: '{"brightness": %s}'
      max: 254
      commandTopic: zigbee2mqtt/LED SaM/set
      step: 1
      stateTopic: zigbee2mqtt/LED SaM
      transformationPattern: JSONPATH:$.brightness
      off: "0"
      on: "1"
  - id: link_quality
    channelTypeUID: mqtt:number
    label: Link Quality
    description: null
    configuration:
      retained: false
      postCommand: false
      min: 0
      formatBeforePublish: "%s"
      max: 255
      step: 1
      stateTopic: zigbee2mqtt/LED SaM
      transformationPattern: JSONPATH:$.linkquality

Now my bulb works in openhab and I was able to add the items into the model :slight_smile:

Now for my concern: Looking at other reports I wonder if there not something more general broken with the discovery of certain zigbee bulbs connected over zigbee2mqtt and how widespread the issue is. My main concern is that the user experience would be better with auto-discovery.
One of the article above refers to the documentation on the MQTT HomeAssistant Binding which indeed states that the binding has some limitations - but I’d expect that the supported interfaces on/off & brightness work in my case (The bulb also has effects which are mentioned as not fully supported - but which are anyhow more exotic)
I really wonder what could be done to track this down (maybe a github ticket on the homeassistant integration) ? I am quite new to openhab and this is also my first zigbee bulb so that I do not know for sure if it is a known limitation, a bug or user-mistake on my end (I played already with the zigbee2mqtt config but without success). Adding manually common things as bulbs is for sure not the best user experience, so that I consider the proposals for manual configuration or to purchase a dedicated hub for Philips bulbs more as a workaround than a solution.

Continuing the discussion from [OH3] Z2M Home Assistance auto discovery creates channel as a trigger:

Hello Georges,

thanks for sharing your experience! In the meantime I could overcome my difficulties with installing my Paulmann Velora lights.
It needed quite some tinkering to get all the parameters right.

They are dimmable and you can set color temperature. Both of which have a certain bandwidth of values they which will accept. The brightness rang is 0 to 254 and the color temperature range is 153 to 350.

Either guesswork or one can use the zigbee2mqtt interface on their openhab server. For the lights, on mine the URL looks something like http://openhab3:7080/#/device/0x000000000000xxxx/exposes. Possibly the easiest way to figure out the capabilities of a zigbee device.

Maybe this could be a timesaver for whoever plays with the thought of implementing Paulmann Velora, here ist the thing code of one of them:

UID: mqtt:topic:MQTTBroker:1bdf878374
label: LichtMudroom
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:MQTTBroker
location: Mudroom
channels:
  - id: LichtMudroomSwitch
    channelTypeUID: mqtt:switch
    label: Licht Mudroom AN/AUS
    description: ""
    configuration:
      commandTopic: zigbee2mqtt/LichtMudroom/set
      qos: 0
      stateTopic: zigbee2mqtt/LichtMudroom
      transformationPattern: JSONPATH:$.state
      off: OFF
      on: ON
  - id: LichtMudroomDimmer
    channelTypeUID: mqtt:dimmer
    label: Licht Mudroom Dimmer
    description: ""
    configuration:
      postCommand: false
      min: 0
      formatBeforePublish: "%d"
      qos: 0
      max: 254
      commandTopic: zigbee2mqtt/LichtMudroom/set/brightness
      stateTopic: zigbee2mqtt/LichtMudroom
      transformationPattern: JSONPATH:$.brightness
  - id: LichtMudroomColorTemp
    channelTypeUID: mqtt:dimmer
    label: Licht Mudroom Color Temperature
    description: ""
    configuration:
      min: 153
      formatBeforePublish: "%d"
      qos: 0
      max: 350
      commandTopic: zigbee2mqtt/LichtMudroom/set/color_temp
      stateTopic: zigbee2mqtt/LichtMudroom
      transformationPattern: JSONPATH:$.color_temp

ThX2all who helped with this!
Cleo