0.115: B-Day release! Media browser, tags, automations & WTH

Followupā€¦I upgraded to 0.115.1, and probably a few other things and now the custom cards are back.

I canā€™t say what action caused them to come back.

The mediabrowser is a very cool addition, is there a reason it doesnā€™t support (doesnā€™t show) symbolic links inside the /media directory? This is a common feature on Linux.

kodi issue fixed in 115.1

1 Like

With the addition of the following, do I set homeassistant.core to debug?

Log template listeners when debug logging is on ([@bdraco](https://github.com/bdraco) - [#40180](https://github.com/home-assistant/core/pull/40180))

Iā€™m having the same issue with container on a raspberry pi. Submitted an issue on github and it seems like others are seeing it as well. I rolled back to 0.115b1 and donā€™t have any problems.

Iā€™m sorry I havenā€™t found the time yet to try what you suggested.
After updating to 0.115.1 I have enabled the debug logging and noticed that many requests came from the deConz integration, in fact after removing the usb dongle the cpu load dropped drastically returning to an average of 5%.
Now that I think I have identified the problem, however, I have no idea how to fix it.

homeassistant.event for the template logging

Google Home tts cloud seems broken (v0-115-1)

configuration.yaml:

tts:
  - platform: google_cloud
    key_file: <secret>.json
    language: en-US
    gender: female
    voice: en-US-Wavenet-D
    encoding: linear16
    speed: 1.1
    pitch: 0
    gain: 0.0
    profiles:
      - medium-bluetooth-speaker-class-device

Log:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 206, in _async_step
    await getattr(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 416, in _async_call_service_step
    await self._async_run_long_action(service_task)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 375, in _async_run_long_action
    long_task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 215, in service_handler
    await script_entity.async_turn_on(
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 320, in async_turn_on
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 944, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 198, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 206, in _async_step
    await getattr(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 167, in async_say_handle
    url = await tts.async_get_url(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 340, in async_get_url
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 367, in async_get_tts_audio
    data = self.write_tags(filename, data, provider, message, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 470, in write_tags
    tts_file["artist"] = artist
  File "/usr/local/lib/python3.8/site-packages/mutagen/_file.py", line 74, in __setitem__
    self.tags[key] = value
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_tags.py", line 339, in __setitem__
    raise TypeError("%r not a Frame instance" % tag)
TypeError: 'en-US-Wavenet-D' not a Frame instance

I also notice a much higher CPU usage in 0.115 (~23%) than 0.114 (~10%).

I have some template sensors that count stuff, like lights on as in the code below. Should these be changed as well?

count_all_inside_lights_on:
  # entity_id: sensor.time
  friendly_name: 'Aantal lampen binnen aan'
  icon_template: >
    {% if is_state('group.inside_lights', 'on') %}
      mdi:lightbulb-on
    {% else %}
      mdi:lightbulb-off
    {% endif %}
  value_template: >
    {% set count = namespace(value=0) %}
    {%- for entity_id in states.group.inside_lights.attributes.entity_id if states(entity_id) == 'on' -%}
      {% set count.value = count.value + 1 %}
    {%- endfor %}
    {{ count.value }}
count_all_doors_open:
  friendly_name: 'Aantal deuren open'
  # entity_id:
  #   - binary_sensor.diepvriesdeur
  #   - binary_sensor.garagedeur
  #   - binary_sensor.keukendeur
  #   - binary_sensor.koelkastdeur
  #   - binary_sensor.tuindeur
  #   - binary_sensor.tuindeur_speelkamer
  #   - binary_sensor.tuinpoort_deur
  #   - binary_sensor.voordeur
  icon_template: >
    {% if states.binary_sensor | selectattr('state', 'eq', 'on') | selectattr('attributes.device_class', 'eq', 'door') | list | count | int > 0 %}
      mdi:door-open
    {% else %}
      mdi:door-closed
    {% endif %}
  value_template: >-
    {{ states.binary_sensor | selectattr('state', 'eq', 'on') | selectattr('attributes.device_class', 'eq', 'door') | list | count | int }}
1 Like

Try turning on the debug logging for homeassistant.event in 0.115.1 to see if its templates that are the issue so you donā€™t spent a lot of time optimizing templates if they arenā€™t the issue.

For count_all_inside_lights_on, something like this would be more efficient:

{{ expand('group.inside_lights') | selectattr('state', 'eq', 'on') | list | count | int }}

2 Likes

Wow really nice release ! a lot of cool thing ! but Iā€™m a bit lost ā€¦ Am I suppose to be able to take Spotify music and lunch it on a google home ? or could It be a future feature that integrate something like spot cast ?

Ever since updating to version 0.114 my webOS integration stopped working. Did I miss any breaking change?

Works for me on 0.115, I have not changed anything since I added it in may/june (I think)

Not seeing anything in the logs with homeassistant.event set to debug.

That probably means the performance issue is somewhere else (not related to templates), and we will need a py-spy to diagnose it.

I confirm. Itā€™s the same for me.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 206, in _async_step
    await getattr(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 167, in async_say_handle
    url = await tts.async_get_url(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 340, in async_get_url
    filename = await self.async_get_tts_audio(
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 367, in async_get_tts_audio
    data = self.write_tags(filename, data, provider, message, language, options)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 470, in write_tags
    tts_file["artist"] = artist
  File "/usr/local/lib/python3.8/site-packages/mutagen/_file.py", line 74, in __setitem__
    self.tags[key] = value
  File "/usr/local/lib/python3.8/site-packages/mutagen/id3/_tags.py", line 339, in __setitem__
    raise TypeError("%r not a Frame instance" % tag)
TypeError: 'pl-PL-Standard-A' not a Frame instance

Iā€™m still not able to get py-spy installed on pi, any alternative?

Linux hassbian 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l

system info:
  Distro......: Raspbian GNU/Linux 10 (buster)
  Kernel......: Linux 5.4.51-v7+

  Uptime......: up 14 hours, 38 minutes
  Load........: 0.86 (1m), 0.96 (5m), 0.99 (15m)
  Processes...: 120 (root), 20 (user) | 140 (total)

  CPU.........: ARMv7 Processor rev 4 (v7l)
  Memory......: 271Mi used, 29Mi free, 925Mi in total

services:
  home-assistant@homeassistant:  active

Same here, HA has become completely unusable :frowning:

The three most common options are:

  1. Pre-built binaries from https://github.com/benfred/py-spy/releases/tag/v0.3.3
  2. Install via pip pip install py-spy
  3. Install via cargo cargo install py-spy. (youā€™ll need to install cargo first if its not already there via apk add cargo or apt-get install cargo or yum install cargo)

Same here, nothing in the logs.

Thx, changed these templates.

Will have a look at py-spy.