2021.4: For our advanced users ❤️

Bug reports go to githib.

1 Like

I’ve checked https://version.home-assistant.io/stable.json and it changes to 2021.3.4 from time to time. So not an issue with HA but with release deployment

1 Like

I’d the same issue after upgrading…
I removed the version sensors from my system, rebooted then re added them, and all working fine now. :+1:t2:

Yes, happened to me a couple times after upgrading.
Now its stable at 2021.4

I have the same error. I tried removing ZHA but no luck.

Logger: homeassistant.setup
Source: setup.py:162
First occurred: 10:43:23 AM (1 occurrences)
Last logged: 10:43:23 AM

Setup failed for zha: Unable to import component: cannot import name 'setup' from 'zhaquirks' (/config/deps/lib/python3.8/site-packages/zhaquirks/__init__.py)

Anyone has a solution?

Clearly listed right on top of the analytics page :thinking:!?

1 Like

Still changing here

Yes, because the correct keywords are false or False. So potentially your template never actually worked as you intended, but now the log is able to tell you that.

So not really a “fat bug” as you called it, but “user error” :wink: .

See Jinja docs: Template Designer Documentation — Jinja Documentation (2.11.x)

The special constants true, false, and none are indeed lowercase. Because that caused confusion in the past, (True used to expand to an undefined variable that was considered false), all three can now also be written in title case (True, False, and None). However, for consistency, (all Jinja identifiers are lowercase) you should use the lowercase versions.

Or HA docs: Templating - Home Assistant

4 Likes

Really appreciate the heads up about being patient with the upgrade.
My 42 million records DB (~20GB) took around 9 hours to finish:
image

2 Likes

I have this same issue. Would love a solution!

I upgraded to 2021.4.0 and now my HA shows me the 2021.3.4 rlease as the last one.
Do I need to rollback ???

top of each page.

We are currently experiencing issues handing the amount of data, because of that only the active installations graph is being updated.


No! Do not rollback, it is not needed

This seems more correct, no clue if it will work. But it takes percentage and returns an int ranging from 1 to 4 and vice versa.

  - platform: mqtt
    name: "Master Bedroom Fan"
    command_topic: "cmnd/iFan03-2/FanSpeed"
    state_topic: "stat/iFan03-2/RESULT"
    state_value_template: >
      {% if value_json.FanSpeed is defined %}
        {% if value_json.FanSpeed == 0 -%}off{%- elif value_json.FanSpeed > 0 -%}on{%- endif %}
      {% else %}
        {% if states.fan.master_bedroom_fan.state == 'off' -%}off{%- elif states.fan.master_bedroom_fan.state == 'on' -%}on{%- endif %}
      {% endif %}
    availability_topic: tele/iFan03-2/LWT
    payload_off: "off"
    payload_on: "on"
    payload_available: Online
    payload_not_available: Offline
    percentage_command_template: "{{ (value | int / (100 / 3)) | int + 1 }}"
    percentage_command_topic: "cmnd/iFan03-2/FanSpeed"
    percentage_state_topic: "stat/iFan03-2/RESULT"
    percentage_value_template: "{{ (value | int - 1) * 100/3 }}"
    speed_range_max: 4 

precentage_command_template might use percent too. Not entirely sure what the standard is in MQTT. It’s either value or percent.

Also, if your fan expects 0 through 3, this will need to be adjusted.

So to recap, the goal should be:

percentage_command_template converts a base 100 number into your values that the fan accepts. I.e. maps 1 to 100 to 0 to 3 or 1 to 4.

percentage_value_template takes the value and maps 0 to 3 or 1 to 4 to 1 to 100.

1 Like

Yep… I’ve taken this syntax from some tutorial on regex_search/replace, and it never gave me a warning or error, and sure it worked - just replace/search stuff and that’s it. I never really thought about the need of this, untill one day I omitted this part and it still worked. Infact, one could easily not use this param since in HA everything is lowercase… But today I started getting warnings from long forgotten scripts that I coded half a year ago… And in 1 hour I’ve got … 5 500 000 of such warnings, all for one reasonf - FALSE. So, I assumed, that since it did work all that time, it is ok to pass it as it was in that manual.

since 2021.4 upgrade I am getting this warning:

Logger: homeassistant.helpers.template
Source: helpers/template.py:1335
First occurred: 13:07:13 (1771 occurrences)
Last logged: 13:31:22

Template variable warning: float object has no element 1 when rendering '{{value_json['ENERGY']['Factor'][1]}}'
Template variable warning: int object has no element 0 when rendering '{{value_json['ENERGY']['Voltage'][0]}}'
Template variable warning: int object has no element 1 when rendering '{{value_json['ENERGY']['Voltage'][1]}}'
Template variable warning: float object has no element 0 when rendering '{{value_json['ENERGY']['Current'][0]}}'
Template variable warning: float object has no element 1 when rendering '{{value_json['ENERGY']['Current'][1]}}'

What’s creating those sensors? The errors are telling you that you don’t need the [1], [0]'s at the end of your templates.

Just a question… If you don’t care that much about your history, will delete the db file and restart then upgrade make it faster?
I see a few posts of very long upgrade times.

same here, 2h it’s “working” for now

That’s what I would do