Tracking status of all wifi devices in HA card

How do you (if at all) track status of your wifi devices? I’d like to have all of them in one (big) card. For now i do have them, but i use decluttering template and vertical stack card configured so that i get a list of all devices, like:

name1: IP1 - Wifi strength1 - MAC1
name2: IP2 - Wifi strength2 - MAC2

But, each time i add a new device i have to manually add it to this card. Is there a better way? Something in style of “battery state card” - this card automatically finds all cards with, say word “battery” in entity’s name. The reason i can’t use it (or don’t know how?) is that i have above data in different sensors:

  • sensor.device1_wifi
  • sensor.device1_ip
  • sensor.device1_mac

is there any other way to automate this? So when i’d add a wifi device then it would automatically appear on my card?
Something in style: when “automation” finds, say, “sensor.device1_ip” it will also add in the card “sensor.device1_wifi” and “sensor.device1_mac”, all nice in one line…

Yeah… well…
I absolutely love Thomas’s cards, it’s just… he assumes we all know programming pretty well, so his cards are so poorly supported with expamles… it’s no way that i’ll assemble anything usefull with it…

Did you spot the extensive list of examples (over 10?) in his githubs?

I did, sure. But nothing usefull comes out of my hands… mostly they are made with entities card, which puts only one entity in one line.
BTW… i didn’t mean anything bad with above statement… is kind of logical that “manual” is short, since his cards always have tons of stuff… i guess it’s impossible to explain them all. I’d say that they are more or less ment for advanced users.

You just change that for the card you want to use :bulb:

type: custom:auto-entities
card:
  type: ***your-type-of-card-goes-here***
  title: "Pavel's first auto-entites should show all Wifi strenght entites"
filter:
  include:
    - name: /Wifi strength*/

Trial & Error is your friend :wink:

Yeah, i wish it was that simple…
i guess i didn’t explain very well. So, i have these sensors in every ESPHome module:

sensor:
  - platform: wifi_signal
    name: ${device_name} WiFi
    update_interval: 60s
    internal: false

text_sensor:
  #---------------------------------------------------------------- WIFI info
  - platform: wifi_info
    ip_address:
      name: ${device_name} IP
      internal: false
    mac_address:
      name: ${device_name} MAC
      internal: false
    bssid:
      name: ${device_name} BSSID
      internal: false

So, now i’d like to find, say, “${device_name} IP” and then create one line with:

name Iwifi bssid ip

Note that bssid is internally converted to my router/AP’s name inside card, so i know on which AP is module connected.
So that means that 4 different sensor with same name must be found. I’m not sure that this is even possible, so i studied a bit a different approach:

  • maybe i could change esphome sensors and collect all this data in to one single sensor with attiubutes, but i didn’t find any info if esphome is capable of creating attributes.
  • Second option is to join all data into one sensor inside esphome, say in this form:

name/wifi/mac/bssid

this can be splitted in card (same way as with devices, suggested by guys in THIS topic). But, again, until now i didn’t manage to find any working solution for “joioning” mulitple sensor values into one in side esphome.

Do you need all that Wi-Fi info in individual sensors? Why don’t you create just one sensor per device with all that information (IP, MAC, etc.) as attributes, similar to most of device_tracker sensors?

Something similar to this:

I’d like using attributes more than have a sensor for each parameter, unless I wanna have history for that specific parameter (which probably will be the case for wifi_signal, but not for text sensors).

Why i need it? Well, i guess it goes from back then when i’ve had problems with connection and with this list i could instantly see if any of my modules is offline. Now i’m (hopefiully) done with connection problems, but i think that monitoring of wifi devices is still usefull.

I could create one single sensor in HA, i agree, but then i did nothing…since in this case i’ll have to create one additional manually each time i add another sensor, which i tend to avoid - my goal is that new device will automatically appear on my list when it’s first connected.

As said, It seems that esphome doesn’t support creating attributes in sensors (at least i didn’t find any info about it).
Other option would be to create a kind of template sensor inside esphome with lambda, but this is again out of my knowledge, since i’d have to put together multiple epshome’s sensors in one, say, like:

