From fa4c95d085bf1b8647ea04b98e4aa774654765f2 Mon Sep 17 00:00:00 2001 From: Roeland Date: Tue, 6 Aug 2024 22:44:39 +0200 Subject: [PATCH] added logging --- sma/DOCS.md | 2 +- sma/config.yaml | 2 +- sma/src/homewizard.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sma/DOCS.md b/sma/DOCS.md index b91b274..6819f55 100644 --- a/sma/DOCS.md +++ b/sma/DOCS.md @@ -49,7 +49,7 @@ data: ## How to use with HomeWizard meters -Enable the HomeWizard functionality in the configuration. On startup the addon will try to find the homewizard meters on the local network. When a meter is found a serial number will be assigned and printed to the log output. +Enable the HomeWizard functionality in the configuration. On startup the addon will try to find the homewizard meters on the local network. When a meter is found(it can take a few minutes) a serial number will be assigned and printed to the log output. If your homewizard meter is not automatically detected you can manually add it by entering the ip address of the meter(s) in the field "HomeWizard manual ip addresses". diff --git a/sma/config.yaml b/sma/config.yaml index 0a4b364..d1c8c1f 100644 --- a/sma/config.yaml +++ b/sma/config.yaml @@ -1,6 +1,6 @@ name: "SMA Energy Meter emulator" description: "Simulate one or more SMA energy meters based on mqtt messages." -version: "rc-0.0.11.2" +version: "rc-0.0.11.4" slug: sma url: "https://github.com/Roeland54/SMA-Energy-Meter-emulator" arch: diff --git a/sma/src/homewizard.py b/sma/src/homewizard.py index f28e8f9..7b6fa8c 100644 --- a/sma/src/homewizard.py +++ b/sma/src/homewizard.py @@ -20,9 +20,11 @@ def setup_homewizard(userdata): def on_service_state_change(zeroconf, service_type, name, state_change, userdata): if state_change is ServiceStateChange.Added: + logging.debug(f"Found device with name: {name}, state_change: {state_change}, trying to get info") info = zeroconf.get_service_info(service_type, name) if info: hostname = info.server + logging.debug(f"Found device with hostname from ServiceInfo: {hostname}") if hostname.startswith("p1meter") or hostname.startswith("kwhmeter"): random.seed(42) serial_number = hash(hostname)