From f5e94b3ddd3cac0ab79e3c36eb910b6c3e8f39ec Mon Sep 17 00:00:00 2001 From: jwansek Date: Thu, 28 May 2026 21:04:22 +0100 Subject: Added a missing '\n' coz im an idiot --- door_log.csv | 12 ++++++++++++ mqtt-client/mqtt-client.py | 3 +-- switch-snmp/mikrotik-switches.conf | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 door_log.csv diff --git a/door_log.csv b/door_log.csv new file mode 100644 index 0000000..209a844 --- /dev/null +++ b/door_log.csv @@ -0,0 +1,12 @@ +2026-05-28T20:58:23.174809+01:00,DoorSensor,0500?00=010000010000,Contact=1,Endpoint=1,LinkQuality=97,ZoneStatusChange=1,ZoneStatusChangeZone=1 +2026-05-28T20:58:23.620942+01:00,DoorSensor,Contact=1,Endpoint=1,LinkQuality=97,ZoneStatus=1 +2026-05-28T20:59:16.767725+01:00,DoorSensor,0500?00=000000010000,Contact=0,Endpoint=1,LinkQuality=97,ZoneStatusChange=0,ZoneStatusChangeZone=1 +2026-05-28T20:59:17.170928+01:00,DoorSensor,Contact=0,Endpoint=1,LinkQuality=97,ZoneStatus=0 +2026-05-28T21:02:57.519617+01:00,DoorSensor,0500?00=010000010000,Contact=1,Endpoint=1,LinkQuality=97,ZoneStatusChange=1,ZoneStatusChangeZone=1 +2026-05-28T21:02:57.924327+01:00,DoorSensor,Contact=1,Endpoint=1,LinkQuality=94,ZoneStatus=1 +2026-05-28T21:03:03.778401+01:00,DoorSensor,0500?00=000000010000,Contact=0,Endpoint=1,LinkQuality=100,ZoneStatusChange=0,ZoneStatusChangeZone=1 +2026-05-28T21:03:04.223793+01:00,DoorSensor,Contact=0,Endpoint=1,LinkQuality=100,ZoneStatus=0 +2026-05-28T21:03:04.528031+01:00,DoorSensor,0500?00=010000010000,Contact=1,Endpoint=1,LinkQuality=102,ZoneStatusChange=1,ZoneStatusChangeZone=1 +2026-05-28T21:03:05.078116+01:00,DoorSensor,Contact=1,Endpoint=1,LinkQuality=100,ZoneStatus=1 +2026-05-28T21:03:05.085031+01:00,DoorSensor,0500?00=000000010000,Contact=0,Endpoint=1,LinkQuality=102,ZoneStatusChange=0,ZoneStatusChangeZone=1 +2026-05-28T21:03:06.173807+01:00,DoorSensor,Contact=0,Endpoint=1,LinkQuality=100,ZoneStatus=0 diff --git a/mqtt-client/mqtt-client.py b/mqtt-client/mqtt-client.py index 19ad845..9682dc9 100644 --- a/mqtt-client/mqtt-client.py +++ b/mqtt-client/mqtt-client.py @@ -120,8 +120,7 @@ class MQTTClient: if friendlyname == "DoorSensor": with open(os.path.join(os.path.dirname(__file__), "door_log.csv"), "a") as f: - f.write("%s,%s,%s" % (datetime.datetime.now().astimezone().isoformat(), friendlyname, ",".join(sorted(["%s=%s" % (k, v) for k, v in fields.items()])))) - + f.write("%s,%s,%s\n" % (datetime.datetime.now().astimezone().isoformat(), friendlyname, ",".join(sorted(["%s=%s" % (k, v) for k, v in fields.items()])))) if zigbee_id == "0x0A05" and friendlyname == "TVButton2" and "Power" in fields.keys(): if fields["Power"] == 2: diff --git a/switch-snmp/mikrotik-switches.conf b/switch-snmp/mikrotik-switches.conf index c1a344c..8f13525 100644 --- a/switch-snmp/mikrotik-switches.conf +++ b/switch-snmp/mikrotik-switches.conf @@ -1,6 +1,6 @@ -[192.168.69.22] -ether2 = MikroTik CSS610-8G-2S+IN -ether1 = TP-RP108GE +[192.168.6.5] +ether2 = 2 +ether1 = 1 ether3 = 3 ether4 = 4 ether5 = 5 -- cgit v1.2.3