id(sensor.wifi)+"/"+id(sensor.mac)+"/"+ id(sensor(bssid).

Above code doesn’t work, error says id(…) is only for internal variables…

I have a card for all my esphome WIFI signals, that I originally used to see what the signals were when I upgraded to Unifi. This will create a card with a bar chart of all the signals of any entity that has _wifi_signal in it, you just need to change yours to - entity_id: sensor.*_wifi*

- type: custom:auto-entities
    show_empty: false
    sort:
      method: state
      numeric: true
      reverse: true
    card:
      type: custom:bar-card
      title: WIFI
      positions:
        icon: "off"
      height: 20px
      min: -100
      max: 0
      severity:
        - color: "#cc0000"
          from: -100
          to: -70
        - color: "#914900"
          from: -69
          to: -63
        - color: "#cc6600"
          from: -62
          to: -47
        - color: "#009900"
          from: -46
          to: 0
    filter:
      include:
        - entity_id: sensor.*_wifi_signal*
      exclude:
        - state: "unavailable"

5 Likes

That looks nice!
Well done and thanks for sharing.

Nice one, thanks! That’s definitely way more easily readable than just numbers.

I can’t stop thinking of Edward’s question (why to you need all that info)… and, maybe he is right: maybe i really don’t (anymore)… as said: i created that card back then when i’ve had problems with router settings.

I guess that wifi strength tells me more or less all i need: if wifi signal is “good enough” and/or if device is online. After all, it doesn’t matter which AP is connected to…

So, maybe i am exaggerating “a bit”…?

Agree, I don’t use it anymore, just when I was setting up my APs

that should be something like:

filter:
  include:
    - name: /* IP/

for the custom:auto-entities. That might capture others entities with IP in the name too.

Maybe you want to share the yaml for the card you have at the moment (the one you fill “manually”)? It would be the base to have it filled by “auto-entites” :file_folder:

If there are a few entities you don’t want on the card, just add them to the exclude section.

There are many filters, you could use, eg integration, to allow only esphome to be added

I’m not an expert in ESPHome, so I cannot help here. But if you cannot have attributes, then keep the other data in individual sensors as it is… Play a bit with those cards and I’m sure you will find a way to show the info you are looking for.

Sure. it’s pretty big, though, since it also includes “decluttering template”. Note that clicking on device causes esp module to start rescan wifi. It can happen that module connects to far most AP (it shows by poor wifi signal) and rescan “brings it back” to nearest AP. Ok, that part is not strictly necesarry…

Template:
decluttering_templates:
  signal_modulov:
    card:
      type: custom:vertical-stack-in-card
      cards:
        - entity: '[[wifi_rescan]]'
          name: '[[name]]'
          show_icon: false
          type: custom:button-card
          tap_action:
            action: '[[action]]'
            service: '[[service]]'
            service_data:
              entity_id: '[[wifi_rescan]]'
          confirmation:
            text: Zaženem iskanje WiFi za [[name]] ?
          custom_fields:
            debeem: |
              [[[
               if (states['[[wifi]]'].state !== 'unavailable') return states['[[wifi]]'].state + 'dBm'
              ]]]
            ruter: "[[[ \n  if (states['[[bssid]]'].state =='04:D9:F5:FB:8D:C0') return '\_\_\_MAIN'\n  if (states['[[bssid]]'].state =='04:D4:C4:C3:30:11') return '\_\_\_KLET'\n  if (states['[[bssid]]'].state =='24:4B:FE:BC:C8:59') return '1.nadstr.'\n  if (states['[[bssid]]'].state =='7C:10:C9:30:44:A1') return '\_Ex.vhod'\n  if (states['[[bssid]]'].state =='7C:10:C9:30:71:09') return 'Ex.garaža'\n]]]\n"
            ajpi: |
              [[[ 
               if (states['[[ip]]'].state !== 'unavailable') return states['[[ip]]'].state
                else
                return 'Ni na voljo!'
              ]]]
          styles:
            custom_fields:
              debeem:
                - position: absolute
                - left: 33%
                - color: |
                    [[[ 
                    var zacasna = states['[[wifi]]'].state;
                    var nivo = parseFloat(parseFloat(zacasna).toFixed(0));
                    if (nivo >= -85)
                    return "cyan"
                      else
                    return 'red'
                    ]]]
              ruter:
                - position: absolute
                - left: 50%
                - color: lime
              ajpi:
                - position: absolute
                - left: 70%
                - color: yellow
            card:
              - height: 25px
              - padding: 0px 0px 0px 0px
            name:
              - justify-self: left

card:

type: custom:vertical-stack-in-card
cards:
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Infra peč
      - action: call-service
      - service: button.press
      - wifi_rescan: button.kopalnica_infra_pec_wifi_rescan
      - wifi: sensor.kopalnica_infra_pec_wifi
      - bssid: sensor.kopalnica_infra_pec_bssid
      - ip: sensor.kopalnica_infra_pec_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Dnevna luč
      - action: call-service
      - service: button.press
      - wifi_rescan: button.dnevna_dvojno_stikalo_wifi_rescan
      - wifi: sensor.dnevna_dvojno_stikalo_wifi
      - bssid: sensor.dnevna_dvojno_stikalo_bssid
      - ip: sensor.dnevna_dvojno_stikalo_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Aleš roleta
      - action: call-service
      - service: button.press
      - wifi_rescan: button.ales_roleta_wifi_rescan
      - wifi: sensor.ales_roleta_wifi
      - bssid: sensor.ales_roleta_bssid
      - ip: sensor.ales_roleta_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Klet komarček
      - action: call-service
      - service: button.press
      - wifi_rescan: button.delavnica_wifi_rescan
      - wifi: sensor.delavnica_wifi
      - bssid: sensor.delavnica_bssid
      - ip: sensor.delavnica_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Garaža
      - action: call-service
      - service: button.press
      - wifi_rescan: button.garaza_wifi_rescan
      - wifi: sensor.garaza_wifi
      - bssid: sensor.garaza_bssid
      - ip: sensor.garaza_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: CAME
      - action: call-service
      - service: button.press
      - wifi_rescan: button.zunaj_came_wifi_rescan
      - wifi: sensor.zunaj_came_wifi
      - bssid: sensor.zunaj_came_bssid
      - ip: sensor.zunaj_came_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Shramba
      - action: call-service
      - service: button.press
      - wifi_rescan: button.shramba_wifi_rescan
      - wifi: sensor.wifi_shramba
      - bssid: sensor.bssid_shramba
      - ip: sensor.ip_shramba
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Tecnoalarm
      - action: call-service
      - service: button.press
      - wifi_rescan: button.tecnoalarm_wifi_rescan
      - wifi: sensor.wifi_tecnoalarm
      - bssid: sensor.bssid_tecnoalarm
      - ip: sensor.ip_tecnoalarm
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Zunaj ZADAJ
      - action: call-service
      - service: button.press
      - wifi_rescan: button.zunaj_zadaj_wifi_rescan
      - wifi: sensor.wifi_zunaj_zadaj
      - bssid: sensor.bssid_zadaj
      - ip: sensor.ip_zadaj
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Zunaj SPREDAJ
      - action: call-service
      - service: button.press
      - wifi_rescan: button.zunaj_spredaj_wifi_rescan
      - wifi: sensor.wifi_zunaj_spredaj
      - bssid: sensor.bssid_zunaj_spredaj
      - ip: sensor.ip_zunaj_spredaj
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Ani soba
      - action: call-service
      - service: button.press
      - wifi_rescan: button.ani_soba_wifi_rescan
      - wifi: sensor.wifi_ani_stikalo
      - bssid: sensor.bssid_ani_stikalo
      - ip: sensor.ip_ani_stikalo
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Pavle soba LUČ
      - action: call-service
      - service: button.press
      - wifi_rescan: button.pavle_dimmer_wifi_rescan
      - wifi: sensor.pavle_dimmer_wifi
      - bssid: sensor.pavle_dimmer_bssid
      - ip: sensor.pavle_dimmer_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Pasja voda
      - action: call-service
      - service: button.press
      - wifi_rescan: button.pasja_voda_wifi_rescan
      - wifi: sensor.pasja_voda_wifi
      - bssid: sensor.pasja_voda_bssid
      - ip: sensor.pasja_voda_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Ani roleta
      - action: call-service
      - service: button.press
      - wifi_rescan: button.ani_roleta_wifi_rescan
      - wifi: sensor.ani_roleta_wifi
      - bssid: sensor.ani_roleta_bssid
      - ip: sensor.ani_roleta_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Pavle roleta
      - action: call-service
      - service: button.press
      - wifi_rescan: button.pavle_roleta_wifi_rescan
      - wifi: sensor.pavle_roleta_wifi
      - bssid: sensor.pavle_roleta_bssid
      - ip: sensor.pavle_roleta_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: ONKYO
      - action: call-service
      - service: button.press
      - wifi_rescan: button.suko_vticnica_2_wifi_rescan
      - wifi: sensor.wifi_vticnica_2
      - bssid: sensor.bssid_vticnica_2
      - ip: sensor.ip_vticnica_2
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Kuhinja roleta
      - action: call-service
      - service: button.press
      - wifi_rescan: button.kuhinja_roleta_wifi_rescan
      - wifi: sensor.kuhinja_roleta_wifi
      - bssid: sensor.kuhinja_roleta_bssid
      - ip: sensor.kuhinja_roleta_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Dnevna roleta D
      - action: call-service
      - service: button.press
      - wifi_rescan: button.dnevna_soba_roleta_desno_wifi_rescan
      - wifi: sensor.dnevna_soba_roleta_desno_wifi
      - bssid: sensor.dnevna_soba_roleta_desno_bssid
      - ip: sensor.dnevna_soba_roleta_desno_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Vetrolov vtičnica
      - action: call-service
      - service: button.press
      - wifi_rescan: button.vticnica_veranda_wifi_rescan
      - wifi: sensor.vticnica_veranda_wifi
      - bssid: sensor.vticnica_veranda_bssid
      - ip: sensor.vticnica_veranda_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Dnevna roleta L
      - action: call-service
      - service: button.press
      - wifi_rescan: button.dnevna_soba_roleta_levo_wifi_rescan
      - wifi: sensor.dnevna_soba_roleta_levo_wifi
      - bssid: sensor.dnevna_soba_roleta_levo_bssid
      - ip: sensor.dnevna_soba_roleta_levo_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Hodnik luč
      - action: call-service
      - service: button.press
      - wifi_rescan: button.hodnik_pritlicje_luc_wifi_rescan
      - wifi: sensor.hodnik_pritlicje_luc_wifi
      - bssid: sensor.hodnik_pritlicje_luc_bssid
      - ip: sensor.hodnik_pritlicje_luc_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: ESP32 klet
      - action: call-service
      - service: button.press
      - wifi_rescan: button.bt_klet_wifi_rescan
      - wifi: sensor.bt_klet_wifi
      - bssid: sensor.bt_klet_bssid
      - ip: sensor.bt_klet_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Miza elektronika
      - action: call-service
      - service: button.press
      - wifi_rescan: button.klet_miza_elektronika_wifi_rescan
      - wifi: sensor.klet_miza_elektronika_wifi
      - bssid: sensor.klet_miza_elektronika_bssid
      - ip: sensor.klet_miza_elektronika_ip
  - type: custom:decluttering-card
    template: signal_modulov
    variables:
      - name: Biodom
      - action: call-service
      - service: button.press
      - wifi_rescan: button.biodom_wifi_rescan
      - wifi: sensor.biodom_wifi
      - bssid: sensor.biodom_bssid
      - ip: sensor.biodom_ip