Skip to content

Instantly share code, notes, and snippets.

pykler /
Last active Jul 2, 2022
Script to publish mqtt discovery for wink relay running with
import json
import logging
import getpass
import argparse
import paho.mqtt.client as mqtt # paho-mqtt
payloads = {
"homeassistant/device_automation/B0C1/%MQTT_PREFIX%/config": {
"topic": "%MQTT_PREFIX%/buttons/0/click/1",
View Django Startup
def startup():
global matrix
matrix = load_large_matrix()
# then you would
from yourapp import matrix