diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2025-05-19 16:32:07 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2025-05-19 16:32:07 +0100 |
commit | afddb7f93903a6b1910833898b2b6a105c153906 (patch) | |
tree | ec1a3cf4e0ca07c78eb0e8221205e0f1f217dc4a /mqtt-client | |
parent | 5d66f867da9d8f45c26c0f6b7799efa26f978056 (diff) | |
download | power.eda.gay-afddb7f93903a6b1910833898b2b6a105c153906.tar.gz power.eda.gay-afddb7f93903a6b1910833898b2b6a105c153906.zip |
Added toggling firestick after a delay
Diffstat (limited to 'mqtt-client')
-rw-r--r-- | mqtt-client/mqtt-client.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mqtt-client/mqtt-client.py b/mqtt-client/mqtt-client.py index c846578..dcb8614 100644 --- a/mqtt-client/mqtt-client.py +++ b/mqtt-client/mqtt-client.py @@ -1,6 +1,7 @@ import paho.mqtt.client as paho from influxdb_client import InfluxDBClient, Point, WritePrecision from influxdb_client.client.write_api import SYNCHRONOUS +import time import json import os @@ -58,6 +59,10 @@ class MQTTClient: if fields["Power"] == 2: print("TV Zigbee button pressed, toggling TasmotaTV Tasmota Plug") self.toggle_plug("TasmotaTV") + time.sleep(8) + self.toggle_plug("TasmotaGeoffery") + time.sleep(0.5) + self.toggle_plug("TasmotaGeoffery") if zigbee_id == "0x74B3" and friendlyname == "HarveyButton" and "Power" in fields.keys(): if fields["Power"] == 2: @@ -85,8 +90,8 @@ if __name__ == "__main__": if os.path.exists(env_path): import dotenv dotenv.load_dotenv(dotenv_path = env_path) - INFLUXDB_HOST = "localhost" - MQTT_HOST = "localhost" + INFLUXDB_HOST = "dns.athome" + MQTT_HOST = "dns.athome" else: INFLUXDB_HOST = "influxdb" MQTT_HOST = "mqtt" |