Coder Social home page Coder Social logo

solax's Introduction

Solax

Build Status PyPI - Downloads

Read energy usage data from the real-time API on Solax solar inverters.

  • Real time power, current and voltage
  • Grid power information
  • Battery level
  • Temperature and inverter health
  • Daily/Total energy summaries

Usage

pip install solax

Then from within your project:

import solax
import asyncio

async def work():
    r = await solax.real_time_api('10.0.0.1')
    return await r.get_data()

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
data = loop.run_until_complete(work())
print(data)

This will try all the inverter classes in turn until it finds the first one that works with your installation. You can see the list of inverter implementation classes in the entry points configured in setup.py.

If you want to bypass the inverter discovery code and use a specific inverter class, you can invoke discover specifying directly the class. In this example, the X1 Hybrid Gen4 implementation is used:

from importlib.metadata import entry_points
import solax
import asyncio

INVERTERS_ENTRY_POINTS = {
   ep.name: ep.load() for ep in entry_points(group="solax.inverter")
}

async def work():
    inverter = await solax.discover("10.0.0.1", 80, "xxxxx", inverters=[INVERTERS_ENTRY_POINTS.get("x1_hybrid_gen4")], return_when=asyncio.FIRST_COMPLETED)
    return await inverter.get_data()

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
data = loop.run_until_complete(work())
print(data)

Confirmed Supported Inverters

These inverters have been tested and confirmed to be working. If your inverter is not listed below, this library may still work- please create an issue so we can add your inverter to the list ๐Ÿ˜Š.

  • SK-TL5000E
  • X1 Hybrid Gen4

You can get the list of supported inverters by looking up the solax.inverter entry points:

for ep in entry_points(group="solax.inverter"):
    print(ep)

solax's People

Contributors

squishykid avatar danielweeber avatar vadimkraus avatar darsstar avatar ppetru avatar niclasku avatar th3link avatar kdehairy avatar dickinsonrob avatar kalosisz avatar sebstaeubert avatar rupertnash avatar brew-your-own avatar pmos69 avatar martin-beran avatar jesserockz avatar jmacalinao avatar fabaff avatar darkercz avatar dweebertwt avatar bobiene avatar arnemauer avatar adambogocz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.