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-1.0.0.tar.gz (734.9 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-1.0.0.tar.gz.

File metadata

File hashes

Hashes for temperaturemonitor_mqtt_sldewit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 50644f5b64a77a2001868bbbd9f6e04dd5b119d2bb35c738ced07678f24cf1f4
MD5 32d04ce4a1523f99714f220e8bd8a56a
BLAKE2b-256 ebae31bb11933b20f115f223291c1d00beee3840a503884862ca9e2c583dd4c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for temperaturemonitor_mqtt_sldewit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c709a6cccefdbe91e24011fd1ddb129f00307aa443d380bb6414e02db51e8ea
MD5 d183fa175edeee6c093f962a5e19a8d4
BLAKE2b-256 b041a48abb43098b15a58023e8b4f9023cb9a8abf7f59dfa3022b1e915e978ae

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