Get information from GCE Eco-Devices
host: ip or hostnameport: (default: 80)username: if authentication enabled on Eco-Devicespassword: if authentication enabled on Eco-Devicesrequest_timeout: (default: 10)
host: return the hostversion: return the firmware versionmac_address: return the mac address
get_info: get properties from the APIglobal_get: return all data from the APIget_t1: return values of input T1get_t2: return values of input T2get_c1: return values of input C1get_c2: return values of input C2
from pyecodevices import EcoDevices
import asyncio
async def main():
async with EcoDevices('192.168.1.239', '80', "username", "password") as ecodevices:
await ecodevices.get_info()
print("firmware version:", ecodevices.version)
data = await ecodevices.global_get()
print("all values:", data)
data = await ecodevices.get_t1()
print("teleinfo 1:", data)
print("current:", data["current"], "VA")
if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(main())