From 50eb076c70537ea9ae435a273ba6f454c2723fc2 Mon Sep 17 00:00:00 2001 From: rlowens <35885181+rlowens@users.noreply.github.com> Date: Wed, 19 Oct 2022 01:18:09 -0500 Subject: [PATCH 1/3] Add example workaround for static uniqueid Since the sensor's uniqueid is static you have to use the copy sensor instead. Here's an example of doing that. --- components/sensor/wifi_signal.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/components/sensor/wifi_signal.rst b/components/sensor/wifi_signal.rst index 1fa639678..1458b0cbc 100644 --- a/components/sensor/wifi_signal.rst +++ b/components/sensor/wifi_signal.rst @@ -23,6 +23,26 @@ measured in decibel-milliwatts (dBm). These values are always negative and the c name: "WiFi Signal Sensor" update_interval: 60s +Note: since this sensor has a static uniqueid reported to Home Assistant, you can only have one sensor of this type in a device. If you want to have another, use the :ref:`copy-sensor`: + +.. code-block:: yaml + + # Example configuration entry with 2 sensors and filter + sensor: + - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB + name: "WiFi Signal dB" + id: wifi_signal_db + update_interval: 60s + entity_category: "diagnostic" + + - platform: copy # Reports the WiFi signal strength in % + source_id: wifi_signal_db + name: "WiFi Signal Percent" + filters: + - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); + unit_of_measurement: "Signal %" + entity_category: "diagnostic" + Configuration variables: ------------------------ From d0a95ef5af060e8acb1289464ae5149756a982fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=2E=20=C3=81rkosi=20R=C3=B3bert?= Date: Mon, 28 Nov 2022 11:02:41 +0100 Subject: [PATCH 2/3] Update wifi_signal.rst --- components/sensor/wifi_signal.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/sensor/wifi_signal.rst b/components/sensor/wifi_signal.rst index 1458b0cbc..79b9e9412 100644 --- a/components/sensor/wifi_signal.rst +++ b/components/sensor/wifi_signal.rst @@ -23,7 +23,7 @@ measured in decibel-milliwatts (dBm). These values are always negative and the c name: "WiFi Signal Sensor" update_interval: 60s -Note: since this sensor has a static uniqueid reported to Home Assistant, you can only have one sensor of this type in a device. If you want to have another, use the :ref:`copy-sensor`: +Note: since this sensor has a static uniqueid reported to Home Assistant, you can only have one sensor of this type in a device. If you want to have another, use the :ref:`_copy_sensor`: .. code-block:: yaml From ecd9c97f57d0fdd36a7c5168b977fcc8aec26774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=2E=20=C3=81rkosi=20R=C3=B3bert?= Date: Mon, 28 Nov 2022 11:11:15 +0100 Subject: [PATCH 3/3] Update wifi_signal.rst --- components/sensor/wifi_signal.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/sensor/wifi_signal.rst b/components/sensor/wifi_signal.rst index 79b9e9412..710902806 100644 --- a/components/sensor/wifi_signal.rst +++ b/components/sensor/wifi_signal.rst @@ -23,7 +23,7 @@ measured in decibel-milliwatts (dBm). These values are always negative and the c name: "WiFi Signal Sensor" update_interval: 60s -Note: since this sensor has a static uniqueid reported to Home Assistant, you can only have one sensor of this type in a device. If you want to have another, use the :ref:`_copy_sensor`: +To additionally display signal strength in percentage use the :ref:`copy-sensor` (it's not possible to add the same sensor twice, because it has a static ``uniqueid`` reported to Home Assistant): .. code-block:: yaml