Skip to main content

Local API Overview

Stromleser-one, Gasleser, and wasserleser devices feature a local API for direct access to device data. These APIs are only available on the local network and not accessible via the internet.

Common API Properties

Local Access

  • Local network only: APIs are exclusively accessible via local network
  • No cloud connection: Data is not transmitted via external servers
  • Direct device access: Communication occurs directly with the device

Rate Limiting

All device APIs have uniform rate limiting:

  • 10 seconds per request: Minimum interval between API calls
  • Automatic limiting: Too frequent requests will be rejected

API Endpoints

Homepage

http://[DEVICE_IP]/

Each device provides a basic homepage under its IP address.

Data API

http://[DEVICE_IP]/v1/data

The standardized endpoint for accessing device data.

Device-Specific APIs

Each device provides different data structures via the /v1/data API:

stromleser.one

For detailed information about the stromleser.one API see:

Gasleser

For detailed information about the Gasleser API see:

wasserleser

The wasserleser API uses the same structure as the other device APIs. For general information, see the sections above.

General Usage

Determine IP Address

  1. Router interface: Check connected devices in your router
  2. Network scanner: Use tools like nmap or mobile apps
  3. Device display: Some devices show the IP address on the display

Simple Test

# Ping test
ping [DEVICE_IP]

# Access homepage
curl http://[DEVICE_IP]/

# Retrieve API data
curl http://[DEVICE_IP]/v1/data

Respect Rate Limiting

import requests
import time

def get_device_data(device_ip):
try:
response = requests.get(f"http://{device_ip}/v1/data", timeout=5)
return response.json()
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
return None

# Respect rate limiting
data = get_device_data("192.168.1.100")
time.sleep(10) # Wait 10 seconds

Security

Network Security

  • APIs are only available on local network
  • No authentication required
  • Ensure your local network is secure
  • Use firewall rules if needed

Best Practices

  • Regular updates: Keep device firmware current
  • Network segmentation: Isolate IoT devices in a separate VLAN
  • Monitoring: Monitor unusual API access

Troubleshooting

Common Problems

Device unreachable

  • Check network connection
  • Ensure device is powered on
  • Verify IP address

API not responding

  • Check firmware version (local API may not be available)
  • Test homepage first (http://[IP]/)
  • Check firewall settings

Rate limit reached

  • Wait at least 10 seconds between requests
  • Implement appropriate wait times in your code
  • Check for parallel access from other applications

Debugging Tools

# Network test
ping [DEVICE_IP]

# Port test
telnet [DEVICE_IP] 80

# HTTP test
curl -v http://[DEVICE_IP]/v1/data

Integration into Smart Home Systems

Local APIs can be integrated into various smart home systems:

  • Home Assistant: Via REST sensors or MQTT
  • Node-RED: Direct HTTP requests
  • OpenHAB: HTTP binding
  • Custom scripts: Python, JavaScript, etc.

For specific integration help, see the device-specific documentation.