From 251112985c2a7dbb634c35a84bed871abae3cb9b Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Wed, 27 Apr 2022 15:59:20 -0400 Subject: [PATCH 1/2] Fix name for last seen sensor --- amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py b/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py index 68ab38b..e7007d1 100644 --- a/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py +++ b/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py @@ -307,6 +307,7 @@ def send_discovery_messages(): category=CATEGORY_DIAGNOSTIC, ) last_seen["device_class"] = "timestamp" + last_seen["name"] = "Last Seen" publish_sensor_discovery( meter_id=meter_id, device=device, From fb68816a1ee30f459225aa47499da07bb85bb03b Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Wed, 27 Apr 2022 16:04:43 -0400 Subject: [PATCH 2/2] Include device name in name --- amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py b/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py index e7007d1..21e5d71 100644 --- a/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py +++ b/amr2mqtt/rootfs/amr2mqtt/amr2mqtt.py @@ -307,7 +307,7 @@ def send_discovery_messages(): category=CATEGORY_DIAGNOSTIC, ) last_seen["device_class"] = "timestamp" - last_seen["name"] = "Last Seen" + last_seen["name"] = f"{device_name} Last Seen" publish_sensor_discovery( meter_id=meter_id, device=device,