tomasmcguinness / homeassistant-mixergy

Add support for Mixergy's smart water tank into Home Assistant
MIT License
32 stars 8 forks source link

Tank Unavailable since updating HA to 2024.7.0 #56

Closed barryperfect closed 3 months ago

barryperfect commented 3 months ago

Not sure if it is just me but all my Mixergy Sensors have gone Unavailable since I updated Home Assistant 2024.7.0.

As far as I can tell the Mixergy App is still functioning, so unless they changed the Mixergy API at the same time at the HA update I am assuming something in the update has broken this integration?

Reloading the integration or restarting HA doesn't seem to resolve it.

Checking the logs: Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:364 integration: Sensor (documentation, issues) First occurred: 7:46:25 AM (3 occurrences) Last logged: 10:19:13 AM

Error while setting up mixergy platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/mixergy/sensor.py", line 32, in async_setup_entry new_entities.append(EnergySensor(tank)) ^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mixergy/sensor.py", line 331, in init super().init( TypeError: IntegrationSensor.init() missing 1 required keyword-only argument: 'max_sub_interval'

Jopn81 commented 3 months ago

I can confirm I have the same issue, same error: Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:364 integration: Sensor (documentation, issues) First occurred: 08:17:41 (2 occurrences) Last logged: 10:22:00

Error while setting up mixergy platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/mixergy/sensor.py", line 32, in async_setup_entry new_entities.append(EnergySensor(tank)) ^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mixergy/sensor.py", line 331, in init super().init( TypeError: IntegrationSensor.init() missing 1 required keyword-only argument: 'max_sub_interval'

xxpas02 commented 3 months ago

Same issue here too.

atimgraves commented 3 months ago

Sadly same problem here, have done multiple reboots and HA restarts but no luck Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:364 integration: Sensor (documentation, issues) First occurred: 1:57:21 PM (1 occurrences) Last logged: 1:57:21 PM

Error while setting up mixergy platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/mixergy/sensor.py", line 32, in async_setup_entry new_entities.append(EnergySensor(tank)) ^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mixergy/sensor.py", line 331, in init super().init( TypeError: IntegrationSensor.init() missing 1 required keyword-only argument: 'max_sub_interval'

JHWain commented 3 months ago

The two Integration Sensors defined in the sensor.py (EnergySensor and PVEnergySensor) need to be updated to include the argument:

max_sub_interval=None

tomasmcguinness commented 3 months ago

Thanks @JHWain, I'll get a release out in the next day or so.

barryperfect commented 3 months ago

The two Integration Sensors defined in the sensor.py (EnergySensor and PVEnergySensor) need to be updated to include the argument:

max_sub_interval=None

Thanks @JHWain is there any chance you could post the code change you made on here so we can do a workaround until @tomasmcguinness gets a chance to push a fix?

I am not sure where you are making the change? Is this passing into those classes or into the init routines? if the former do you need to modify the entity appends as well? Or am getting the wrong end of the stick completely? As you can tell python isn't one of my strong points but I have done (C/Pascal) programming in my (distant) past :-)

barryperfect commented 3 months ago

The two Integration Sensors defined in the sensor.py (EnergySensor and PVEnergySensor) need to be updated to include the argument: max_sub_interval=None

Thanks @JHWain is there any chance you could post the code change you made on here so we can do a workaround until @tomasmcguinness gets a chance to push a fix?

I am not sure where you are making the change? Is this passing into those classes or into the init routines? if the former do you need to modify the entity appends as well? Or am getting the wrong end of the stick completely? As you can tell python isn't one of my strong points but I have done (C/Pascal) programming in my (distant) past :-)

Think I answered my own question, the change below appears to have fixed the error, is this what you meant?

class EnergySensor(IntegrationSensor):

    def __init__(self, tank:Tank):
        super().__init__(
            name="Mixergy Electric Heat Energy",
            source_entity="sensor.mixergy_electric_heat_power",
            round_digits=2,
            unit_prefix="k",
            unit_time="h",
            integration_method="left",
            unique_id=f"mixergy_{tank.tank_id}_energy",
            max_sub_interval=None
        )

    @property
    def icon(self):
        return "mdi:lightning-bolt"
tomasmcguinness commented 3 months ago

I've pushed a fix. v0.8.3 is now available.

Thanks @barryperfect for the code and @JHWain for the solution :)

barryperfect commented 3 months ago

I've pushed a fix. v0.8.3 is now available.

Thanks @barryperfect for the code and @JHWain for the solution :)

Thanks Tom, downloaded and working :-)

atimgraves commented 3 months ago

Thanks Toim. Just got it an all good now Cheers, Tim

On Thu, 4 Jul 2024 at 17:17, barryperfect @.***> wrote:

I've pushed a fix. v0.8.3 is now available.

Thanks @barryperfect https://github.com/barryperfect for the code and @JHWain https://github.com/JHWain for the solution :)

Thanks Tom, downloaded and working :-)

— Reply to this email directly, view it on GitHub https://github.com/tomasmcguinness/homeassistant-mixergy/issues/56#issuecomment-2209302552, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG4VUTGAKMOOOXDRJBS3ICDZKVYRPAVCNFSM6AAAAABKLEOI4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGMYDENJVGI . You are receiving this because you commented.Message ID: @.***>