Xioami Gateway - How to show all functions?

Heya,

Some time ago a came across a post where someone showed a card in lovelace with almost all functionality.
I just can’t find it anymore.

Do someone know where is is shared or is willing to share their config if they also have it?

Thanks :blush:

@yoinkz I haven’t seen the card you are talking about but would be pretty easy to do with a picture elements card. I’d be happy to have a crack at it for you give me 30mins.

Hey Jim,

Might be me and the fact it wasn’t an actual card and just a card full of entities or so.
But if you would do that for me it would be really appreictaed!

When you have the time sir :slight_smile:

there isn’t much you can do from the gateway itself

add/remove device
play/stop ringtone
turn on/off gateway light (choose led colour)

Is this what you are looking for? The reason I ask is I have made cards for vacuum and fan already.

use the custom monster card

ie:

type: custom:monster-card
card:
  type: glance
  title: Xiaomi stuff
filter:
  include: #[{}]
    - domain: xiaomi_aqara

…might work

EDIT: you would need to add the resource as well (and download the file etc.)

resources:
  - url: /local/custom_ui/monster-card.js?v=0.2.3
    type: js

I can confirm that does indeed not work was worth a shot

I have the basis of a picture elements card just trying to make it look a bit more awesome with the background picture changing when led is turned on

@sparkydave I use this to achieve something similar as to what you were trying to do.

#################################################################
#                                                               #
#                           Xiaomi                              #
#                                                               #
#################################################################

      - id: 63f0f14db1694c5aa6e7c67d06f58088  # Automatically created id
        type: vertical-stack
        cards:
          - type: custom:card-modder
            card:
              type: entity-filter
              entities:
                - binary_sensor.front_door
                - binary_sensor.patio_door
                - binary_sensor.back_door
                - binary_sensor.washer_door
                - binary_sensor.dryer_door
                - binary_sensor.kitchen_window
                - binary_sensor.jackson_window
                - binary_sensor.hudson_window
                - binary_sensor.bathroom_window
                - binary_sensor.bedroom_window
                - binary_sensor.playroom_motion
                - binary_sensor.living_motion
                - binary_sensor.entrance_motion
                - binary_sensor.bedroom_motion
                - binary_sensor.hudson_motion
                - binary_sensor.bathroom_motion
                - binary_sensor.patio_motion
                - binary_sensor.jackson_motion
                - binary_sensor.staircase_motion
                - binary_sensor.downstairs_smoke
                - binary_sensor.upstairs_smoke
                - binary_sensor.jackson_temperature
                - binary_sensor.bedroom_temperature
                - binary_sensor.hudson_temperature
                - binary_sensor.downstairs_temperature
                - binary_sensor.patio_temperature
                - binary_sensor.playroom_temperature
                - binary_sensor.bathroom_temperature
                - binary_sensor.lounge_fan_button
                - binary_sensor.door_button
                - binary_sensor.hudson_fan_button
                - binary_sensor.jackson_fan_button
                - binary_sensor.bedroom_wall_fan_button
                - binary_sensor.bedside_fan_button
                - binary_sensor.washer_switch_plug
                - binary_sensor.entertainment_switch_plug
                - binary_sensor.dryer_switch_plug
                - binary_sensor.appliance_switch_plug
              state_filter:
                - 'off'
              card:
                type: picture-glance
                title: Xiaomi Offline Sensors
                image: /local/lovelace/settings/xiaomi.jpg
            style:                 
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
              overflow: hidden

I thought I’d try since I use the Monster card for z-wave and network (IP) devices and it works perfectly

this is my zwave version:

  - id: 5a7c470113974513887ef37ba21768cf  # Automatically created id
    type: custom:monster-card
    card:
      type: glance
      title: Z-Wave Devices
    filter:
      include: #[{}]
        - domain: zwave
1 Like

Hey Jim,

Yeah that’s it :smile:

Do you have a link for the monstercard?
Can you poste a pic of how it looks like in your HA?

@Yoinkz I tried it, doesn’t work with Xiaomi_Aqara Domain :frowning:

Leave it with me I will make you one, which Ill use myself :+1:

Thanks man, looking forward to it :slight_smile:

