Skip to content

Commit

Permalink
fix log level settings for zigbee2mqtt
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed Mar 21, 2019
1 parent 90010c6 commit 2c01603
Showing 1 changed file with 109 additions and 129 deletions.
238 changes: 109 additions & 129 deletions packages/zigbee2mqtt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ sensor:
name: Zigbee2mqtt1 Bridge state
state_topic: "zigbee2mqtt1/bridge/state"
icon: mdi:router-wireless
- platform: mqtt
name: Zigbee2mqtt2 Bridge state
state_topic: "zigbee2mqtt2/bridge/state"
icon: mdi:router-wireless
# - platform: mqtt
# name: Zigbee2mqtt2 Bridge state
# state_topic: "zigbee2mqtt2/bridge/state"
# icon: mdi:router-wireless

input_boolean:
zigbee_permit_join:
Expand All @@ -21,10 +21,10 @@ input_boolean:
name: Allow devices to join 1
initial: off
icon: mdi:cellphone-wireless
zigbee_permit_join2:
name: Allow devices to join 2
initial: off
icon: mdi:cellphone-wireless
# zigbee_permit_join2:
# name: Allow devices to join 2
# initial: off
# icon: mdi:cellphone-wireless

input_select:
zigbee2mqtt_log_level:
Expand All @@ -45,15 +45,15 @@ input_select:
- error
initial: info
icon: mdi:format-list-bulleted
zigbee2mqtt_log_level2:
name: Zigbee2mqtt2 Log Level
options:
- debug
- info
- warn
- error
initial: info
icon: mdi:format-list-bulleted
# zigbee2mqtt_log_level2:
# name: Zigbee2mqtt2 Log Level
# options:
# - debug
# - info
# - warn
# - error
# initial: info
# icon: mdi:format-list-bulleted

switch:
- platform: mqtt
Expand All @@ -68,12 +68,12 @@ switch:
command_topic: "zigbee2mqtt1/bridge/config/permit_join"
payload_on: "true"
payload_off: "false"
- platform: mqtt
name: "Zigbee2mqtt2 Main join"
state_topic: "zigbee2mqtt2/bridge/config/permit_join"
command_topic: "zigbee2mqtt2/bridge/config/permit_join"
payload_on: "true"
payload_off: "false"
# - platform: mqtt
# name: "Zigbee2mqtt2 Main join"
# state_topic: "zigbee2mqtt2/bridge/config/permit_join"
# command_topic: "zigbee2mqtt2/bridge/config/permit_join"
# payload_on: "true"
# payload_off: "false"

timer:
zigbee_permit_join:
Expand All @@ -82,9 +82,9 @@ timer:
zigbee_permit_join1:
name: Time remaining 1
duration: 120
zigbee_permit_join2:
name: Time remaining 2
duration: 120
# zigbee_permit_join2:
# name: Time remaining 2
# duration: 120

automation:
#################################################################
Expand All @@ -96,20 +96,10 @@ automation:
trigger:
- platform: state
entity_id: input_select.zigbee2mqtt_log_level
to: debug
- platform: state
entity_id: input_select.zigbee2mqtt_log_level
to: warn
- platform: state
entity_id: input_select.zigbee2mqtt_log_level
to: error
- platform: state
entity_id: input_select.zigbee2mqtt_log_level
to: info
action:
- service: mqtt.publish
data:
payload_template: '{{ states(''input_select.zigbee2mqtt_log_level'') }}'
payload_template: '{{ states('input_select.zigbee2mqtt_log_level') }}'
topic: zigbee2mqtt/bridge/config/log_level

- id: enable_zigbee_join
Expand Down Expand Up @@ -176,26 +166,16 @@ automation:
#################################################################
## 1
#################################################################
- id: zigbee2mqtt1_log_level
- id: zigbee2mqtt_log_level1
alias: Zigbee2mqtt1 Log Level
initial_state: 'on'
trigger:
- platform: state
entity_id: input_select.zigbee2mqtt1_log_level
to: debug
- platform: state
entity_id: input_select.zigbee2mqtt1_log_level
to: warn
- platform: state
entity_id: input_select.zigbee2mqtt1_log_level
to: error
- platform: state
entity_id: input_select.zigbee2mqtt1_log_level
to: info
entity_id: input_select.zigbee2mqtt_log_level1
action:
- service: mqtt.publish
data:
payload_template: '{{ states(''input_select.zigbee2mqtt1_log_level'') }}'
payload_template: '{{ states('input_select.zigbee2mqtt_log_level1') }}'
topic: zigbee2mqtt1/bridge/config/log_level

