Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in LOG after upgrading to the latest version #34

Closed
Joao-Sousa-71 opened this issue Sep 22, 2023 · 7 comments
Closed

Error in LOG after upgrading to the latest version #34

Joao-Sousa-71 opened this issue Sep 22, 2023 · 7 comments

Comments

@Joao-Sousa-71
Copy link

Joao-Sousa-71 commented Sep 22, 2023

Upgrade done using HACS teh Delete the old configuration and create a new one.
HA version: 2023.9.2
ERSE Version 2.2.0

Log error
2023-09-22 23:49:12.080 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up erse platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/erse/sensor.py", line 79, in async_setup_entry TariffCost(hass, config_entry.entry_id, tariff, meter_entity) File "/config/custom_components/erse/sensor.py", line 419, in __init__ self._attr_name = hass.states.get(meter_entity).attributes.get("friendly_name") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'attributes'

The entities were created

image

But after a HA restart, they are no longer available:

image

And then with a reload they seem to be available again:

image

Thank you for this awesome component!

@dgomes
Copy link
Owner

dgomes commented Sep 23, 2023

Parece ser um problema com o teu source_meter

Podes verificar se ele tem um nome atribuído ou usa o default ?

@dgomes
Copy link
Owner

dgomes commented Sep 23, 2023

Sera que podes utilizar a ultima versão "beta" ? (é preciso ir as configurações do HACS escolher "beta")

@Joao-Sousa-71
Copy link
Author

Duarte, obrigado pela ajuda/resposta :-)
A mim apareceu-me a V2.20 no HACS sem selecionar a opção de Beta e e entretanto o Nikito também me aconselhou o mesmo e vou experimentar agora

O meus Utility Meters estão criados no configuration.yaml desta forma

han_daily_total_energy_consumed: source: sensor.eb3_import cycle: daily tariffs: - Fora de Vazio - Vazio han_monthly_total_energy_consumed: source: sensor.eb3_import cycle: monthly offset: days: 4 tariffs: - Fora de Vazio - Vazio
em que o sensor.eb3_import é gerado pelo atraves do EasyHan.

Ja te digo alguma coisa.
Obrigado.

@Joao-Sousa-71
Copy link
Author

Instalei a beta:

image

Depois reiniciei o HA e configurei o Componente:

image

image

image

Os sensores são criados mas ficam em estado 'unknown'

image

E depois se reinicio o HA tenho a mesmo erro no Log:

2023-09-23 22:37:30.684 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up erse platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/erse/sensor.py", line 79, in async_setup_entry TariffCost(hass, config_entry.entry_id, tariff, meter_entity) File "/config/custom_components/erse/sensor.py", line 419, in __init__ self._attr_name = hass.states.get(meter_entity).attributes.get("friendly_name") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'attributes'

e apos reiniciar os sensores ficam assim

image

Fiz a mesma configuração que tinha com a 2.1.7.
Ideias?

@dgomes
Copy link
Owner

dgomes commented Sep 23, 2023

Screenshot 2023-09-23 at 23 01 21

Quando activas a opção BETA surge uma versão "master" é essa que tens q instalar

@nikito7
Copy link

nikito7 commented Sep 23, 2023

Sensores criados de raiz funciona.

Screenshot_20230923_230941_Home Assistant

2.2.0

@Joao-Sousa-71
Copy link
Author

Duarte e Nikito, depois de instalar a Beta (selecionando a Master), começou a funcionar :-)
Nem foi preciso executar a configuração de novo:

image

Ainda faltam 12 dias e a conta ja vai alta :-D e estamos no verão!
Obrigado a ambos e bom resto de fim de semana!
Vou fechar a issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants