question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error adding entities for domain sensor with platform multiscrape

See original GitHub issue

Hi Daniel,

First of all many thanks for your great module multiscrape. After updating Home assistant and multiscrape, I got. an error-message. Home assistant does not view my entities I declared with multiscrape. After checking my logs, I located this behavour in the line where I defined the unit of my measurement. I think that this depence by changes of the ‚core‘ Home Assistant 2022.4.1

thanks

Erich

Version of the custom_component

v5.7.0

Configuration

If unit_of_measurement is used

Describe the bug

When I use unit_of_measurement im my configuration.yaml i get the error. When comment out, everything works fine

Debug log

Logger: homeassistant.components.sensor Source: components/sensor/init.py:454 Integration: Sensor (documentation, issues) First occurred: 10:33:24 (2 occurrences) Last logged: 10:33:24

Error adding entities for domain sensor with platform multiscrape Error while setting up multiscrape platform for sensor 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 614, in _async_add_entity await entity.add_to_platform_finish() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 799, in add_to_platform_finish self.async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 532, in async_write_ha_state self._async_write_ha_state() File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 570, in _async_write_ha_state state = self._stringify_state(available) File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 538, in _stringify_state if (state := self.state) is None: File “/usr/src/homeassistant/homeassistant/components/sensor/init.py”, line 454, in state assert native_unit_of_measurement AssertionError

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danieldotnlcommented, Apr 13, 2022

While this may fix existing configurations where unit_of_measurement and device_class is defined, personally I don’t think that approach is accurate. Home Assistant introduced the values native_unit_of_measurement and native_value so I think it would be better to expose these values through multiscrape, no?

Would it be worth breaking the config of all users with no obvious advantage? The template sensor included in HA does the same thing…

0reactions
ErichRacommented, Apr 14, 2022

For me ist not clear why there is a special handling for devices with device_class temperature.

The unit of measurement that the sensor’s value is expressed in. If the native_unit_of_measurement is °C or °F, and its device_class is temperature, the sensor’s unit_of_measurement will be the preferred temperature unit configured by the user and the sensor’s state will be the native_value after an optional unit conversion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Error adding entities for domain sensor with platform ... - GitHub
The problem. During start-up the logs brings up the stacktrace below. I cannot figure out, what's wrong. I also have these random numbers ......
Read more >
Issue with Multiscrape/Scrape - Home Assistant Community
I am getting the following error however… Error while setting up multiscrape platform for sensor. Traceback (most recent call last):
Read more >
Issue with Multiscrape
Error while setting up multiscrape platform for sensor ... domain: media_player ... I've been struggling with adding a Nexa LMDT-810 motion sensor.
Read more >
Aarlo Error adding entities for domain camera with platform aarlo
I'm having some problems setting up aarlo. I had it working and then after some minor changes (swapping to an aarlo gmail account...
Read more >
HA Perdendo Conexão - Ajuda - Fórum Home Assistant Brasil
Setup of sensor platform multiscrape is taking over 10 seconds. 14:49:35 – (AVISO) Sensor ... Error adding entities for domain sensor with platform...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found