Skip to main content

gasleser.pulse Local API

The gasleser.pulse local API provides direct access to your gas consumption data over the local network. This API is only available locally and cannot be accessed over the internet.

API Endpoint

The API is accessible via the following URL:

http://[DEVICE_IP]/v1/data

Example:

http://192.168.2.132/v1/data

Rate Limiting

The API has rate limiting implemented:

  • 1 request every 0.5 seconds
  • Requests exceeding the limit will be rejected
Respect Rate Limiting

Ensure your application doesn't send requests more than once every 0.5 seconds.

API Response

The API returns JSON data in the following format:

{
"device_id": "GAS_PULSE_4466926439",
"timestamp": "1785224596",
"count": 603,
"total_consumption": 37030.67,
"today_consumption": 0.00,
"current_flow_rate": 0.01,
"signal_strength": "84 %",
"rssi": "-51"
}

Response Fields

FieldTypeDescription
device_idStringUnique device ID of the gasleser.pulse
timestampStringUnix timestamp of the measurement
countIntegerNumber of pulses counted since the last restart
total_consumptionFloatTotal consumption in cubic meters (the big number on the gas meter)
today_consumptionFloatConsumption for the current day in cubic meters
current_flow_rateFloatCurrent flow rate in m³/h
signal_strengthStringWi-Fi signal strength in percent
rssiStringWi-Fi signal strength in dBm (RSSI)

Flow Rate Details

The current_flow_rate is a calculated value with the following properties:

  • Unit: Cubic meters per hour (m³/h)
  • Purpose: Live visualization of current gas consumption
  • Algorithm: Uses a gradual drop algorithm for a smooth curve
  • Note: For illustration and visual representation purposes only
Usage Purpose

The current_flow_rate value is primarily intended for live visualization and shows a smoothed representation of current consumption.

Example Integration

Python Example

import requests
import time

def get_gasleser_pulse_data(device_ip):
try:
response = requests.get(f"http://{device_ip}/v1/data", timeout=5)
if response.status_code == 200:
return response.json()
else:
print(f"Error: HTTP {response.status_code}")
return None
except requests.exceptions.RequestException as e:
print(f"Connection error: {e}")
return None

# Example usage
device_ip = "192.168.2.132"
data = get_gasleser_pulse_data(device_ip)

if data:
print(f"Device: {data['device_id']}")
print(f"Total consumption: {data['total_consumption']} m3")
print(f"Current flow rate: {data['current_flow_rate']} m3/h")

# Respect rate limiting
time.sleep(0.5) # Wait 0.5 seconds

curl Example

curl -X GET http://192.168.2.132/v1/data

Error Handling

Common Errors

  • 429 Too Many Requests: Rate limit exceeded, wait 0.5 seconds
  • 404 Not Found: API endpoint not available, check the firmware version
  • Timeout: Device unreachable, check network connection

Troubleshooting

  1. Check firmware version: Make sure the device runs the latest firmware
  2. Test network connection: Ping the device
  3. Verify IP address: Use correct device IP
  4. Respect rate limiting: Wait at least 0.5 seconds between requests

Integration with Home Assistant

For Home Assistant integration, see gasleser.pulse Home Assistant Integration.

Security Notes

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