New thing doesn't have chanells

  • Platform information:
    • Hardware: TuYa WHD02 zigbee
    • openHAB version: 4.0.3

I have recently mounted and new zigbee switch. When I add (via UI) it as a ‘thing’, it doesn’t discover all its channels. The switch has quite a few properties:

select/0xID/power_on_behavior
select/0xID/switch_type
sensor/0xID/last_seen
sensor/0xID/linkquality
sensor/0xID/power_on_behavior
sensor/0xID/switch_type
switch/0xID/switch

however when the thing has been added only few channels are listed … and the rest is missing:

  • power-on bahavior
  • linkquailty
  • switch type

which means that the most important channel ‘switch’ is not presented, so I can’t link it to the item.

the code of the thing looks a follow:

UID: mqtt:homeassistant_zigbee2mqtt_----UID
label: switch_1
thingTypeUID: mqtt:homeassistant_zigbee2mqtt_ID
configuration:
  topics:
    - select/0xID/power_on_behavior
    - select/0xID/switch_type
    - sensor/0xID/last_seen
    - sensor/0xID/linkquality
    - sensor/0xID/power_on_behavior
    - sensor/0xID/switch_type
    - switch/0xID/switch
  basetopic: homeassistant
bridgeUID: mqtt:broker:mymqttbroker

Can I add missing channels manually?

Because OH has a native Zigbee binding, it is of the utmost importance to make it clear whether you are using that or using zigbee2mqtt.

I can’t really help with zigbee2mqtt issues except vague suggestions to look and see if those topics exist on the broker. Maybe if they don’t exist OH can’t discover them?

Since it’s MQTT you can do anything. But you won’t be able to use HomeAssistant discovery. You’ll have to create and configure a Generic MQTT Thing.

I’m using zigbee2mqtt and all those properties are available, so it’s somehow an issue with OH, as it can’t discover the device properly. As I’m new there, I don’t know all the OH capabilities. Is there a way to add a thing manually, with its all configuration?

See Adding Things - Advanced | openHAB and MQTT Things and Channels - Bindings | openHAB and come back if you still have questions.

I have the exact same issue.
OH discover the thing with all the possible channels.
But OH doesn’t activate alle the channels.
I have this issue since Upgrade to OH 4.x (from 3.x).c
It only appears in combination with the “HomeAssistant MQTT Components Binding”.
Manually configured mqtt things (config file) are working as expected and rock solid.

All topics are available. So its not an issue with the mqtt broker…
Why OH doesn’t add all channels …



1 Like

Yes, that’s exactly the same problem and your device is discovered in the same buggy way.

Would you @portboy be able to share the configuration file for your device, so I use it as a reference?

yes :slight_smile:

You must create a config file for the mqtt things.
Like described here: MQTT Things and Channels - Bindings | openHAB

sniped from my config file

Bridge mqtt:broker:mosqitto [ host="x.x.x.x", secure=false ] {
//Zigbe2MQTT Devices
 //Temp Sensoren
    Thing topic Sens_TempHu_EG_Abg "Sens_TempHu_EG_Abg" {
    Channels:
        Type number : temperature "Temperature Cellar" [ stateTopic="zigbee2mqtt/Sens_TempHu_EG_Abg", transformationPattern="JSONPATH:$.temperature" ]
        Type number : humidity "Humidity Cellar" [ stateTopic="zigbee2mqtt/Sens_TempHu_EG_Abg", transformationPattern="JSONPATH:$.humidity" ]
        Type number : battery "Battery Sens Cellar" [ stateTopic="zigbee2mqtt/Sens_TempHu_EG_Abg", transformationPattern="JSONPATH:$.battery" ]
    }
}
1 Like

I think it’s a bug in the binding
[mqtt][homeassistant] Light misses channels · Issue #14856 · openhab/openhab-addons (github.com)

Thanks for the template as well as pointing to the bug in the OH.

1 Like

Not an expert, but recently set up zwave via mqtt and had numerous issues with the homeassistant configs, so much so that I set up over 100 channels using the generic mqtt, not using homeassistant configs at all.
As to possible thoughts,;
Are there any logged warnings?
Is the jinja transform installed?
What are the channel configs in JSON?
For example: Looking at the issue in github I see one device switch has “ON”, “OFF” & “Toggle”. That is not going to work with a Switch item (IMO).

It could work I think. The switch should never enter the state of Toggle. That’s just a command that should result in the state of ON or OFF. As long as nothing sends “Toggle” to the state topic OH should be fine. OH won’t easily be able to send a Toggle command to the device through the Switch Item, but it would still work.

actually it’s a radom. I have a few different TuYa switches (same model), but each one presented a different channels. E.g. one exposed only ‘link quality’ … so there is nothing much which can be done with that option.

Anyway I have managed to add the thing in the OH configuration file.

I can’t argue with your logic, but let me be more precise with

It is not going to survive the rigorous channel verification. My guess is that’s why it is not appearing as channel but is on the UI tab as a config. I am puzzled by the lack of a log entry, but some of the very early validation routines (in early 2022) were at the debug level.

Still I could be wrong.

That makes sense.

Firstly they have to mark the homassistant integration as “currently not working”.
So not everybody runs in the same trap …

1 Like