well your error points to it missing in configuration.yaml
Found it:
It was added in December 2018 in version 0.84. Itâs mentioned in the release notes but to say ânot prominentlyâ would be an understatement.
In fact, itâs not linked to the initial PR but to a follow-up PR that fixes it.
FWIW I was a novice back then and this filterâs stealthy introduction would have definitely flown undetected past my radar.
Hmm corrected but still got the error:
Error loading /config/configuration.yaml: while parsing a block mapping
in â/config/configuration.yamlâ, line 671, column 5
expected , but found â,â
in â/config/configuration.yamlâ, line 672, column 40
IIRC itâs the only function/filter/test thatâs not included in the docs.
replace ", "
with ,
Geeze I was chasing a browser-error gost. That error keeped popping up nomatther what I did, needed a big browser refresh. Dunno why. So the final code iâm using is below. Works in template editor, only thing in practical the state is âunknownââŚwait tell me it will only fill in the states tonight at 00:00 right? In the previous âoldâ example it worked right awayâŚ
template:
- trigger:
- platform: time
at: "00:00"
sensor:
- name: Dag
state: "{{ now().strftime('%a') }}"
- name: Maand
state: "{{ now().strftime('%b') }}"
- name: Datum
state: "{{ now().day }}"
- name: Dag-datum
state: "{{ now().strftime('%a') }}, {{ now().day | ordinal }}"
- name: Datum-1
state: "{{ (now() - timedelta(days=1)).strftime('%a') }}, {{ (now() - timedelta(days=1)).day | ordinal }}"
- name: Datum-2
state: "{{ (now() - timedelta(days=2)).strftime('%a') }}, {{ (now() - timedelta(days=2)).day | ordinal }}"
- name: Datum-3
state: "{{ (now() - timedelta(days=3)).strftime('%a') }}, {{ (now() - timedelta(days=3)).day | ordinal }}"
- name: Datum-4
state: "{{ (now() - timedelta(days=4)).strftime('%a') }}, {{ (now() - timedelta(days=4)).day | ordinal }}"
- name: Datum-5
state: "{{ (now() - timedelta(days=5)).strftime('%a') }}, {{ (now() - timedelta(days=5)).day | ordinal }}"
- name: Datum-6
state: "{{ (now() - timedelta(days=6)).strftime('%a') }}, {{ (now() - timedelta(days=6)).day | ordinal }}"
- name: Datum-7
state: "{{ (now() - timedelta(days=7)).strftime('%a') }}, {{ (now() - timedelta(days=7)).day | ordinal }}"
- name: Datum-8
state: "{{ (now() - timedelta(days=8)).strftime('%a') }}, {{ (now() - timedelta(days=8)).day | ordinal }}"
- name: Datum-9
state: "{{ (now() - timedelta(days=9)).strftime('%a') }}, {{ (now() - timedelta(days=9)).day | ordinal }}"
- name: Datum-10
state: "{{ (now() - timedelta(days=10)).strftime('%a') }}, {{ (now() - timedelta(days=10)).day | ordinal }}"
- name: Datum-11
state: "{{ (now() - timedelta(days=11)).strftime('%a') }}, {{ (now() - timedelta(days=11)).day | ordinal }}"
- name: Datum-12
state: "{{ (now() - timedelta(days=12)).strftime('%a') }}, {{ (now() - timedelta(days=12)).day | ordinal }}"
- name: Datum-13
state: "{{ (now() - timedelta(days=13)).strftime('%a') }}, {{ (now() - timedelta(days=13)).day | ordinal }}"
- name: Datum-14
state: "{{ (now() - timedelta(days=14)).strftime('%a') }}, {{ (now() - timedelta(days=14)).day | ordinal }}"
Yes, it will only calculate at midnight. Remove the trigger to have it calculate every minute. If you remove the trigger, make sure you put a - in front of the sensor line.
Good afternoon, my apologies Iâm new to home assistant and would love to implement your exact code. This is exactly what Iâm looking for. Would you mint guiding me through the steps to implement this please?
please always use preformatted text
when pasting code, so the quotes donât get all screwed up (also tabs are preserved).
Itâs a PITA to copy the code and replace them all manually