@Yoinkz ok this was a little more involved then I first anticipated but here is what I came up with

Will provide a write up when I get home on how to achieve it.

Add this to your config or simply add as a package.

#################################################################
#                                                               #
#                       Packages/Xiaomi                         #
#                                                               #
#################################################################

#################################################################
#                                                               #
#                          Customize                            #
#                                                               #
#################################################################

homeassistant:
  customize:
    input_select.aqara_remove_device:
      icon: fas:minus-square
    input_select.aqara_play_ringtone:
      icon: fas:play
    input_select.aqara_stop_ringtone:
      icon: fas:stop

#################################################################
#                                                               #
#                       Input Selects                           #
#                                                               #
#################################################################

input_select:
      
####################################################
#                                                  #
#            Input Select - Remove Device          #
#                                                  #
####################################################

  aqara_remove_device:
    name: Remove Device
    options:
      - None
      - Front Door Sensor
      - Patio Door Sensor
      - Back Door Sensor
      - Washer Door Sensor
      - Dryer Door Sensor
      - Kitchen Window Sensor
      - Jackson Window Sensor
      - Hudson Window Sensor
      - Bathroom Window Sensor
      - Bedroom Window Sensor
      - Playroom Motion Snesor
      - Livingroom Motion Sensor
      - Entrance Motion Sensor
      - Bedroom Motion Sensor
      - Hudson Motion Sensor
      - Bathroom Motion Sensor
      - Patio Motion Sensor
      - Jackson Motion Sensor
      - Staircase Motion Sensor
      - Wardrobe Motion Sensor
      - Office Motion Sensor
      - Downstairs Smoke Alarm
      - Upstairs Smoke Alarm
      - Jackson Temperature
      - Bedroom Temperature
      - Hudson Temerature
      - Downstairs Temerature
      - Patio Temperature
      - Playroom Temerature
      - Bathroom Temperature
      - Lounge Fan Button
      - Door Button
      - Hudson Fan Button
      - Jackson Fan Button
      - Bedroom Wall Fan Button
      - Bedside Fan Button
      - Washer Switch Plug
      - Entertainment Switch Plug
      - Dryer Switch Plug
      - Appliance Switch Plug
      - Bathroom Leak Sensor
      - Kitchen Leak Sensor
      
####################################################
#                                                  #
#            Input Select - Play Ringtone          #
#                                                  #
####################################################

  aqara_play_ringtone:
    name: Play Ringtone
    options:
      - None
      - Police Car 1
      - Police Car 2
      - Accident
      - Countdown
      - Ghost
      - Sniper Rifle
      - Battle
      - Air Raid
      - Bark
      - Doorbell
      - Knock at a Door
      - Amuse
      - Alarm Clock
      - MiMix
      - Enthusiastic
      - Guitar Classic
      - Ice World Piano
      - Leisure Time
      - Childhood
      - Morning Stream Liet
      - Music Box
      - Orange
      - Thinker
      
####################################################
#                                                  #
#            Input Select - Stop Ringtone          #
#                                                  #
####################################################

  aqara_stop_ringtone:
    name: Stop Ringtone
    options:
      - None
      
#################################################################
#                                                               #
#                       Binary Sensors                          #
#                                                               #
#################################################################

binary_sensor:

####################################################
#                                                  #
#              Binary Sensor - Template            #
#                                                  #
####################################################

  - platform: template
    sensors:
	
	  persistant_notification:
        friendly_name: "Persistant Notification State"
        value_template: "{{ states.persistent_notification.notification.attributes.message.split(' ')[0] }}"

## Gateway State Sensors Lovelace UI
      xiaomi_gw_1_add_device:
        friendly_name: "Xiaomi Gateway 1 Add"
        value_template: >-
          {% if is_state('sensor.persistant_notification', 'Join') %}
            on
          {% else %}
            off
          {% endif %}
        icon_template: >-
          {% if is_state('sensor.persistant_notification', 'Join') %}
            fas:plus-square
          {% else %}
            fas:plus-square
          {% endif %}
   
#################################################################
#                                                               #
#                        Automations                            #
#                                                               #
#################################################################

