Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Roeland authored and Roeland committed Aug 6, 2024
2 parents 7307205 + fa4c95d commit eacdd4e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sma/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
2 changes: 1 addition & 1 deletion sma/config.yaml
Original file line number Diff line number Diff line change
@@ -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.3"
version: "rc-0.0.11.4"
slug: sma
url: "https://github.com/Roeland54/SMA-Energy-Meter-emulator"
arch:
Expand Down
2 changes: 2 additions & 0 deletions sma/src/homewizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eacdd4e

Please sign in to comment.