diff --git a/automations/automations.yaml b/automations/automations.yaml index e69de29..cf8bcac 100644 --- a/automations/automations.yaml +++ b/automations/automations.yaml @@ -0,0 +1,46 @@ +- 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 \ No newline at end of file diff --git a/configuration.yaml b/configuration.yaml index 7dda004..9c4e4d3 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -17,6 +17,17 @@ recorder: - binary_sensor - person +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 # Updated this to the number of seconds you wish + sensor: !include_dir_merge_list sensors switch: !include_dir_merge_list switches automation: !include_dir_merge_list automations diff --git a/lovelace/home.yaml b/lovelace/home.yaml index 018c1ed..873798d 100644 --- a/lovelace/home.yaml +++ b/lovelace/home.yaml @@ -5,6 +5,14 @@ cards: entity: weather.lug details: false + - type: entities + entities: + - entity: input_boolean.zigbee_permit_join + - entity: timer.zigbee_permit_join + - entity: sensor.bridge_state + show_header_toggle: false + title: Zigbee + title: Home path: home panel: false diff --git a/sensors/mqtt.yaml b/sensors/mqtt.yaml new file mode 100644 index 0000000..5726634 --- /dev/null +++ b/sensors/mqtt.yaml @@ -0,0 +1,4 @@ +- platform: mqtt + name: Bridge state + state_topic: "zigbee2mqtt/bridge/state" + icon: mdi:router-wireless