Skip to main content

Temperature Monitoring system using MQTT

Project description

Temperature monitoring system using MQTT

Stable Release Project Maintenance License BuyMeCoffee

Monitoring system several temperature sensors. One of the use cases is for a floor heating system with heat exchanger.

This system is design to monitor several different loops in a floor heating system using a heat exchanger. The measured data is published to a MQTT broker.

Hardware setup

The system is built arround 1-wire temperature sensor DS18B20 connected to a Raspberry Pi with 1-wire setup as default on GPIO 4.

My specific project will be using 10 DS18B20 sensors to monitor my total 8 loops + supply/return on the heat exchanger. They are connected as shown in this picture:

Figure 1-1

My POC setup for now uses only 5 DS18B20 sensors.

Below my basic call structure for 5 different sensors.

   try:
        client = mqtt.Client() 
        client.on_connect = on_connect
        client.will_set('vloerverwarming/status', "offline")
        client.username_pw_set("mqtt","test_mqtt")
        client.connect("ha.de-wit.me", 1883, 60)
        client.publish('vloerverwarming/status',payload = "online", qos=0, retain=True)
        client.publish('vloerverwarming/version/installed',payload = "1.0.0", qos=0, retain=True)
        client.publish('vloerverwarming/version/latest',payload = "1.0.0", qos=0, retain=True)
        client.loop_start()
    except Exception as e:
        print(f"Failed to connect to MQTT: {e}")
        exit()

    Sensors = []

    Sensors.append(TemperatureSensor('vloerverwarming/kring1/aanvoertemp',"28dfc6571f64ff",client))
    Sensors.append(TemperatureSensor('vloerverwarming/kring1/afvoertemp',"28dfd9571f64ff",client))
    Sensors.append(TemperatureSensor('vloerverwarming/kring2/aanvoertemp',"2828ff571f64ff",client))
    Sensors.append(TemperatureSensor('vloerverwarming/kring2/afvoertemp',"28aafd571f64ff",client))
    Sensors.append(TemperatureSensor('vloerverwarming/aanvoertemp',"282bfe571f64ff",client))

    stopFlag = Event()
    thread= MyThread(stopFlag, 10)
    thread.start()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

temperaturemonitor_mqtt_sldewit-0.0.5.tar.gz (733.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file temperaturemonitor_mqtt_sldewit-0.0.5.tar.gz.

File metadata

File hashes

Hashes for temperaturemonitor_mqtt_sldewit-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5db02480e1ca93356685e0b83eb034ef33a28a95f40e66797dcb95c434ca7734
MD5 c4f0b81d17ff4bceb56260275b06e3ac
BLAKE2b-256 40f9127c01ca31556e7534805766f3893accc5cc25d7539a261fe42fe03fdf13

See more details on using hashes here.

File details

Details for the file temperaturemonitor_mqtt_sldewit-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for temperaturemonitor_mqtt_sldewit-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 04e75dde788ea8dccaef0b920fecb1032829a7f24e3d2a933fa89e483620f7c5
MD5 38a5487d96ad94e2574fdbfca731ba82
BLAKE2b-256 d485a8cc2195883366d12378fa720854e331fdc8eb3617026ec0bac302cb9323

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page