Skip to content

Custom-card "WiFi Signal"

The custom_card_mpse_wifisignal is used to display the status of a wifi signal (dBm). Icon changes based on signal strength.

WiFi Signal

Credits

Author: mpse Version: 0.2.0

Changelog

0.2.0 Cleanup and updated documentation.
0.1.0 Initial release.

Usage

- type: "custom:button-card"
  template: custom_card_mpse_wifisignal
  entity: sensor.wifi_julgran

Requirements

No special cards needed.

Variables

Variable Example Required Explanation
None

Template code

Template Code
custom_card_mpse_wifisignal.yaml
---
custom_card_mpse_wifisignal:
  template:
    - "icon_info_bg"
  icon: |
    [[[
      var icon = "mdi:wifi-strength-off";
      var signal = states[entity.entity_id].state;
      if (signal >= -50) {
        icon = "mdi:wifi-strength-4";
      } else if (signal >= -60) {
        icon = "mdi:wifi-strength-3";
      } else if (signal >= -70) {
        icon = "mdi:wifi-strength-2";
      } else if (signal >= -80) {
        icon = "mdi:wifi-strength-1";
      }
      return icon;
    ]]]
  label: |
    [[[
      return entity.state + " dBm";
    ]]]