Local API Setup
If you have a Sparky device connected to your smart meter’s P1 port, you can access its local API to collect live power data (e.g., for Home Assistant). This approach provides direct local access within your network, reducing reliance on cloud integrations.
Getting Started
- Discover Sparky via mDNS on Your Local Network
- Confirm the Local API is Responsive
- Discover Sparky via mDNS on Your Local Network
Sparky broadcasts its presence via multicast DNS (mDNS), allowing other devices on the same subnet to discover it by hostname instead of manually configuring an IP address.
A typical mDNS announcement may include:
Hostname: sparky-6055F9B09714
Full domain: sparky-6055F9B09714.local.
Address + port: 192.168.2.45:3602
fw=82
sn=6055F9B09714
hwid=V3.0
device=sparky
From this broadcast, you can extract:
- Hostname (FQDN): sparky-6055F9B09714.local
- IP + Port: 192.168.2.45:3602
- Other metadata: firmware version, serial number, hardware ID, device type
Use your network tools (e.g. avahi-browse -a, dns-sd -B _http._tcp or similar) to discover the mDNS advertisement and read its TXT records.
Once the hostname or IP is known, you can access Sparky’s local P1 API endpoint via HTTP(S) on port 3602 by default.
- Confirm the Local API is Responsive
Before configuring, you want to ensure Sparky’s local API is reachable and serving data. A simple way:
In your browser or via curl (from a machine on the same local network):
nc sparky-6055F9B09714.local 3602
Or use the IP directly:
nc 192.168.2.45 3602
Troubleshooting API Responses
If the API is working, it should respond with the P1 data output that the smart meter provides (e.g. in ASCII/log format). If you get no response, errors, or timeouts, check:
- Ensure both devices are on the same subnet and there is no network isolation (VLANs, firewalls).
- Verify that the hostname resolves correctly via local DNS or mDNS.
- Confirm that port 3602 is open on the network.
- Make sure Sparky has fully booted and applied the latest firmware update (this may take up to ~24 hours).
- Check that Sparky is properly connected to the P1 port and powered on.
- Ensure that no firewall rules are blocking local access.
Updated 17 days ago