Async Python client for Generac PWRview (formerly Neurio) energy monitors.
Supports both the cloud API and direct local device access over your network.
- Async-first — built on
aiohttp, no blocking calls - Cloud API — OAuth2 authentication, live samples, energy stats, full channel data
- Local API — direct device polling with no cloud account required
- Typed — full type hints with
py.typed(PEP 561) - Session injection — pass your own
aiohttp.ClientSessionor let the client manage one
pip install generac-pwrviewimport aiohttp
from generac_pwrview import PWRviewClient
async with aiohttp.ClientSession() as session:
client = PWRviewClient(
api_key="your_api_key",
api_secret="your_api_secret",
session=session,
)
# Discover sensors on your account
user_info = await client.get_user_information()
sensor = user_info.locations[0].sensors[0]
print(f"Sensor: {sensor.serial_number} at {sensor.ip_address}")
# Get current power readings
live = await client.get_live_sample(sensor.sensor_id)
print(f"Consumption: {live.consumption_power} W")
print(f"Generation: {live.generation_power} W")
print(f"Net: {live.net_power} W")
# Get today's energy stats
stats = await client.get_stats(sensor.sensor_id, start, "days", end)
# Get full samples with voltage and phase data
samples = await client.get_samples(
sensor.sensor_id, start, "hours", end, full=True
)No cloud account needed — connect directly to the device on your network.
import aiohttp
from generac_pwrview import PWRviewLocalClient
async with aiohttp.ClientSession() as session:
client = PWRviewLocalClient(host="192.168.1.100", session=session)
sample = await client.get_current_sample()
for channel in sample.channels:
print(f"[{channel.channel_type}] {channel.power} W @ {channel.voltage} V")from generac_pwrview import PWRviewClient
async with PWRviewClient(api_key="...", api_secret="...") as client:
user_info = await client.get_user_information()| Method | Description |
|---|---|
get_user_information() |
Discover sensors and locations on your account |
get_live_sample(sensor_id) |
Current power and energy readings |
get_stats(sensor_id, start, granularity, end) |
Aggregated energy statistics |
get_samples(sensor_id, start, granularity, end, full=False) |
Historical samples with optional channel/voltage data |
| Method | Description |
|---|---|
get_current_sample() |
Real-time reading from the device |
| Exception | Meaning |
|---|---|
PWRviewError |
Base exception |
PWRviewConnectionError |
Cannot reach the API or device |
PWRviewAuthError |
Invalid or expired credentials |
PWRviewResponseError |
Unexpected API response |
- Go to https://my.neur.io/#settings/applications/register
- Create a new application (homepage and callback URLs are optional)
- Note your API key and secret
This library is a modernized fork of neurio-python by Jordan Husney. The original library provided the foundation for understanding the Neurio/Generac API. This version has been rewritten with async support, type hints, and structured response models.
Apache License 2.0 — see LICENSE for details.
Original work copyright 2015, 2016 Jordan Husney.