diff --git a/get_data.py b/get_data.py index d631730..4917584 100644 --- a/get_data.py +++ b/get_data.py @@ -1,6 +1,7 @@ """ Read Xiaomi LYWSD03MMC advertised packets and send them to MQTT """ +import json import os from socket import gaierror from typing import TypedDict @@ -54,7 +55,7 @@ def send_to_mqtt(data: MQTTdata) -> None: }, { "topic": "sensors/home/{data['mac']}/tele/SENSOR", - "payload": data, + "payload": json.dumps(data), }, ]