Implementation of the official web-api by power-dog
- The originial API is based on xmlrpc as we tried to build our website with the xmlrpc client we run into several problems.
- What we wanted: easy to use Api without having to deal with frustrating xmlrpc issues and good error responses, because the original API often response with a default error, leaving you in the dark.
- clone the repository
- cd powerdog-api/
- pip3 install -r requirements.txt
- python app/app.py
You need to set your Email and Password md5Hash in the .env file
- At first you need to create a .env file in the root folder of the project
- the place your email and md5Hash like this (optional you can set a key for your API, the default value is 1234):
[email protected]
HASH=yourmd5HASH
APIKEY=WhatEverYouLike
The API normally start on Port 8080 and hosted on the local-ip adress of your device http://localhost:8080.
All API call's have to go to this adress: http://localhost:8080/api/v1/
This is a full API call: http://localhost:8080/api/v1/APIKEY/getPowerDogs. This returns all Powerdogs which are currently available.
You need to replace the APIKEY with your APIKEY set in the .env file or use the 1234 default Key (not recommended).
getPowerDogs
--> return all PowerdogsgetInverters?PowerDogId=<YourPowerdogID>
--> returns all InvertersgetCounters?PowerDogId=<YourPowerdogID>
--> returns all CountergetSensors?PowerDogId=<YourPowerdogID>
--> returns all Sensors -getPhotovoltaicBorders?PowerDogId=<YourPowerdogID>&year=<year eg. 2020>&month=<eg. 4>
getCounterData?CounterId=<YourCounterId>
--> returns data within one daygetCounterData?CounterId=<YourCounterId>&start=<UNIX Format>&end=<UNIX Format>
--> returns data in specifiyed time | UNIX looks like: 1588248000