albertogeniola / meross-homeassistant

Custom component that leverages the Meross IoT library to integrate with Homeassistant
MIT License
729 stars 83 forks source link

Meros api changed, intalled 1.2.7 but no success #414

Closed TecnoTalarn closed 1 year ago

TecnoTalarn commented 1 year ago

I'm losing all meross integration this morning, but I'm having a lot of problems after upgrading to 1.2.7 It only sees the switch... no other options... mss310 doesn't see power sensors, no voltage. temperature sensors do not work at all. I can't detect my msh300 hub.

Your environment HomeAssistant version: -- 9.4 -- Hassio Version (if applicable): -- 2022-12-9 -- Hardware environment: mss310, mss710, msh300, ms100 my system runs on a virtualbox platform over m/y Intel i7 server / Logs taken when the issue happened

===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.4
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Caldera (mss310) - OnlineStatus.ONLINE
- piscina (mss310) - OnlineStatus.ONLINE
- Ràdio (mss310) - OnlineStatus.ONLINE
- IC-7300 (mss710) - OnlineStatus.ONLINE
- cal menjador (mss710) - OnlineStatus.ONLINE
- cal habitació (mss710) - OnlineStatus.ONLINE
- Hub. casa rebedor (msh300) - OnlineStatus.ONLINE
===============================

