I have a mesh network made out of few zwave, zigbee and wifi items:
- zwave is managed directly via an usb dongle, no issues there,
- wifi - various bridges and connectors, no problem there;
- for zigbee, I have a CC1352P-2 dongle, managed via zigbee2mqtt (v1.42.0) and a mosquito broker (2.0.11).
Till recently, my zigbee2mqtt was configured with homeassistant: false
. I had only few items, it was not a big deal to add them manually as files. They were all the same - more or less - and copy/paste was a great tool.
However, due the increased number of zigbee devices available, I decided to enable device discovery by setting homeassistant: true
. Before doing this, I removed all zigbee items and mqtt broker I added via files, so I can say is basically a fresh zigbee2mqtt installation.
My problem is that after discovery, all items were added, but the channels are pretty much useless. The devices I have exposes on/off features, voltage, energy counter, child lock, led enabled or link quality but if I look in available channels in openhab, I see only child-lock, led-enabled, power sensonr and energy. I cannot see the on/off - which, imo, is basically the most important. The items I have are:
- Niko-170-33505
- Niko-552-721X2
- other smaller passive and active items - but they are in a more or less the same situation;
Here is how I added them before and it worked:
- I manually create a
PlugDummy.items
and aPlugDummy.things
and copied them toitems
respectivelythings
directory under openhab:
Switch PlugDummy_Switch "Switch [%s]" <switch> (Plugs, FirstFloorPlugs, HallwayPlugs) {channel="mqtt:topic:PlugDummy:PlugDummy_Switch"}
Number PlugDummy_Voltage "Voltage" <voltage> {channel="mqtt:topic:PlugDummy:PlugDummy_Voltage"}
Number PlugDummy_Power "Power" <energy> {channel="mqtt:topic:PlugDummy:PlugDummy_Power"}
Number PlugDummy_Current "Current" <ampere> {channel="mqtt:topic:PlugDummy:PlugDummy_Current"}
Number PlugDummy_Linkquality "Link Quality" <qualityofservice> {channel="mqtt:topic:PlugDummy:PlugDummy_Linkquality"}
Thing mqtt:topic:PlugDummy "PlugDummy" (mqtt:broker:mosquitto) @ "Office" {
Channels:
Type switch : PlugDummy_Switch "On/off state of the switch" [
stateTopic="zigbee2mqtt/PlugDummy",
commandTopic="zigbee2mqtt/PlugDummy/set",
on="ON",
off="OFF",
transformationPattern="JSONPATH:$.state",
formatBeforePublish="{\"state\": \"%s\"}"
]
Type number : PlugDummy_Voltage "Measured electrical potential value" [
stateTopic="zigbee2mqtt/PlugDummy",
transformationPattern="JSONPATH:$.voltage"
]
Type number : PlugDummy_Power "Instantaneous measured power" [
stateTopic="zigbee2mqtt/PlugDummy",
transformationPattern="JSONPATH:$.power"
]
Type number : PlugDummy_Current "Instantaneous measured electrical current" [
stateTopic="zigbee2mqtt/PlugDummy",
transformationPattern="JSONPATH:$.current"
]
Type number : PlugDummy_Linkquality "Link quality (signal strength)" [
stateTopic="zigbee2mqtt/PlugDummy",
transformationPattern="JSONPATH:$.linkquality"
]
}
- After restarting openhab, I was able to see the thing in the list (with the lock icon as the thing was provisioned by file), I could see the channels and I could link them to items and do whatever I had to do with them;
- This setup worked.
After cleanning up all old (manually provisioned) zigbee things and enabled discovery in openhab, I saw in my inbox the existing zigbee items. I added all ‘as things’ but if I look at channels, there is no switch or link quality despite the fact that in Configuration
section of the item I can see the topics: sensor/0x086bd7fffeee22c2/linkquality
or switch/0x086bd7fffeee22c2/switch
.
The final code extracted from openhab is this one:
UID: mqtt:homeassistant:mqtt-broker-s01:zigbee2mqtt_5F0x086bd7fffeee22c2
label: PlugDummy
thingTypeUID: mqtt:homeassistant_zigbee2mqtt_5F0x086bd7fffeee22c2
configuration:
topics:
- sensor/0x086bd7fffeee22c2/current
- sensor/0x086bd7fffeee22c2/energy
- sensor/0x086bd7fffeee22c2/last_seen
- sensor/0x086bd7fffeee22c2/linkquality
- sensor/0x086bd7fffeee22c2/power
- sensor/0x086bd7fffeee22c2/voltage
- switch/0x086bd7fffeee22c2/switch
- switch/0x086bd7fffeee22c2/switch_child_lock
- switch/0x086bd7fffeee22c2/switch_led_enable
basetopic: homeassistant
bridgeUID: mqtt:broker:mqtt-broker-s01
channels:
- id: switch_child_lock#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: switch
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","command_topic":"s01/PlugDummy/set/child_lock","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"entity_category":"config","icon":"mdi:account-lock","json_attributes_topic":"s01/PlugDummy","name":"Child
lock","object_id":"PlugDummy_child_lock","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"UNLOCK","payload_on":"LOCK","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_switch_child_lock_s01","value_template":"{{
value_json.child_lock }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- switch_child_lock
- id: switch_child_lock#switch
channelTypeUID: mqtt:ha-switch
label: Child lock
configuration: {}
- id: last_seen#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: sensor
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"timestamp","enabled_by_default":false,"entity_category":"diagnostic","icon":"mdi:clock","json_attributes_topic":"s01/PlugDummy","name":"Last
seen","object_id":"PlugDummy_last_seen","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_last_seen_s01","value_template":"{{
value_json.last_seen }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- last_seen
- id: last_seen#sensor
channelTypeUID: mqtt:ha-string-advanced
label: Last seen
configuration: {}
- id: switch_led_enable#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: switch
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","command_topic":"s01/PlugDummy/set/led_enable","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"entity_category":"config","icon":"mdi:led-on","json_attributes_topic":"s01/PlugDummy","name":"Led
enable","object_id":"PlugDummy_led_enable","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"false","payload_on":"true","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_switch_led_enable_s01","value_template":"{%
if value_json.led_enable %}true{% else %}false{% endif %}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- switch_led_enable
- id: switch_led_enable#switch
channelTypeUID: mqtt:ha-switch
label: Led enable
configuration: {}
- id: linkquality#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: sensor
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"enabled_by_default":false,"entity_category":"diagnostic","icon":"mdi:signal","json_attributes_topic":"s01/PlugDummy","name":"Linkquality","object_id":"PlugDummy_linkquality","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_linkquality_s01","unit_of_measurement":"lqi","value_template":"{{
value_json.linkquality }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- linkquality
- id: linkquality#sensor
channelTypeUID: mqtt:ha-number-advanced
label: Linkquality
configuration: {}
- id: current#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: sensor
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"current","enabled_by_default":false,"entity_category":"diagnostic","json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_current","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_current_s01","unit_of_measurement":"A","value_template":"{{
value_json.current }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- current
- id: current#sensor
channelTypeUID: mqtt:ha-number-advanced
label: MQTT Sensor
configuration: {}
- id: power#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: sensor
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"power","enabled_by_default":true,"entity_category":"diagnostic","json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_power","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_power_s01","unit_of_measurement":"W","value_template":"{{
value_json.power }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- power
- id: power#sensor
channelTypeUID: mqtt:ha-number
label: MQTT Sensor
configuration: {}
- id: energy#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: sensor
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"energy","enabled_by_default":true,"json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_energy","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"total_increasing","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_energy_s01","unit_of_measurement":"kWh","value_template":"{{
value_json.energy }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- energy
- id: energy#sensor
channelTypeUID: mqtt:ha-number
label: MQTT Sensor
configuration: {}
- id: voltage#json-attributes
channelTypeUID: mqtt:ha-string-advanced
label: JSON Attributes
configuration:
component: sensor
config:
- '{"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected
socket outlet
(170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"voltage","enabled_by_default":false,"entity_category":"diagnostic","json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_voltage","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_voltage_s01","unit_of_measurement":"V","value_template":"{{
value_json.voltage }}"}'
nodeid: "0x086bd7fffeee22c2"
objectid:
- voltage
- id: voltage#sensor
channelTypeUID: mqtt:ha-number-advanced
label: MQTT Sensor
configuration: {}
My question is - what am I doing wrong? Have I missed some config in zigbee2mqtt or openhab? Have I made a mistake during the import - should I select a different type of thing?
Update Forgot to mention: in the UI, I can only see 4 channels (standard view):
And in advanced:
I don’t know if it matters or not, I also saw in openhab.log this row related to my thing:
2025-01-05 01:25:43.753 [WARN ] [transport.mqtt.internal.Subscription] - A subscriber of type 'class org.openhab.binding.mqtt.homeassistant.internal.DiscoverComponents' failed to process message '7B22617661696C6162696C697479223A5B7B22746F706963223A227330312F6272696467652F7374617465227D2C7B22746F706963223A227330312F506C756742617468726F6F6D4769726C732F617661696C6162696C697479227D5D2C22617661696C6162696C6974795F6D6F6465223A22616C6C222C22636F6D6D616E645F746F706963223A227330312F506C756742617468726F6F6D4769726C732F736574222C22646576696365223A7B226964656E74696669657273223A5B227A6967626565326D7174745F307830383662643766666665656532326332225D2C226D616E756661637475726572223A224E696B6F222C226D6F64656C223A22436F6E6E656374656420736F636B6574206F75746C657420283137302D33333530352F3137302D333436303529222C226E616D65223A22506C756742617468726F6F6D4769726C73222C2273775F76657273696F6E223A223331332D3238362D3030222C227669615F646576696365223A227A6967626565326D7174745F6272696467655F307830303132346230303163613162323565227D2C226A736F6E5F617474726962757465735F746F706963223A227330312F506C756742617468726F6F6D4769726C73222C226E616D65223A6E756C6C2C226F626A6563745F6964223A22706C756762617468726F6F6D6769726C73222C226F726967696E223A7B226E616D65223A225A6967626565324D515454222C227377223A22312E34322E30222C2275726C223A2268747470733A2F2F7777772E7A6967626565326D7174742E696F227D2C227061796C6F61645F6F6666223A224F4646222C227061796C6F61645F6F6E223A224F4E222C2273746174655F746F706963223A227330312F506C756742617468726F6F6D4769726C73222C22756E697175655F6964223A223078303836626437666666656565323263325F7377697463685F733031222C2276616C75655F74656D706C617465223A227B7B2076616C75655F6A736F6E2E7374617465207D7D227D' to topic 'homeassistant/switch/0x086bd7fffeee22c2/switch/config'.
Update 2: this is my zigbee2mqtt configuration:
homeassistant: true
permit_join: true
mqtt:
base_topic: s01
server: mqtt://localhost
bind: 0.0.0.0
client_id: s01
serial:
port: /dev/ttyZigbee
frontend:
port: 8081
host: 0.0.0.0
experimental:
new_api: true
advanced:
pan_id: 0
network_key:
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
adapter_concurrent: 16
ikea_ota_use_test_url: true
log_syslog:
app_name: Zigbee2MQTT
eol: /n
host: localhost
localhost: localhost
path: /dev/log
pid: process.pid
port: 123
protocol: tcp4
type: '5424'
last_seen: ISO_8601
availability:
active:
timeout: 30
pasive:
timeout: 360
devices:
Update 3. Running mosquitto_sub -h localhost -t "homeassistant/#" -v | grep PlugDummy
returns the following:
homeassistant/sensor/0x086bd7fffeee22c2/power/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"power","enabled_by_default":true,"entity_category":"diagnostic","json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_power","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_power_s01","unit_of_measurement":"W","value_template":"{{ value_json.power }}"}
homeassistant/sensor/0x086bd7fffeee22c2/current/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"current","enabled_by_default":false,"entity_category":"diagnostic","json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_current","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_current_s01","unit_of_measurement":"A","value_template":"{{ value_json.current }}"}
homeassistant/sensor/0x086bd7fffeee22c2/voltage/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"voltage","enabled_by_default":false,"entity_category":"diagnostic","json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_voltage","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_voltage_s01","unit_of_measurement":"V","value_template":"{{ value_json.voltage }}"}
homeassistant/sensor/0x086bd7fffeee22c2/energy/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"energy","enabled_by_default":true,"json_attributes_topic":"s01/PlugDummy","object_id":"PlugDummy_energy","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"total_increasing","state_topic":"s01/PlugBathroomGirl ","unique_id":"0x086bd7fffeee22c2_energy_s01","unit_of_measurement":"kWh","value_template":"{{ value_json.energy }}"}
homeassistant/sensor/0x086bd7fffeee22c2/linkquality/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"enabled_by_default":false,"entity_category":"diagnostic","icon":"mdi:signal","json_attributes_topic":"s01/PlugDummy","name":"Linkquality","object_id":"PlugDummy_linkquality","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_class":"measurement","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_linkquality_s01","unit_of_measurement":"lqi","value_template":"{{ value_json.linkquality }}"}
homeassistant/sensor/0x086bd7fffeee22c2/last_seen/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"device_class":"timestamp","enabled_by_default":false,"entity_category":"diagnostic","icon":"mdi:clock","json_attributes_topic":"s01/PlugDummy","name":"Last seen","object_id":"PlugDummy_last_seen","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_last_seen_s01","value_template":"{{ value_json.last_seen }}"}
homeassistant/switch/0x086bd7fffeee22c2/switch/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","command_topic":"s01/PlugDummy/set","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"json_attributes_topic":"s01/PlugDummy","name":null,"object_id":"PlugDummy","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"OFF","payload_on":"ON","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_switch_s01","value_template":"{{ value_json.state }}"}
homeassistant/switch/0x086bd7fffeee22c2/switch_child_lock/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","command_topic":"s01/PlugDummy/set/child_lock","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"entity_category":"config","icon":"mdi:account-lock","json_attributes_topic":"s01/PlugDummy","name":"Child lock","object_id":"PlugDummy_child_lock","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"UNLOCK","payload_on":"LOCK","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_switch_child_lock_s01","value_template":"{{ value_json.child_lock }}"}
homeassistant/switch/0x086bd7fffeee22c2/switch_led_enable/config {"availability":[{"topic":"s01/bridge/state"},{"topic":"s01/PlugDummy/availability"}],"availability_mode":"all","command_topic":"s01/PlugDummy/set/led_enable","device":{"identifiers":["zigbee2mqtt_0x086bd7fffeee22c2"],"manufacturer":"Niko","model":"Connected socket outlet (170-33505/170-34605)","name":"PlugDummy","sw_version":"313-286-00","via_device":"zigbee2mqtt_bridge_0x00124b001ca1b25e"},"entity_category":"config","icon":"mdi:led-on","json_attributes_topic":"s01/PlugDummy","name":"Led enable","object_id":"PlugDummy_led_enable","origin":{"name":"Zigbee2MQTT","sw":"1.42.0","url":"https://www.zigbee2mqtt.io"},"payload_off":"false","payload_on":"true","state_topic":"s01/PlugDummy","unique_id":"0x086bd7fffeee22c2_switch_led_enable_s01","value_template":"{% if value_json.led_enable %}true{% else %}false{% endif %}"}
The state
option is 3rd from the bottom, so it’s there.
Update 4: During a service restart and besides the warning that a subscriber failed to process message on config topic, I also noticed this error (putting it here in case it’s relevant):
2025-01-05 03:08:50.959 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NullPointerException: Cannot invoke "String.isBlank()" because "result" is null
at org.openhab.binding.mqtt.homeassistant.internal.component.AbstractComponent.getName(AbstractComponent.java:307) ~[?:?]
at java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:473) ~[?:?]
at java.util.Comparator.lambda$thenComparing$36697e65$1(Comparator.java:221) ~[?:?]
at java.util.TimSort.binarySort(TimSort.java:296) ~[?:?]
at java.util.TimSort.sort(TimSort.java:221) ~[?:?]
at java.util.Arrays.sort(Arrays.java:1307) ~[?:?]
at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:353) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.updateThingType(HomeAssistantThingHandler.java:425) ~[?:?]
at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.addComponents(HomeAssistantThingHandler.java:352) ~[?:?]
at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:296) ~[?:?]
at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:1) ~[?:?]
at org.openhab.binding.mqtt.generic.tools.DelayedBatchProcessing.run(DelayedBatchProcessing.java:110) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
Update 5: Apparently, the body of the message that cannot be processed is:
{
"availability": [
{ "topic": "s01/bridge/state" },
{ "topic": "s01/PlugDummy/availability" }
],
"availability_mode": "all",
"command_topic": "s01/PlugDummy/set",
"device": {
"identifiers": ["zigbee2mqtt_0x086bd7fffeee22c2"],
"manufacturer": "Niko",
"model": "Connected socket outlet (170-33505/170-34605)",
"name": "PlugDummy",
"sw_version": "313-286-00",
"via_device": "zigbee2mqtt_bridge_0x00124b001ca1b25e"
},
"json_attributes_topic": "s01/PlugDummy",
"name": "State",
"object_id": "PlugDummy_state",
"origin": {
"name": "Zigbee2MQTT",
"sw": "1.42.0",
"url": "https://www.zigbee2mqtt.io"
},
"payload_off": "OFF",
"payload_on": "ON",
"state_topic": "s01/PlugDummy",
"unique_id": "0x086bd7fffeee22c2_switch_s01",
"value_template": "{{ value_json.state }}"
}