automation:

  - id: '1547422886219'
    alias: Front Door Sensor Remove
    trigger:
    - entity_id: input_select.aqara_remove_device
      platform: state
      to: Front Door Sensor
    action:
    - data:
        device_id: 158dxxxxxxxxxx
        gw_mac: '!secret xiaomimac'
      service: xiaomi_aqara.remove_device
      
  - id: 'play_0'
    alias: Play Police 1 Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Police Car 1
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '0'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_1'
    alias: Play Police 2 Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Police Car 2
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '1'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_2'
    alias: Play Accident Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Accident
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '2'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_3'
    alias: Play Countdown Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Countdown
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '3'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_4'
    alias: Play Ghost Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Ghost
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '4'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_5'
    alias: Play Sniper Rifle Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Sniper Rifle
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '5'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_6'
    alias: Play Battle Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Battle
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '6'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_7'
    alias: Play Air Raid Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Air Raid
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '7'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_8'
    alias: Play Bark Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Bark
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '8'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_10'
    alias: Play Doorbell Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Doorbell
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '10'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_11'
    alias: Play Knock at a door Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Knock at a Door
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '11'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_12'
    alias: Play Amuse Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Amuse
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '12'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_13'
    alias: Play Alarm Clock Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Alarm Clock
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '13'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_20'
    alias: Play MiMix Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: MiMix
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '20'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_21'
    alias: Play Enthusiastic Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Enthusiastic
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '21'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_22'
    alias: Play Guitar Classic Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Guitar Classic
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '22'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_23'
    alias: Play Ice World Piano Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Ice World Piano
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '23'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_24'
    alias: Play Leisure Time Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Leisure Time
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '24'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_25'
    alias: Play Childhood Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Childhood
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '25'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_26'
    alias: Play Morning Stream Liet Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Morning Stream Liet
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '26'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_27'
    alias: Play Music Box Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Music Box
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '27'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_28'
    alias: Play Orange Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Orange
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '28'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone
      
  - id: 'play_29'
    alias: Play Thinker Ringtone
    trigger:
    - entity_id: input_select.aqara_play_ringtone
      platform: state
      to: Thinker
    action:
    - data:
        gw_mac: '!secret xiaomimac'
        ringtone_id: '29'
        ringtone_vol: '30'
      service: xiaomi_aqara.play_ringtone

Then this to your lovelace.yaml if you want to card rounded like mine you will need to add custom card modder. To use the icons I have you will need to add this custom component FA Icons.

#################################################################
#                                                               #
#                           Xiaomi                              #
#                                                               #
#################################################################

      - id: 63f0f14db1694c5aa6e7c67d06f58088  # Automatically created id
        type: vertical-stack
        cards:
          - type: custom:card-modder
            card:
              type: picture-elements
              image: /local/lovelace/settings/xiaomi_2.png
              elements:
                - type: state-icon
                  entity: sensor.xiaomi_gw_1_add_device
                  tap_action: 
                    action: call-service
                    service: xiaomi_aqara.add_device
                    service_data: {"gw_mac": "xx:xx:xx:xx:xx:xx"}
                  style: {color: white, left: 18%, top: 89%}
                  
                - type: state-icon
                  entity: input_select.aqara_remove_device
                  style: {color: white, left: 36%, top: 89%}
                  
                - type: state-icon
                  entity: input_select.aqara_play_ringtone
                  style: {color: white, left: 51%, top: 89%}
                  
                - type: state-icon
                  entity: input_select.aqara_stop_ringtone
                  tap_action: 
                    action: call-service
                    service: xiaomi_aqara.stop_ringtone
                    service_data: {"gw_mac": "xx:xx:xx:xx:xx:xx"}
                  style: {color: white, left: 66%, top: 89%}
                  
                - type: state-icon
                  entity: light.gateway_light_7811dcfxxxxx
                  style: {color: white, left: 81%, top: 89%}
                  
            style:                 
              border-radius: 20px
              border: solid 1px rgba(100,100,100,0.3)
              box-shadow: 3px 3px rgba(0,0,0,0.4)
              overflow: hidden
2 Likes

OMG - Thank you so much. This is so good looking and really useful.

Much appreciated!

1 Like

Be careful with the remove device list :wink:

I might just comment that part out, at least until I’m a bit more skilled :wink: