TL;DR - I created a template sensor, but it only updates on reboot
I didn’t like how big and chunky the date and time entity cards were when using the basic time_date platform:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'date_time_utc'
- 'date_time_iso'
- 'time_date'
- 'time_utc'
- 'beat'
So, I tried using templates to make my own custom sensors:
nextsunrise:
friendly_name: 'Next Sunrise'
value_template: "{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom('%D %-I:%M %P') }}"
nextsunset:
friendly_name: 'Next Sunset'
value_template: "{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom('%D %-I:%M %P') }}"
dayofyear:
friendly_name: 'Day Number'
value_template: "{{ now().strftime('%j') }}"
weekofyear:
friendly_name: 'Week Number'
value_template: "{{ now().strftime('%U') }}"
shortmonth:
friendly_name: 'Month (short)'
value_template: "{{ now().strftime('%b') }}"
monthdate:
friendly_name: 'Month & Date'
value_template: "{{ now().strftime('%b %d') }}"
monthdatetime:
friendly_name: "Month, Date & Time"
value_template: "{{ now().strftime('%b %d - %H:%m') }}"
In particular, I’m using my sensor “monthdatetime” as a card on my interface, but it only updates when I reboot the server. Do I need to do something different in the template? Or is it as simple as setting up something in NodeRed to trigger an update each minute?
Alternatively, am I making this WAY too complicated, and should I be going down another road?