Skip to content

Instantly share code, notes, and snippets.

@helgibbons
helgibbons / adafruit-io-w-MQTT-4-HA.py
Created February 10, 2022 15:06
Weather HAT adafruit.io example that also posts data into Home Assistant
#!/usr/bin/env python3
from time import sleep
import weatherhat
from Adafruit_IO import Client, Feed, Dashboard, RequestError, AdafruitIOError
import json
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish
sensor = weatherhat.WeatherHAT()