aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--README.md2
-rwxr-xr-xdocs/power2.pngbin0 -> 363787 bytes
-rw-r--r--mqtt-client/mqtt-client.py6
-rw-r--r--switch-snmp/omada-switches.conf5
-rw-r--r--switch-snmp/snmpOmada.py4
6 files changed, 10 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index bac8214..56d2d3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ node-red-data/
prometheus/web.yml
prometheus/web.yml
mqtt-client/omada.cfg
+venv/
# Byte-compiled / optimized / DLL files
__pycache__/
diff --git a/README.md b/README.md
index ed2d5ea..6273521 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Also logs Zigbee informtion with a Tasmota-flashed Zigbee bridge.
Looking for the Mikrotik POE usage monitor/exporter? That's in [`mikrotik.py`](/switch-snmp/mikrotik.py)
-![Grafana screenshot](https://i.imgur.com/YcAmIf5.png)
+![Grafana screenshot](/docs/power2.png)
## Setup
diff --git a/docs/power2.png b/docs/power2.png
new file mode 100755
index 0000000..0648049
--- /dev/null
+++ b/docs/power2.png
Binary files differ
diff --git a/mqtt-client/mqtt-client.py b/mqtt-client/mqtt-client.py
index 8c7bd23..ad6227c 100644
--- a/mqtt-client/mqtt-client.py
+++ b/mqtt-client/mqtt-client.py
@@ -98,17 +98,16 @@ class MQTTClient:
if status_before == "OFF":
print("TV was formerly off, so its being turned on, so we're going to turn the firestick on.")
-
set_omada_poe("Firestick", 0)
print("Waiting...")
- time.sleep(8)
+ time.sleep(6)
set_omada_poe("Firestick", 1)
print("Turned firestick on.")
else:
print("TV was formerly on, so its being turned off, so we're going to turn the firestick off.")
set_omada_poe("Firestick", 1)
print("Waiting...")
- time.sleep(8)
+ time.sleep(6)
set_omada_poe("Firestick", 0)
print("Turned firestick off.")
@@ -124,6 +123,7 @@ class MQTTClient:
status_before = self.get_http_power_status("192.168.5.6", os.environ["MQTT_PASSWD"])
self.toggle_plug("TasmotaTV")
threading.Thread(target = toggle_firestick, args = (status_before, )).start()
+ # toggle_firestick(status_before)
if zigbee_id == "0x74B3" and friendlyname == "HarveyButton" and "Power" in fields.keys():
if fields["Power"] == 2:
diff --git a/switch-snmp/omada-switches.conf b/switch-snmp/omada-switches.conf
index e4a6888..be77cd2 100644
--- a/switch-snmp/omada-switches.conf
+++ b/switch-snmp/omada-switches.conf
@@ -1,4 +1,4 @@
-[192.168.69.112]
+[192.168.69.28]
1 = EAP225 Wifi
2 = Tasmota Zigbee
4 = Mikrotik CRS310-8G+2S+
@@ -7,7 +7,7 @@
24 = Frigate Pi
23 = SG2005P-PD
8 = PiKVM
-11 = Type-C POE Charger
+11 = Cisco 7975
22 = Cluster Pi 9
19 = Cluster Pi 5
20 = Cluster Pi 7
@@ -21,4 +21,5 @@
1 = Fibre ONT
2 = TL-RP108GE & EAP110
3 = Firestick
+4 = ES205G
diff --git a/switch-snmp/snmpOmada.py b/switch-snmp/snmpOmada.py
index f1546a7..d3b183c 100644
--- a/switch-snmp/snmpOmada.py
+++ b/switch-snmp/snmpOmada.py
@@ -44,7 +44,7 @@ def get_alternate_name(port, host):
try:
return port_names[port]
except KeyError:
- return port
+ return str(port)
def snmp_walk(host):
proc = subprocess.Popen(
@@ -93,4 +93,4 @@ if __name__ == "__main__":
import mikrotik
points = get_points()
print(points)
- mikrotik.append(points) \ No newline at end of file
+ mikrotik.append(points)