2023-01-04 21:15:15.287 WARNING (MainThread) [meross_iot.device_factory] Device Hub. casa rebedor (msh300, uuid 2103044511338226281048e1e9604a43) reported ability Appliance.Digest.Hub. Assuming this is a full-featured HUB.
2023-01-04 21:15:19.735 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up meross_cloud platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/meross_cloud/sensor.py", line 297, in async_setup_entry
    entity_adder_callback()
  File "/config/custom_components/meross_cloud/sensor.py", line 273, in entity_adder_callback
    new_entities.append(Ms100HumiditySensorWrapper(device=d, device_list_coordinator=coordinator, channel=0))
  File "/config/custom_components/meross_cloud/sensor.py", line 81, in __init__
    super().__init__(sensor_class=DEVICE_CLASS_HUMIDITY,
  File "/config/custom_components/meross_cloud/sensor.py", line 41, in __init__
    super().__init__(
  File "/config/custom_components/meross_cloud/__init__.py", line 230, in __init__
    if device.channels is not None and len(device.channels) > 0:
  File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/device.py", line 204, in channels
    return self._channels
AttributeError: 'Ms100Sensor' object has no attribute '_channels'
2023-01-04 21:15:19.770 WARNING (MainThread) [meross_iot.manager] Found a new device Caldera (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-04 21:15:19.775 WARNING (MainThread) [meross_iot.manager] Found a new device piscina (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-04 21:15:19.776 WARNING (MainThread) [meross_iot.manager] Found a new device Ràdio (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-04 21:15:19.777 WARNING (MainThread) [meross_iot.manager] Found a new device IC-7300 (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-04 21:15:19.779 WARNING (MainThread) [meross_iot.manager] Found a new device cal menjador (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-04 21:15:19.780 WARNING (MainThread) [meross_iot.manager] Found a new device cal habitació (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-04 21:15:19.781 WARNING (MainThread) [meross_iot.manager] Found a new device Hub. casa rebedor (msh300, HW 4.0.0, FW 4.1.26, class: msh300:4.0.0:4.1.26) that has become online while we were offline.
2023-01-04 21:15:26.034 WARNING (MainThread) [homeassistant.components.homeassistant.triggers.numeric_state] Error initializing 'Avis caldera' trigger: In 'numeric_state' condition: unknown entity sensor.caldera_mss310_power_w_main_channel
2023-01-04 21:15:26.072 WARNING (MainThread) [homeassistant.components.homeassistant.triggers.numeric_state] Error initializing 'Avis caldera s'ha apagat' trigger: In 'numeric_state' condition: unknown entity sensor.caldera_mss310_power_w_main_channel

Screenshot 2023-01-04 at 20-42-07 Visualització principal – Home Assistant Screenshot 2023-01-04 at 20-41-13 Visualització principal – Home Assistant

albertogeniola commented 1 year ago

Hi, I've just released a new beta version that includes a fix for this issue. Can you please test version 1.2.8rc1? You can test it installing it via HACS. Can you let me know if that solves the issue?

gg131 commented 1 year ago

Hi Alberto. I had the same issue. Now, installing 1.2.8rc1 resolves the situation for mss310x but ms100 (temperature and humidity) remains in unknown status:

AttributeError: 'Ms100Sensor' object has no attribute '_channels'

albertogeniola commented 1 year ago

Hi @gg131 , it looks very strange to me. Class Ms100Sensor extends GenericSubDevice(BaseDevice), which in turn extends BaseDevice(object). The latter does declare _channels in its constructor. I am under the impression your integration is not using the library version 0.4.5.6 (which adds that fix).

Do you mind restarting HA and copy-paste the logs provided at boot when the integration starts? You should see something like the following:

===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.4
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.

What we are looking for is the Low level library version which whould be 0.4.5.6.

TecnoTalarn commented 1 year ago

Hi after install 1.2.8rc1 I see the voltages and power, but no temperatures from ms100 I copy the entire folder into my custom components and restart HA

I paste log again

===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.4
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Caldera (mss310) - OnlineStatus.ONLINE
- piscina (mss310) - OnlineStatus.ONLINE
- Ràdio (mss310) - OnlineStatus.ONLINE
- IC-7300 (mss710) - OnlineStatus.ONLINE
- cal menjador (mss710) - OnlineStatus.ONLINE
- cal habitació (mss710) - OnlineStatus.ONLINE
- Hub. casa rebedor (msh300) - OnlineStatus.ONLINE
===============================
2023-01-05 09:24:22.156 WARNING (MainThread) [meross_iot.device_factory] Device Hub. casa rebedor (msh300, uuid 2103044511338226281048e1e9604a43) reported ability Appliance.Digest.Hub. Assuming this is a full-featured HUB.
2023-01-05 09:24:25.260 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: meross_cloud
2023-01-05 09:24:26.943 WARNING (MainThread) [meross_iot.manager] Found a new device Caldera (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 09:24:26.948 WARNING (MainThread) [meross_iot.manager] Found a new device piscina (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 09:24:26.950 WARNING (MainThread) [meross_iot.manager] Found a new device Ràdio (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 09:24:26.951 WARNING (MainThread) [meross_iot.manager] Found a new device IC-7300 (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 09:24:26.956 WARNING (MainThread) [meross_iot.manager] Found a new device cal menjador (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 09:24:26.957 WARNING (MainThread) [meross_iot.manager] Found a new device cal habitació (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 09:24:26.958 WARNING (MainThread) [meross_iot.manager] Found a new device Hub. casa rebedor (msh300, HW 4.0.0, FW 4.1.26, class: msh300:4.0.0:4.1.26) that has become online while we were offline.
2023-01-05 09:24:27.683 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform meross_cloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 529, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/meross_cloud/__init__.py", line 279, in device_info
    'model': self._device.type + " " + self._device.hardware_version,
  File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/device.py", line 188, in hardware_version
    return "unknown" if self._hwversion is None else self._hwversion
AttributeError: 'Ms100Sensor' object has no attribute '_hwversion'
2023-01-05 09:24:27.704 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up meross_cloud platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 529, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/meross_cloud/__init__.py", line 279, in device_info
    'model': self._device.type + " " + self._device.hardware_version,
  File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/device.py", line 188, in hardware_version
    return "unknown" if self._hwversion is None else self._hwversion
AttributeError: 'Ms100Sensor' object has no attribute '_hwversion'

2023-01-05 09:26:26.755 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform meross_cloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 529, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/meross_cloud/__init__.py", line 279, in device_info
    'model': self._device.type + " " + self._device.hardware_version,
  File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/device.py", line 188, in hardware_version
    return "unknown" if self._hwversion is None else self._hwversion
AttributeError: 'Ms100Sensor' object has no attribute '_hwversion'
TecnoTalarn commented 1 year ago

Again... I delete all meross old files... and restart now low level is correct

===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.6
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Caldera (mss310) - OnlineStatus.ONLINE
- piscina (mss310) - OnlineStatus.ONLINE
- Ràdio (mss310) - OnlineStatus.ONLINE
- IC-7300 (mss710) - OnlineStatus.ONLINE
- cal menjador (mss710) - OnlineStatus.ONLINE
- cal habitació (mss710) - OnlineStatus.ONLINE
- Hub. casa rebedor (msh300) - OnlineStatus.ONLINE
===============================
2023-01-05 09:32:23.042 WARNING (MainThread) [homeassistant.components.ezviz.camera] Found camera with serial D88182508 without configuration. Please go to integration to complete setup
2023-01-05 09:32:23.045 WARNING (MainThread) [homeassistant.components.ezviz.camera] Found camera with serial G68635421 without configuration. Please go to integration to complete setup
2023-01-05 09:32:23.056 WARNING (MainThread) [homeassistant.components.ezviz.camera] Found camera with serial G92058872 without configuration. Please go to integration to complete setup
2023-01-05 09:32:24.677 WARNING (MainThread) [meross_iot.device_factory] Device Hub. casa rebedor (msh300, uuid 2103044511338226281048e1e9604a43) reported ability Appliance.Digest.Hub. Assuming this is a full-featured HUB.
2023-01-05 09:32:29.291 WARNING (MainThread) [meross_iot.manager] Found a new device Caldera (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 09:32:29.294 WARNING (MainThread) [meross_iot.manager] Found a new device piscina (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 09:32:29.295 WARNING (MainThread) [meross_iot.manager] Found a new device Ràdio (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 09:32:29.321 WARNING (MainThread) [meross_iot.manager] Found a new device IC-7300 (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 09:32:29.322 WARNING (MainThread) [meross_iot.manager] Found a new device cal menjador (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 09:32:29.323 WARNING (MainThread) [meross_iot.manager] Found a new device cal habitació (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 09:32:29.323 WARNING (MainThread) [meross_iot.manager] Found a new device Hub. casa rebedor (msh300, HW 4.0.0, FW 4.1.26, class: msh300:4.0.0:4.1.26) that has become online while we were offline.
2023-01-05 09:32:30.231 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform meross_cloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 529, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/meross_cloud/__init__.py", line 279, in device_info
    'model': self._device.type + " " + self._device.hardware_version,
  File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/device.py", line 188, in hardware_version
    return "unknown" if self._hwversion is None else self._hwversion
AttributeError: 'Ms100Sensor' object has no attribute '_hwversion'
2023-01-05 09:32:30.241 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up meross_cloud platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 529, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/meross_cloud/__init__.py", line 279, in device_info
    'model': self._device.type + " " + self._device.hardware_version,
  File "/usr/local/lib/python3.10/site-packages/meross_iot/controller/device.py", line 188, in hardware_version
    return "unknown" if self._hwversion is None else self._hwversion
AttributeError: 'Ms100Sensor' object has no attribute '_hwversion'
albertogeniola commented 1 year ago

Ok, spotted the problem. It's a regression due to the latest changes. Unfortunately, as I am on vacation, I could not test such changes with my devices. I'll release an hotfix right away and let you know when it's ready to be tested.

TecnoTalarn commented 1 year ago

Ok, no problem I only use one of the temperature sensors to active heater floor,I can bypass this sensor over the app for the moment. felice anno nuovo!

TecnoTalarn commented 1 year ago

I also see that there are no updates to the voltage or power information once the HA has booted It is probably due to the same problem.

albertogeniola commented 1 year ago

Hi! Can you test prerelease V1.2.8 and report back please?

TecnoTalarn commented 1 year ago

After 15 minutes i think all is running ok

Grazie mille

TecnoTalarn commented 1 year ago

Sorry I see the ms100 nt reporting correctly the temperature changes voltage and power from mss310 now running fine

TecnoTalarn commented 1 year ago
===============================
Meross Cloud Custom component
Developed by Alberto Geniola
Low level library version: 0.4.5.7
-------------------------------
This custom component is under development and not yet ready for production use.
In case of errors/misbehave, please report it here: 
https://github.com/albertogeniola/meross-homeassistant/issues

If you like this extension and you want to support it, please consider donating.
-------------------------------
List of devices reported by HTTP API:
- Caldera (mss310) - OnlineStatus.ONLINE
- piscina (mss310) - OnlineStatus.ONLINE
- Ràdio (mss310) - OnlineStatus.ONLINE
- IC-7300 (mss710) - OnlineStatus.ONLINE
- cal menjador (mss710) - OnlineStatus.ONLINE
- cal habitació (mss710) - OnlineStatus.ONLINE
- Hub. casa rebedor (msh300) - OnlineStatus.ONLINE
===============================
2023-01-05 19:29:36.621 WARNING (MainThread) [homeassistant.components.ezviz.camera] Found camera with serial D88182508 without configuration. Please go to integration to complete setup
2023-01-05 19:29:36.630 WARNING (MainThread) [homeassistant.components.ezviz.camera] Found camera with serial G68635421 without configuration. Please go to integration to complete setup
2023-01-05 19:29:36.639 WARNING (MainThread) [homeassistant.components.ezviz.camera] Found camera with serial G92058872 without configuration. Please go to integration to complete setup
2023-01-05 19:29:36.983 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.solar_radiation (<class 'custom_components.ecowitt.sensor.EcowittSensor'>) is using native unit of measurement 'W/m^2' which is not a valid unit for the device class ('illuminance') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
2023-01-05 19:29:37.247 WARNING (MainThread) [meross_iot.device_factory] Device Hub. casa rebedor (msh300, uuid 2103044511338226281048e1e9604a43) reported ability Appliance.Digest.Hub. Assuming this is a full-featured HUB.
2023-01-05 19:29:41.766 WARNING (MainThread) [meross_iot.manager] Found a new device Caldera (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 19:29:41.786 WARNING (MainThread) [meross_iot.manager] Found a new device piscina (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 19:29:41.787 WARNING (MainThread) [meross_iot.manager] Found a new device Ràdio (mss310, HW 6.0.0, FW 6.3.21, class: mss310:6.0.0:6.3.21) that has become online while we were offline.
2023-01-05 19:29:41.795 WARNING (MainThread) [meross_iot.manager] Found a new device IC-7300 (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 19:29:41.802 WARNING (MainThread) [meross_iot.manager] Found a new device cal menjador (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 19:29:41.803 WARNING (MainThread) [meross_iot.manager] Found a new device cal habitació (mss710, HW 6.0.0, FW 6.3.2, class: mss710:6.0.0:6.3.2) that has become online while we were offline.
2023-01-05 19:29:41.818 WARNING (MainThread) [meross_iot.manager] Found a new device Hub. casa rebedor (msh300, HW 4.0.0, FW 4.1.26, class: msh300:4.0.0:4.1.26) that has become online while we were offline.
2023-01-05 19:29:41.838 WARNING (MainThread) [meross_iot.manager] Found a new device termòstat entrada (ms100, HW unknown, FW unknown, class: Ms100Sensor) that has become online while we were offline.
2023-01-05 19:29:41.849 WARNING (MainThread) [meross_iot.manager] Found a new device Menjador (ms100, HW unknown, FW unknown, class: Ms100Sensor) that has become online while we were offline.
2023-01-05 19:29:41.850 WARNING (MainThread) [meross_iot.manager] Found a new device termòstat habitació (ms100, HW unknown, FW unknown, class: Ms100Sensor) that has become online while we were offline.
albertogeniola commented 1 year ago

Hi @TecnoTalarn , from the logs you posted it seems there is no evident error. Which device is not reporting correctly? Can you see any other log entry imputable to the sensor?

TecnoTalarn commented 1 year ago

Hi Alberto Yes it works... sometimes ms100 are very slow... I see that in the time I've been doing other things, the ms100 has reported changes every 15 min or so. enough for me

Just close again this issue. work fine!

albertogeniola commented 1 year ago

Awesome, nice!