0.111: Frontend loaded sooner, Elexa Guardian, Unify Circuit, Acmeda

sure, no confusion there…

just got another cryptic one… no lead whatsoever:

2020-06-12 12:48:13 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2881955472] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 95, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 265, in handle_render_template
    state_listener()
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 253, in state_listener
    msg["id"], {"result": template.async_render(variables)}
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 228, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 4, in top-level template code
TypeError: 'NoneType' object is not iterable

why even bother logging this without source of the error, or a direct link to the websocket_api.http.connection.2881955472 which, as far as I know is untracable either?

btw, I think (hope) to have found the culprits for the earlier attributes error, a set of rather complex template sensors:

      frontdoor_schedule:
        friendly_name: Frontdoor schedule
        value_template: >
          {{state_attr('sensor.hue_schedule','119').conditions[3].value}}
#{{states.sensor.hue_schedule.attributes['119'].conditions[3].value}}

have 13 of these, so there you go…

Try checking your Lovelace config as well. I use my card-templater custom card in several parts of mine and found I had a few uses of attributes that I needed to replace with state_attr to make the errors go away.

Stop looking at the top of the error. Look bottom up always. It’s a stack. This is how errors work in python.

Your issue is that you’re iterating through an object that doesn’t exist on startup. So look at for loops with at least 4 lines where the 4th line is performing the iteration.

1 Like

ok I will Steven, not using card-templates myself, but do use some jinja templating… in Lovelace cards (Markdown, template-entity-row)

I was able to adjust the markdown :

    style: |
      ha-card {
        background-color: transparent;
        box-shadow: none;
        font-size: 15px;
        font-weight: 300;
        
      }
      ha-markdown {
        padding-top: 1px !important;
        padding-left: 1px !important;
        padding-bottom: 0px !important;

      }                      
    type: markdown

Since upgrade to ver. 111 the history cards behave strange. Eg. If I add a history card for a binary sensor it shows me the correct history status:
image

Then, if I refresh the webpage (SHIFT+click on refresh) the history card will transform into:
image

Basically the active (green) status is gone (all active statuses are gone).
This is happening in latest version of Firefox 77.0.1, but also in other browsers eg. Opera/Chrome.

Is anybody experiencing same behavior maybe?

Thanks.

could this be it:

          {% set player = 'sensor.plex' %}
          {% if states(player) != '0' %}
            {%- for attr in states[player].attributes %}
              {%- if not attr in ['friendly_name','unit_of_measurement','icon','entity_picture'] %}
                {{attr}} is watching {{states[player].attributes[attr]}}
              {%- endif %}
            {%- endfor %}
          {% else %} Watching Plex: {{states(player)}}
          {% endif%}

nope, the error indicates that the object you’re iterating through is None. Attributes is always a dictionary. If it exists, it can be iterated.

hmm, only other for I can find (with a non existing attributes.source for now, thank goodness) is this:

          {% set km = states('input_number.quakes_near')|float %}
          {% set location = states('input_select.quakes_near') %}
          {% set ns = namespace(count=0) %}
          {% for s in states.geo_location|selectattr('attributes.source','eq','usgs_earthquakes_feed') %}
            {% if distance(s.entity_id,location) < km %}
              {% set ns.count = ns.count + 1 %}
            {%- endif %}
          {% endfor %}
          {{ns.count}}

should there be a guard here too? which isn’t too obvious using a for loop…(sorry for misusing this thread, promise to take a next one to a dedicated one, apologies)

That’s unrelated to the Home Assistant install. I’d either start a fresh thread, or head over to the Discord server.

What is the internet time in the logbook?
I think until v. 0.110.7 was not there.
Is it a sensor? How I can exclude it from logbook and recordings?

I’m having too this type of error

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 95, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 265, in handle_render_template
    state_listener()
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 253, in state_listener
    msg["id"], {"result": template.async_render(variables)}
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 230, in async_render
    raise TemplateError(err)
homeassistant.exceptions.TemplateError: UndefinedError: 'None' has no attribute 'attributes'
2020-06-12 15:13:58 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139625112648272] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 228, in async_render
    return compiled.render(kwargs).strip()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/usr/local/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 3, in top-level template code
  File "/usr/local/lib/python3.7/site-packages/jinja2/sandbox.py", line 407, in getattr
    value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'None' has no attribute 'attributes'

Are you using any package, like “My Garden Irrigation” ?
It’s very difficult to find an issue like this without having more details…

this one was spotted easily, in hindsight…

see if you have any templates in the format

states.domain.object_id.attributes

and rewrite these to use the state_attr() format, see Template - Home Assistant

I’ve tried both of those in the Developer Tools > Template. I don’t have any of the entities you use in them, so if these were causing the errors then I would expect to have errors in the log, but they both worked (the first one returned blank and the second returned 0). However, you might be able to make the first one a bit safer, by changing:

{% if states(player) != '0' %}

to

{% if states(player) not in ['0', 'unavailable', 'unknown'] %}

This would specifically catch if the Plex sensor is unavailable or the state is unknown.

Thanks @Mariusthvdb

So, should I check and change all like these below, just displaying an attribute or only testing it’s value

Just display
{{ states.binary_sensor.sensore_finestra_bagno.state }}

</ha-icon><span>Batteria: <span style="color: var(--text-color-sensor);">${states['sensor.temp_soggiorno_3'].attributes.battery_level}%</span></span>

Testing value
{% if (states["binary_sensor.dpc_roma_temporali_oggi"].attributes.allerta == 'GIALLA') %}

simply rewrite them all. it will benefit your setup forever :wink:

{{states('binary_sensor.sensore_finestra_bagno')}}

and

{% if state_attr('binary_sensor.dpc_roma_temporali_oggi','allerta') == 'GIALLA' %}

or even

{% if  is_state_attr('binary_sensor.dpc_roma_temporali_oggi','allerta','GIALLA') %}

never saw the format of your last template, so maybe that caused issued on its own…

2 Likes

It seems it is being worked on: #36599 and #36716

1 Like

Stale bot closes issues that did not receive any response, to prevent that from happening in the future make sure to respond when it comments or just report on every update whether it was fixed or not. This is standard for all issues, I know it may not make sense but sometimes issues do get fixed over time and users forget to report back so stale bot needs to account for that.

Its a completely separate integration from xiaomi_aqara so it will be new entities.

I’m on 110.4 and no option to update in the supervisor. Any ideas?

ssh in, and issue

ha core update --version 0.111.0