PiotrMachowski / Home-Assistant-custom-components-Xiaomi-Vacuum-Map-Camera

MIT License
36 stars 2 forks source link

Error after HA start #6

Open panoskpv opened 2 years ago

panoskpv commented 2 years ago

I have the below error after HA start and although a camera entity is created, there are no data even after the first start.

Error adding entities for domain camera with platform xiaomi_vacuum_map
Error while setting up xiaomi_vacuum_map platform for camera

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 613, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 748, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 505, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in _async_write_ha_state extra_state_attributes = self.extra_state_attributes File "/config/custom_components/xiaomi_vacuum_map/camera.py", line 76, in extra_state_attributes "vacuum_status": self.hass.states.get(self._vacuum_entity).state AttributeError: 'NoneType' object has no attribute 'state'

I just want to use your great HA card with a valetudo installed roborock v1. Thank you.

PiotrMachowski commented 2 years ago

Have you used this integration before or is it a first setup?

panoskpv commented 2 years ago

Thank you for the swift response. I have manually added it in HA few months ago and re-installed it today via HACS. Files in relevant folder (camera.py etc) are the newest ones

PiotrMachowski commented 2 years ago

Ok, so it was working before?

panoskpv commented 2 years ago

No. But I think I had problems with SSH to the vacuum. But I don't remember errors in logs. Any idea. Please note that I have HA os in case this changes anything

PiotrMachowski commented 2 years ago

Well, to be honest I don't think this custom component is a good way to get a map from your vacuum... I can't believe it's not Valetudo is probably a better choice

panoskpv commented 2 years ago

The problem is the calibration. In this model map is regenerated every time vacuum starts and the rotation of the map is not the same.

PiotrMachowski commented 2 years ago

Ok, have you provided a correct vacuum entity id?

panoskpv commented 2 years ago

I tried both valetudo and xiaomi miio intities with the same result

PiotrMachowski commented 2 years ago

Ok, I will have to try setting up this integration again. I haven't used it for ages

panoskpv commented 2 years ago

Thank you for the support