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 adding entities for domain sensor with platform sems #93

Open
alexcool83 opened this issue Nov 26, 2023 · 1 comment
Open

Error adding entities for domain sensor with platform sems #93

alexcool83 opened this issue Nov 26, 2023 · 1 comment

Comments

@alexcool83
Copy link

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 582, in _async_add_entity
entity_name = entity.name
^^^^^^^^^^^
File "/config/custom_components/sems/sensor.py", line 169, in name
return f"Inverter {self.coordinator.data[self.sn]['name']}"

KeyError: 'name'
@RobSmyth
Copy link

I think I'm seeing the same error. It was working fine but after a complete system shutdown I get this error:

2023-12-28 11:26:15.418 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: multiply got invalid input 'None' when rendering template '{{ (state_attr('sensor.smart_meter', 'loadStatus') | multiply(-1) * state_attr('sensor.smart_meter', 'grid') | float(0) * 1 / 1000) | round(1) }}' but no default was specified') while processing template 'Template<template=({{ (state_attr('sensor.smart_meter', 'loadStatus') | multiply(-1) * state_attr('sensor.smart_meter', 'grid') | float(0) * 1 / 1000) | round(1) }}) renders=22>' for attribute '_attr_native_value' in entity 'sensor.solar_smart_meter_grid_kw' 2023-12-28 11:26:17.248 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform sems Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 584, in _async_add_entity entity_name = entity.name ^^^^^^^^^^^ File "/config/custom_components/sems/sensor.py", line 169, in name return f"Inverter {self.coordinator.data[self.sn]['name']}" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ KeyError: 'name'

I have not changed anything that I can think of. Does anybody know how to fix?

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

2 participants