Suit yourself. Upgrade python then.
Working on it.
Enjoy OpenHAB. Goodbye.
Downgrade? Troubleshooting? Backup?
Good luck with openHAB
Hi Mutt,
Of course I understand the sensor now is a timestamp, and doesn’t change, nor does its last_changed change. But, last_changed is necessary for the relative() function to work using a
datetime object to its human-friendly “age” string
and it is odd the relative_time doesn’t auto update in the template editor, since it is, well, exactly that, relative to now.
same goes for the template using now(), which should always be updated each minute, on the minute.
as for your template, because my instance hasnt reached a day yet, it shows a bit odd. Using a somewhat changed version of the sensor we created sometime ago:
ha_uptime_phrase:
friendly_name: Ha uptime phrase
value_template: >-
{% set up_time = as_timestamp(now())-as_timestamp(states('sensor.uptime')) %}
{% if up_time == 0 %}
Just restarted...
{% else %}
{% set seconds = up_time|int %}
{% set minutes = (up_time // 60)|int %}
{% set hours = minutes // 60 %}
{% set days = hours // 24 %}
{% set weeks = days // 7 %}
{% set seconds = seconds % 60 %}
{% set minutes = minutes % 60 %}
{% set hours = hours % 24 %}
{% set days = days % 7 %}
{% macro phrase(value,name) %}
{%- set value = value %}
{%- set end = 's' if value > 1 else '' %}
{{- '{} {}{}'.format(value,name,end) if value|int > 0 else '' }}
{%- endmacro %}
{% set text = [phrase(weeks,'week'),phrase(days,'day'),phrase(hours,'hr'),
phrase(minutes,'min'),phrase(seconds,'sec')]
|select('!=','')|list|join(', ') %}
{% set last_comma = text.rfind(',') %}
{% if last_comma != -1 %}
{% set text = text[:last_comma] + ' and' + text[last_comma + 1:] %}
{% endif %}
{{text}}
{% endif %}
but, my issue is with the auto-updating in the template editor… not so much with the above calculation
I’m having some problems with HA since this release. I updated both core and hass.io around 2pm yesterday (AU time). All was all good until around 8pm when the HA front-end became unresponsive - no access via internet or local IP. I restarted the box a few times but nothing. however, Samba still worked and I could access the logs, I was getting this message:
WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
repeated every minute. I couldn’t figure it out, however this morning HA was back up and running. happy days.
This evening though… it happened again! full log below:
2020-12-15 19:02:53 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bureau_of_meteorology which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-15 19:02:54 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for scheduler which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-15 19:02:54 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-15 19:03:07 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2020-12-15 19:03:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:04:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:05:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:06:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:07:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:08:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:09:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:10:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:11:54 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:12:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:13:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:14:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:15:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:16:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:17:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:18:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:19:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:20:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:21:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:22:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:23:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:24:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:25:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
2020-12-15 19:26:55 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: recorder
I’m ignoring the HACS, BOM and scheduler warnings - these have been running for weeks with no problems.
anyone else seen anything like this?
I seam to recall the recorder error when my database got corrupted
Marius,
But relative_time() is a function just like now() so the same rules would apply (except Teras (and others)) petitioned for a) a cleaner (well less longwinded) transition step for some templates AND b) an easier way to re-establish the 1 minute update lost by not having an entity id of sensor time.
I know you know all this, so I don’t understand why you think this is a problem ?
I figured that might be the case, but when it started working again this morning (and ran just fine all day) I thought the database might be ok (or at least automagically repaired?) …I’m hoping the magic returns tonight. Is there a way of repairing a corrupted database? or should I just restore from snapshot?
You could restore it, or just delete it as most do. It depends how much you value the history data.
recorder data is just stuff from last 24 hours, no? (in which case, have no issue with losing it at all). So should I just delete home-assistant_v2.db and restart?
sure, I’ve been actively participating in that discussion… and am glad the now() function auto-updates as per HA 117 (or was it 116 already).
hence my surprise seeing the 2 posted templates, not auto-updating in the dev tools, (note: they do auto-update in the Lovelace frontend as expected).
{{((as_timestamp(now())-as_timestamp(states('sensor.uptime')))/60)|int}}
remains like this:
and doesnt do this: This template updates at the start of each minute.
I am running Hassio on a Synology NAS. I am unable to update because the latest version of Supervisor for Synology is not supported by the latest version of HA. So it looks like I’m going to be stuck on 0.118.4 forever or until they decide to upgrade the Supervisor version for Synology Docker.
That’s an issue you should take up with the guys that create the Synology version. It’s not a supported platform and therfore you won’t get any support here.
- @mLupine extended templated binary sensors and these now support templating the
delay_on
anddelay_off
!
Can you share with us an example ? I can’t make it work
The database will go back as far as you let it in the recorder settings. I have mine set for 30 days.
Yep, you can just delete the file and restart
Really, I can’t get any of my Apple TVs to show a pin I have checked all the settings and trouble shooting from pyatv site but still nothing
Never mind just took two hass restarts
Hi, thanks for upgrade.
Help! I am trying to create a blueprint automation but my automation are missing. When reboot HA get notification “invalid config”
The following integrations and platforms could not be set up:
- [automation]
- [default_config]
Please check your config and [logs].
I try to find solution, but nothing helps