Skip to content

Instantly share code, notes, and snippets.

@pykler
pykler / wink_relay_publish.py
Created Nov 30, 2021
Script to publish mqtt discovery for wink relay running with https://github.com/jimpastos/wink-relay-manager
View wink_relay_publish.py
import json
import logging
import getpass
import argparse
import paho.mqtt.client as mqtt # paho-mqtt
payloads = {
"homeassistant/device_automation/B0C1/%MQTT_PREFIX%/config": {
"automation_type":"trigger",
"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