I’m using the following setup (all using the latest versions as of 5th of november 2023) all is running default:
- RaspberryPi4
- Docker
- Openhab4 (in a Container)
- Zigbee2MQTT (+ USB dongle) in a Container, (MQTT output type = attribute).
- Mosquitto (MQTT) in a Container
- Note: NO PHILIPS HUE BRIDGE INVOLVED.
I’ve successfully connected my lights to Z2M, see the online/offline status and can control them.
Added the MQTT binding.
OpenHab doesn’t auto-detect them, so I had to add them manually, as a generic mqtt thing an example below:
UID: mqtt:topic:Mosquitto:KantoorLamp1
label: Kantoor - Lamp 1
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: offline
availabilityTopic: zigbee2mqtt/Kantoor - Lamp 1/availability
payloadAvailable: online
bridgeUID: mqtt:broker:Mosquitto
location: Kantoor
channels:
- id: kantoorlamp1onoff
channelTypeUID: mqtt:switch
label: Kantoor- Lamp 1 - on/off
description: ""
configuration:
commandTopic: zigbee2mqtt/Kantoor - Lamp 1/set
stateTopic: zigbee2mqtt/Kantoor - Lamp 1/state
off: off
on: on
- id: KantoorLamp1Brightness
channelTypeUID: mqtt:dimmer
label: Kantoor - Lamp 1 - Dimmer
description: ""
configuration:
commandTopic: zigbee2mqtt/Kantoor - Lamp 1/set/brightness
min: 0
stateTopic: zigbee2mqtt/Kantoor - Lamp 1/brightness
max: 254
This allows me to control the light (on/off, brightness) perfectly via OpenHAB.
However, it shows “offline”.
Any clue on how I can resolve this? Breaking my head over this for a few days now.
Tried to use with & without spaces in the light name, no difference (and why should it, controlling the lights works perfectly).