UNOFFICIAL Python client for i-DE
Project description
python-oligo
[ES] Cliente Python (NO OFICIAL) para i-DE (Iberdrola distribución).
Instalación:
pip install oligo
Ejemplos:
Consultar consumo actual:
from oligo import Iber
connection = Iber()
connection.login("user", "password")
watt = connection.watthourmeter()
print(watt)
Consultar estado ICP interno:
from oligo import Iber
connection = Iber()
connection.login("user", "password")
status = connection.icpstatus()
print(status)
Obtener el consumo horario durante un periodo
from oligo import Iber
from datetime import date, timedelta
connection = Iber()
connection.login("user", "password")
from_date = date.today() - timedelta(days=7)
until_date = date.today() - timedelta(days=1)
consumo = connection.consumption(from_date, until_date)
print(consumo[:10])
Los datos son el consumo por hora en Watt-horas. En este caso tendremos los dato de una semana, que son 7 por 24, 168 valores. Si sumamos y dividimos por 1000, tenemos el consumo de una semana en kWh.
[EN] Python client (UNOFFICIAL) for i-DE (Iberdrola distribución).
Install:
pip install oligo
Example:
Obtain current consumption:
from oligo import Iber
connection = Iber()
connection.login("user", "password")
watt = connection.watthourmeter()
print(watt)
Get ICP status:
from oligo import Iber
connection = Iber()
connection.login("user", "password")
status = connection.icpstatus()
print(status)
Retrieve the hourly consumption during a time period
from oligo import Iber
from datetime import date, timedelta
connection = Iber()
connection.login("user", "password")
from_date = date.today() - timedelta(days=7)
until_date = date.today() - timedelta(days=1)
consumo = connection.consumption(from_date, until_date)
print(consumo[:10])
The values are the consumption in Watt-hours. In this case, we have the data of one week, which are 7 times 24, 168 values. If we sum and divide by 1000, we will have the total consumption from one week in kWh.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oligo-1.2.0.tar.gz
(4.4 kB
view hashes)
Built Distribution
oligo-1.2.0-py3-none-any.whl
(5.4 kB
view hashes)