diff --git a/mqtt/tempSensor.py b/mqtt/tempSensor.py index 7013730..0b48b50 100644 --- a/mqtt/tempSensor.py +++ b/mqtt/tempSensor.py @@ -72,7 +72,7 @@ def getValues(sensor): def publish(client, temp, humidity): #Publish Temp Results - tempMsg = '{{ "temperature": {} }}'.format(temp) + tempMsg = '{{ "temperature": "{}" }}'.format(temp) result = client.publish(tempTopic, tempMsg) # result: [0, 1] status = result[0] @@ -82,7 +82,7 @@ def publish(client, temp, humidity): print(f"Failed to send message to topic {tempTopic}") #Publish Humid Results - humidMsg = '{{ "humidity": {} }}'.format(humidity) + humidMsg = '{{ "humidity": "{}" }}'.format(humidity) result = client.publish(humidTopic, humidMsg) # result: [0, 1] status = result[0]