Problems with Sun.Sun since moving to hass.io

I just moved my installation to hass.io (rpi3) from hassbian and all seems to be fine except for one of my template sensors. This has worked previously with no issues, but doesn’t seem to be displaying data any longer. Here is the configuration along with the source component and the outputs.

Any ideas? THANKS!

- platform: template
  sensors:
    sunrise:
      friendly_name: 'Sunrise'
      value_template: "{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom('%-I:%M %P') }}"
      icon_template: mdi:weather-sunset-up
    sunset:
      friendly_name: 'Sunset'
      value_template: "{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom('%-I:%M %P') }}"
      icon_template: mdi:weather-sunset-down


This is what I use for a non hass.io setup, so it may not make any difference…

- platform: template
  sensors:
    nextsunrise:
      friendly_name: 'Next Sunrise'
      value_template: '{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom("%D %I:%M %P") }}'
      
- platform: template
  sensors:
    nextsunset:
      friendly_name: 'Next Sunset'
      value_template: '{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom("%D %I:%M %P") }}'

I can confirm this. Pasting your template in the templates tool on normal hass in venv on ubuntu 16.04 works, on hass.io shows nothing.
If you use some other format string like ‘%H:%M’, it works.

That is so strange. Without the format, it’s blank. With the current format, it’s blank. With just the %H%M, all works great. Adding a %P to that also breaks it - as does leaving off the %P and replacing the hours with a %-I or %I.

Awesome catch. Thanks for the assist!