- id: enable_zigbee_join1
Expand Down Expand Up @@ -262,89 +242,89 @@ automation:
#################################################################
## 2
#################################################################
- id: zigbee2mqtt_log_level2
alias: Zigbee2mqtt2 Log Level
initial_state: 'on'
trigger:
- platform: state
entity_id: input_select.zigbee2mqtt_log_level2
to: debug
- platform: state
entity_id: input_select.zigbee2mqtt_log_level2
to: warn
- platform: state
entity_id: input_select.zigbee2mqtt_log_level2
to: error
- platform: state
entity_id: input_select.zigbee2mqtt_log_level2
to: info
action:
- service: mqtt.publish
data:
payload_template: '{{ states(''input_select.zigbee2mqtt_log_level2'') }}'
topic: zigbee2mqtt2/bridge/config/log_level
# - id: zigbee2mqtt_log_level2
# alias: Zigbee2mqtt2 Log Level
# initial_state: 'on'
# trigger:
# - platform: state
# entity_id: input_select.zigbee2mqtt_log_level2
# to: debug
# - platform: state
# entity_id: input_select.zigbee2mqtt_log_level2
# to: warn
# - platform: state
# entity_id: input_select.zigbee2mqtt_log_level2
# to: error
# - platform: state
# entity_id: input_select.zigbee2mqtt_log_level2
# to: info
# action:
# - service: mqtt.publish
# data:
# payload_template: '{{ states(''input_select.zigbee2mqtt_log_level2'') }}'
# topic: zigbee2mqtt2/bridge/config/log_level

- id: enable_zigbee_join2
alias: Enable Zigbee joining 2
hide_entity: true
trigger:
platform: state
entity_id: input_boolean.zigbee_permit_join2
to: 'on'
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt2/bridge/config/permit_join
payload: 'true'
- service: timer.start
data:
entity_id: timer.zigbee_permit_join2
# - id: enable_zigbee_join2
# alias: Enable Zigbee joining 2
# hide_entity: true
# trigger:
# platform: state
# entity_id: input_boolean.zigbee_permit_join2
# to: 'on'
# action:
# - service: mqtt.publish
# data:
# topic: zigbee2mqtt2/bridge/config/permit_join
# payload: 'true'
# - service: timer.start
# data:
# entity_id: timer.zigbee_permit_join2

- id: disable_zigbee_join2
alias: Disable Zigbee joining 2
hide_entity: true
trigger:
- entity_id: input_boolean.zigbee_permit_join2
platform: state
to: 'off'
action:
- data:
payload: 'false'
topic: zigbee2mqtt2/bridge/config/permit_join
service: mqtt.publish
- data:
entity_id: timer.zigbee_permit_join2
service: timer.cancel
# - id: disable_zigbee_join2
# alias: Disable Zigbee joining 2
# hide_entity: true
# trigger:
# - entity_id: input_boolean.zigbee_permit_join2
# platform: state
# to: 'off'
# action:
# - data:
# payload: 'false'
# topic: zigbee2mqtt2/bridge/config/permit_join
# service: mqtt.publish
# - data:
# entity_id: timer.zigbee_permit_join2
# service: timer.cancel

- id: disable_zigbee_join_timer2
alias: Disable Zigbee joining by timer 2
hide_entity: true
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.zigbee_permit_join2
action:
- service: mqtt.publish
data:
topic: zigbee2mqtt2/bridge/config/permit_join
payload: 'false'
- service: input_boolean.turn_off
data:
entity_id: input_boolean.zigbee_permit_join2
# - id: disable_zigbee_join_timer2
# alias: Disable Zigbee joining by timer 2
# hide_entity: true
# trigger:
# - platform: event
# event_type: timer.finished
# event_data:
# entity_id: timer.zigbee_permit_join2
# action:
# - service: mqtt.publish
# data:
# topic: zigbee2mqtt2/bridge/config/permit_join
# payload: 'false'
# - service: input_boolean.turn_off
# data:
# entity_id: input_boolean.zigbee_permit_join2

- id: alert_zigbee_bridge_offline2
alias: 'Alarm wenn Zigbee2Mqtt2 offline'
initial_state: 'on'
trigger:
- entity_id: sensor.zigbee2mqtt2_bridge_state
platform: state
to: 'offline'
action:
- service: notify.kevin
data:
title: 'Zigbee2Mqtt2 offline'
message: "Zigbee2Mqtt2 ist offline"
# - id: alert_zigbee_bridge_offline2
# alias: 'Alarm wenn Zigbee2Mqtt2 offline'
# initial_state: 'on'
# trigger:
# - entity_id: sensor.zigbee2mqtt2_bridge_state
# platform: state
# to: 'offline'
# action:
# - service: notify.kevin
# data:
# title: 'Zigbee2Mqtt2 offline'
# message: "Zigbee2Mqtt2 ist offline"
#################################################################
## Map
#################################################################
Expand Down

0 comments on commit 2c01603

Please sign in to comment.