Template sensors only updating on reboot

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?

Your templates need an entity to trigger off. You could add an entity: statement to each and I think use sensor.time which updates once a minute as a trigger. Sensor.time also needs to be added if you don’t already have it installed.

When I just add an “entity” to my template like this, I get “Property entity is not allowed.”

      monthdatetime:
        entity: sensor.time
        friendly_name: "Month, Date & Time"
        value_template: "{{ now().strftime('%b %d - %H:%m') }}"

I assume I need to add it somewhere in the “value_template” portion, but I’m unfortunately lost there. Tips?

Because your template doesn’t contain an identifiable entity.

now() is a function, not an entity. It gets evaluated at startup and then never again (until the next restart).

Templates without entities using now

There’s no such option as entity. What you need to use is entity_id.