Skip to content

Instantly share code, notes, and snippets.

@ciotlosm
Last active April 10, 2019 16:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciotlosm/59d160ad49c695a801d9a940a2a387d2 to your computer and use it in GitHub Desktop.
Save ciotlosm/59d160ad49c695a801d9a940a2a387d2 to your computer and use it in GitHub Desktop.
mqtt:
broker: homeassistant # This will have to be your mqtt broker
discovery: true
input_boolean:
zigbee_permit_join:
name: Allow devices to join
initial: off
icon: mdi:cellphone-wireless
timer:
zigbee_permit_join:
name: Time remaining
duration: 600
sensor:
- platform: mqtt
name: Bridge state
state_topic: "zigbee2mqtt/bridge/state"
icon: mdi:router-wireless
group:
zigbee_group:
name: Zigbee
entities:
- input_boolean.zigbee_permit_join
- timer.zigbee_permit_join
- sensor.bridge_state
automation:
- id: enable_zigbee_join
alias: Enable Zigbee joining
hide_entity: true
trigger:
platform: state
entity_id: input_boolean.zigbee_permit_join
to: 'on'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/bridge/config/permit_join
payload: 'true'
- service: timer.start
data:
entity_id: timer.zigbee_permit_join
- id: disable_zigbee_join
alias: Disable Zigbee joining
trigger:
- entity_id: input_boolean.zigbee_permit_join
platform: state
to: 'off'
action:
- data:
payload: 'false'
topic: zigbee2mqtt/bridge/config/permit_join
service: mqtt.publish
- data:
entity_id: timer.zigbee_permit_join
service: timer.cancel
hide_entity: true
- id: disable_zigbee_join_timer
alias: Disable Zigbee joining by timer
hide_entity: true
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.zigbee_permit_join
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt/bridge/config/permit_join
payload: 'false'
- service: input_boolean.turn_off
data:
entity_id: input_boolean.zigbee_permit_join
@ronschaeffer
Copy link

ronschaeffer commented Feb 12, 2019

I got error messages like this to my home assistant log:
No matching payload found for entity: Bridge state with state_topic: zigbee2mqtt/bridge/state

Fixed it with this, maybe update your code?

  • platform: mqtt
    name: Bridge state
    payload_on: "online"
    payload_off: “offline”
    state_topic: "zigbee2mqtt/bridge/state"
    icon: mdi:router-wireless

Is this your config for the sensor: component? That's also not working for me. Should it instead include:

payload_available: "online"
payload_not_available: “offline”

@skjnldsv
Copy link

skjnldsv commented Apr 10, 2019

Hello Thanks for this file! :)
Where do I put this it?
I'm a bit lost!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment