diff --git a/config/lovelace/advanced_dashboard/10_system.yaml b/config/lovelace/advanced_dashboard/10_system.yaml index 2298d7c..22f1162 100644 --- a/config/lovelace/advanced_dashboard/10_system.yaml +++ b/config/lovelace/advanced_dashboard/10_system.yaml @@ -73,8 +73,10 @@ cards: entities: - type: custom:battery-entity entity: sensor.desk_switch_battery - # - type: custom:battery-entity - # entity: sensor.master_bedroom_bedside_switch_power + - type: custom:battery-entity + entity: sensor.bedside_switch_battery + - type: custom:battery-entity + entity: sensor.bedroom_wall_switch_battery # - type: custom:battery-entity # entity: sensor.master_bedroom_switch_power # - type: custom:battery-entity @@ -86,11 +88,12 @@ cards: - type: entities title: Zigbee2MQTT link quality entities: - - sensor.front_door_lqi - sensor.desk_switch_lqi - - sensor.bed_led_lqi - sensor.living_room_right_window_lqi - type: divider + - sensor.bedside_switch_lqi + # - sensor.bed_led_lqi + - sensor.bedroom_wall_switch_lqi - sensor.bedroom_door_lqi - sensor.bedroom_left_window_lqi - sensor.bedroom_right_window_lqi @@ -101,6 +104,7 @@ cards: - sensor.kitchen_motion_lqi - type: divider - sensor.bathroom_weather_lqi + - sensor.front_door_lqi - sensor.hallway_weather_lqi - sensor.hallway_motion_lqi - type: custom:vertical-stack-in-card diff --git a/config/packages/devices/bedroom/bedside_switch.yaml b/config/packages/devices/bedroom/bedside_switch.yaml index fb7d3f4..6945b08 100644 --- a/config/packages/devices/bedroom/bedside_switch.yaml +++ b/config/packages/devices/bedroom/bedside_switch.yaml @@ -1,11 +1,40 @@ +sensor: + - platform: mqtt + name: "Bedside switch click" + state_topic: "zigbee2mqtt/bedside_switch" + availability_topic: "zigbee2mqtt/bridge/state" + icon: "mdi:toggle-switch" + value_template: "{{ value_json.click }}" + - platform: mqtt + name: "Bedside switch battery" + state_topic: "zigbee2mqtt/bedside_switch" + availability_topic: "zigbee2mqtt/bridge/state" + unit_of_measurement: "%" + device_class: "battery" + value_template: "{{ value_json.battery }}" + - platform: mqtt + name: "Bedside switch action" + state_topic: "zigbee2mqtt/bedside_switch" + availability_topic: "zigbee2mqtt/bridge/state" + icon: "mdi:gesture-double-tap" + value_template: "{{ value_json.action }}" + - platform: mqtt + name: "Bedside switch LQI" + state_topic: "zigbee2mqtt/bedside_switch" + availability_topic: "zigbee2mqtt/bridge/state" + icon: "mdi:signal" + unit_of_measurement: "lqi" + value_template: "{{ value_json.linkquality }}" + automation: - alias: Lighting · Master bedroom · Toggle lights on bedside switch single click trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_bedside_switch_ieee - command: single + platform: mqtt + topic: "zigbee2mqtt/bedside_switch" + condition: + - condition: state + entity_id: sensor.bedside_switch_click + state: 'single' action: - service: light.toggle data_template: @@ -28,11 +57,12 @@ automation: - alias: Lighting · Master bedroom · Toggle ambient lights on bedside switch double click trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_bedside_switch_ieee - command: double + platform: mqtt + topic: "zigbee2mqtt/bedside_switch" + condition: + - condition: state + entity_id: sensor.bedside_switch_click + state: 'double' action: - service: light.toggle data_template: @@ -43,11 +73,9 @@ automation: - alias: House mode · Toggle on bedside switch hold trigger: - - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_bedside_switch_ieee - command: hold + platform: state + entity_id: sensor.bedside_switch_action + to: 'hold' action: - service: input_select.select_next entity_id: input_select.house_mode diff --git a/config/packages/devices/bedroom/wall_switch.yaml b/config/packages/devices/bedroom/wall_switch.yaml index 8bf6059..3cda712 100644 --- a/config/packages/devices/bedroom/wall_switch.yaml +++ b/config/packages/devices/bedroom/wall_switch.yaml @@ -1,11 +1,41 @@ +sensor: + - platform: mqtt + name: "Bedroom wall switch click" + state_topic: "zigbee2mqtt/bedroom_wall_switch" + availability_topic: "zigbee2mqtt/bridge/state" + icon: "mdi:toggle-switch" + value_template: "{{ value_json.click }}" + - platform: mqtt + name: "Bedroom wall switch battery" + state_topic: "zigbee2mqtt/bedroom_wall_switch" + availability_topic: "zigbee2mqtt/bridge/state" + unit_of_measurement: "%" + device_class: "battery" + value_template: "{{ value_json.battery }}" + - platform: mqtt + name: "Bedroom wall switch action" + state_topic: "zigbee2mqtt/bedroom_wall_switch" + availability_topic: "zigbee2mqtt/bridge/state" + icon: "mdi:gesture-double-tap" + value_template: "{{ value_json.action }}" + - platform: mqtt + name: "Bedroom wall switch LQI" + state_topic: "zigbee2mqtt/bedroom_wall_switch" + availability_topic: "zigbee2mqtt/bridge/state" + icon: "mdi:signal" + unit_of_measurement: "lqi" + value_template: "{{ value_json.linkquality }}" + + automation: - alias: Lighting · Master bedroom · Toggle lights on switch single click trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_switch_ieee - command: single + platform: mqtt + topic: "zigbee2mqtt/bedroom_wall_switch" + condition: + - condition: state + entity_id: sensor.bedroom_wall_switch_click + state: 'single' action: - service: light.toggle data_template: @@ -20,11 +50,12 @@ automation: - alias: Lighting · Master bedroom · Toggle ambient lights on switch double click trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_switch_ieee - command: double + platform: mqtt + topic: "zigbee2mqtt/bedroom_wall_switch" + condition: + - condition: state + entity_id: sensor.bedroom_wall_switch_click + state: 'double' action: - service: light.toggle data_template: @@ -35,11 +66,9 @@ automation: - alias: Music · Master bedroom · Play pause on switch hold trigger: - platform: event - event_type: zha_event - event_data: - device_ieee: !secret master_bedroom_switch_ieee - command: hold + platform: state + entity_id: sensor.bedroom_wall_switch_action + to: 'hold' action: - service: media_player.media_play_pause entity_id: media_player.master_bedroom diff --git a/config/packages/devices/living_room/desk_switch.yaml b/config/packages/devices/living_room/desk_switch.yaml index 2aec8a2..b12eee4 100644 --- a/config/packages/devices/living_room/desk_switch.yaml +++ b/config/packages/devices/living_room/desk_switch.yaml @@ -37,10 +37,6 @@ automation: entity_id: sensor.desk_switch_click state: 'single' action: - - service: logbook.log - data: - name: "Debug · " - message: "Desk switch single click toggled" - service: light.toggle data_template: entity_id: light.living_room_ceiling