sensor:
  - platform: mqtt
    name: "Bedroom wall switch battery"
    state_topic: "z2m_deconz/bedroom_wall_switch"
    availability_topic: "z2m_deconz/bridge/state"
    unit_of_measurement: "%"
    device_class: "battery"
    value_template: "{{ value_json.battery }}"
  - platform: mqtt
    name: "Bedroom wall switch LQI"
    state_topic: "z2m_deconz/bedroom_wall_switch"
    availability_topic: "z2m_deconz/bridge/state"
    icon: "mdi:signal"
    unit_of_measurement: "lqi"
    value_template: "{{ value_json.linkquality }}"


automation:
  - alias: Bedroom · Aqara Switch
    use_blueprint:
      path: aqara_switch.yaml
      input:
        z2m_topic: "z2m_deconz/bedroom_wall_switch"
        click:
          - service: script.apply_bedroom_pink
          - service: script.music_play
            data:
              playlist: "Songs for a Romantic Evening"
              volume: 0.1
              shuffle: false
          - service: script.sonos_volume_10

        double_click:
          - service: input_select.select_next
            entity_id: input_select.light_color_mode

        hold:
          - service: media_player.media_play_pause
            entity_id: media_player.master_bedroom
