diff --git a/mqtt2prometheus.py b/mqtt2prometheus.py --- a/mqtt2prometheus.py +++ b/mqtt2prometheus.py @@ -59,7 +59,7 @@ def on_connect(client, userdata, flags, "space/status": handle_space_status, "space/member_count": handle_member_count, "sensors/people_now_present": handle_people_now_present, - "sensors/#": handle_sensors, + "sensors/#": handle_sensor, } for topic, handler in topics_handler.items(): @@ -93,7 +93,7 @@ def handle_availability(client, userdata def handle_sensor(client, userdata, msg): - t = msg.topic_split("/") + t = msg.topic.split("/") location = "-".join(t[2:]) if t[1] == "people_now_present": return