pip install oligo
pip install oligo[asyncio]
from oligo import Iber
connection = Iber()
connection.login("user", "password")
watt = connection.watthourmeter()
print(watt)
import asyncio
from oligo.asyncio import AsyncIber
async def main():
connection = AsyncIber()
await connection.login("user", "password")
watt = await connection.watthourmeter()
print(watt)
await connection.close()
asyncio.run(main())
from oligo import Iber
connection = Iber()
connection.login("user", "password")
status = connection.icpstatus()
print(status)
import asyncio
from oligo.asyncio import AsyncIber
async def main():
connection = AsyncIber()
await connection.login("user", "password")
status = await connection.icpstatus()
print(status)
asyncio.run(main())
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])
import asyncio
from oligo.asyncio import AsyncIber
from datetime import date, timedelta
async def main():
connection = AsyncIber()
await connection.login("user", "password")
from_date = date.today() - timedelta(days=7)
until_date = date.today() - timedelta(days=1)
consumo = await connection.consumption(from_date, until_date)
print(consumo[:10])
asyncio.run(main())
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.
pip install oligo
from oligo import Iber
connection = Iber()
connection.login("user", "password")
watt = connection.watthourmeter()
print(watt)
import asyncio
from oligo.asyncio import AsyncIber
async def main():
connection = AsyncIber()
await connection.login("user", "password")
watt = await connection.watthourmeter()
print(watt)
asyncio.run(main())
from oligo import Iber
connection = Iber()
connection.login("user", "password")
status = connection.icpstatus()
print(status)
import asyncio
from oligo.asyncio import AsyncIber
async def main():
connection = AsyncIber()
await connection.login("user", "password")
status = await connection.icpstatus()
print(status)
asyncio.run(main())
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])
import asyncio
from oligo.asyncio import AsyncIber
from datetime import date, timedelta
async def main():
connection = AsyncIber()
await connection.login("user", "password")
from_date = date.today() - timedelta(days=7)
until_date = date.today() - timedelta(days=1)
consumo = await connection.consumption(from_date, until_date)
print(consumo[:10])
asyncio.run(main())
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.