Thanks for the idea, works great, I had to use states and not state_attr though as the HERE integration doesn’t use attributes any more, they are all separate sensors
Yes, I’m still on the former version 2022.7.x and simply preparing the update
It’s something funny, we have to think about deeper:
A sensor has been splitted into different entities which we have to combine again in a template sensor in order to work with it as before.
I think I read it was something to do with an issue of the route being over 255 chars sometimes so had to be split out. It’s only a hack for the travel-time-card until it is updated (if at all)
which brings me back to my issue, that I wanted to filter out of the route only the highways.
So let’s look for a solution to filter the state. A new project…
Solution if the number, order and total of highways is known:
{% set route = state_attr('sensor.jorg_arbeitsweg','route') %}
{% set hlist = ('A44', 'A57', 'A52', 'A3', 'A42') %}
{% set i = 0 %}
{% for i in range(0,5) %}
{%- if hlist[i] in route -%}
{{ hlist[i] }},
{%- endif -%}
{%- endfor %}
If sombody have an idea how to make this mor flexible (the order of highways could change), the solution would be highly appreciated
regex explanation: N[0-9]{2,3} matches anything starting with N and then 2 or 3 digits [^;]+ matches anything except a ; of any length ; finaly matches the ; that seperates entries.
Hi, before I open a ticket and the devs decide to depricate the route entity I start discussion here:
I already updated to 8.6 and directly recieve these errors:
Logger: homeassistant
Source: core.py:1099
First occurred: 15:36:59 (4 occurrences)
Last logged: 15:51:59
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 151, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
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 646, in _async_write_ha_state
self.hass.states.async_set(
File "/usr/src/homeassistant/homeassistant/core.py", line 1438, in async_set
state = State(
File "/usr/src/homeassistant/homeassistant/core.py", line 1099, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.jorg_arbeitsweg_route. State max length is 255 characters.
I have a longer distance to my workplace. So it is possible that the route seem to provide some characters more.
Isn’t it possible to simply cut the characters on the max length point?
May I can configure that, what I did in the template sensor shown above.
The way I see it is that Frenck is punishing me and every user of the integration because I was “modernizing” it. I am really close to giving up maintaining my integrations =(
I noticed yes, and I have added my hope in a comment HA wont simply cut essential information (because we can open another app), but instead start a dialogue how we can keep that info.
Given the stance the devs take, I have not much confidence it will be changed anytime soon, so I would certainly +1 the Here travel time Custom component, with the full route as attribute! (dont truncate it as standalone sensor.)
The way this attribute is used in a dynamic setup, there would hardly be any issue in recorder, especially since we dont record it at all… nor auto refresh (enable polling)
for that reason alone I fail to comprehend Frencks decision, or Balloobs remark on the app.
That way we would keep the best of both worlds.
As I tested Waze before, I ended up preferring Here. Have to lookup why that was, Could it have to do with Google being an owner?
Waze did never work that accurate for me. So it is no choice for me. I always would use Here.
And thats what I meant above: make a custom component out of this and store your integration work as experience
It is useless to struggle with the devs and your’re much more flexible in case of bugfixing or improvements.