Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 107877

Error while setting up file platform for sensor

$
0
0

Hi,

since 2021.6.2 my sensor to read the log file doesn’t work anymore.

I get:

Error adding entities for domain sensor with platform file
Error while setting up file platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 615, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 494, in _async_write_ha_state
    self.hass.states.async_set(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1218, in async_set
    state = State(
  File "/usr/src/homeassistant/homeassistant/core.py", line 906, in __init__
    raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.log_tail. State max length is 255 characters.

This is my configuration on the sensor.yaml

 - platform: file
    file_path: /config/home-assistant.log
    name: Log tail
    value_template: >
      {{value|truncate(255,True)}}

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 107877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>