Yes I did. I’m not sure, but I assume that you included your thing in a mqtt-bridge configuration. Here is my thing definition:
Bridge mqtt:broker:zigbeeBroker [ host="YourHostname", secure=false, username="your_username", password="your_password" ]
{
Thing topic permit_join "Z Permit Join"
{
Channels:
Type switch : permit_join [ stateTopic="zigbee2mqtt/bridge/config/permit_join",on="true", off="false" , commandTopic="zigbee2mqtt/bridge/config/permit_join", on="true", off="false"]
}
}
I used your Item, just changed the name of the mqtt broker (mine is zigbeeBroker)
Switch zPermitJoin "Zigbee Permit Join 2 min" (gXiaomi) { channel="mqtt:topic:zigbeeBroker:permit_join:permit_join"}
Or if you want it to auto expire after 2 minutes and having the expire Binding
installed you can define your Item (this is what @chrode obviously initially tried when you look at the name of the item)
Switch zPermitJoin "Zigbee Permit Join 2 min" (gXiaomi) { channel="mqtt:topic:zigbeeBroker:permit_join:permit_join", expire="120s,command=OFF"}
Switching it on I got as a result the following lines in the log file of zigbee2mqtt:
May 16 ... 10:29:00: Zigbee: allowing new devices to join.
May 16 ... 10:29:00: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.12.0","commit":"840b9d9","coordinator":{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}},"log_level":"info","permit_join":true}'
Switching it off:
May 16 ... 10:28:27: Zigbee: disabling joining new devices.
May 16 ... 10:28:27: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.12.0","commit":"840b9d9","coordinator":{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}},"log_level":"info","permit_join":false}'
Thanks @chrode for the good Idea. So now you can disable permit_join
in the configuration.yaml
:
permit_join: false
And only when you want to add a new device make your system accept devices by switching it on via OpenHAB and either switching it off manually or by a timer.