Skip to content

python installation script does not work #576

@fconrotte

Description

@fconrotte

Hello guys !

Thank you for opening your API !

I installed your Homewizard P1 dongle on my electricity digital meter.

I live in Belgium and I'm trying to figure out why my electricity provider seems to overcharge how many kwh I use per day.

I would simply want to fetch every day at midnight the following values
energy_import_t1_kwh
energy_import_t2_kwh
energy_import_t3_kwh
energy_import_t4_kwh
energy_export_t1_kwh
energy_export_t2_kwh
energy_export_t3_kwh
energy_export_t4_kwh

So I followed your procedure:
python3 -m pip install python-homewizard-energy

and ran the provided code

import asyncio
from homewizard_energy import HomeWizardEnergyV1
IP_ADDRESS = "192.168.1.123"
async def main():

    async with HomeWizardEnergyV1(host=IP_ADDRESS) as api:

        # Get device information, like firmware version
        print(await api.device())

        # Get measurements, like energy or water usage
        measurement = await api.measurement()
        print(measurement.energy_import_kwh)

        # Example of getting raw telegram data
        telegram = await api.telegram()
        print(telegram)  # Raw P1 meter data

        # Get all data and remap v1 data to new v2 structure
        print(await api.combined())

        # Turn on the Energy Socket outlet
        await api.state(power_on=True)
    asyncio.run(main())

But it does not work

File "C:\Users\FredericConrotte\p1.py", line 2, in <module> from homewizard_energy import HomeWizardEnergyV1 ImportError: cannot import name 'HomeWizardEnergyV1' from 'homewizard_energy'

The problem is that the pip install does not include the v1 and v2 subfolders found in your source code:
https://github.com/homewizard/python-homewizard-energy/tree/main/homewizard_energy

Can you help me ?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions