Finetuning my Piper weather update in a local language

Using all kinds of different posts around this great community, I managed to assemble the following;

A Piper voice in Flemish dutch: Greetings according to the time of day, followed by the date, day and month and the current temperature outside and current weather conditions.
Then according to the current sun position it mentions in how much time the next sunset or sunrise will occur.

Again , I did not write or come up with this myself, I assembled various posts around this nice community and combined them. But… some of my results are just a little bit off and need some more tinkering:

  • in the weekdays, %set dag, the first day “zondag” (sunday) is never shown, it stays blanc.
  • when there is less than an hour to the next event (sunrise or sunset) how do I remove the “uur” (hour) text?
  • can I shorten the whole lot? my Raspberry Pi is working, and working (too?) hard to spit this out.
  - service: tts.speak
    target:
      entity_id: tts.piper
    data:
      cache: false
      media_player_entity_id: media_player.toilet
      message: >-
        {% set dag = ["zondag", "maandag", "dinsdag", "woensdag", "donderdag",
        "vrijdag", "zaterdag"] %} {% set maand = ["januari", "februari",
        "maart", "april", "mei", "juni", "juli", "augustus", "september",
        "oktober", "november", "december"] %} {% set weekdag =
        dag[now().isoweekday()] %} {% set maanden = maand[now().month - 1] %} {%
        set nl_weer = { 'clear-night': "een heldere nacht",
         'cloudy': "bewolkt",
         'exceptional': "extreem weer",
         'fog': "mistig",
         'hail': "het hagelt",
         'lightning': "het onweert",
         'lightning-rainy': "er is onweer en regen",
         'partlycloudy': "half bewolkt",
         'pouring': "het regent hard",
         'rainy': "het is regenachtig",
         'snowy': "het sneeuwt",
         'snowy-rainy': "er is regen of sneeuw",
         'sunny': "zonnig",
         'windy': "met wind",
         'windy-variant': "met windvlagen"
         } %}

         Goeden{% if now().hour < 5 %}nacht
         {% elif now().hour < 12 %}morgen
         {% elif now().hour < 17 %}middag
         {% else %}avond{% endif %}. Het is {{ weekdag }} {{ now().day }} {{ maanden }}. Buiten is het {{    state_attr('weather.home', 'temperature') | round(0)}} graden en {{nl_weer [states('weather.home')]}}.
         .
         {% set t = now() %}
         {% set next = [ state_attr('sun.sun', 'next_rising'), state_attr('sun.sun', 'next_setting') ] | map('as_datetime') | reject('none') | sort %}
         {% set next = next | reject('<', t) | list | first | default(t) %}
         {% if is_state('sun.sun', 'above_horizon') %}De zon gaat onder over {{ (next - t).seconds | timestamp_custom('%-I uur en %-M minuten.', False) }}
         {% else %}De zon komt op over {{ (next - t).seconds | timestamp_custom('%-I uur en %-M minuten.', False) }} {% endif %}
mode: single

Thanks already for any help or even the slightest input. I can translate more of the Dutch words in the above code when needed, please let me know.

Did I mistype, misread or misdo anything to get ignored? Please help me fix my mistake.
I’d like to be part of this great community, by sharing and learning.

Hi, I bumped on your question while searching for something similar.

What do you mean by the first day "zondag” (sunday) is never shown, it stays blanc?
Where should it be shown with tts?

Regarding your less than an hour question, I guess you have to break the hour and minutes apart and if the hour is 00, omit that part.
How to do that: I really don’t know since I have a similar question.

I don’t know if you can do much about making the whole thing shorter, it has the basics for what you want.
Are you using a RPi4?

Hi, thanks for your bump, we’ll tackle the hour thing eventually.

What do you mean by the first day "zondag” (sunday) is never shown, it stays blanc ?
Where should it be shown with tts?

Indeed the word Sunday was left out, not visible, so also not spoken by tts. Unfortunately I cannot reproduce this all the time and therefore it is difficult for me to pin point what to address.

Are you using a RPi4?

Yes, not the most powerful device out there, but it does suit my needs more than enough.

There you go: Notification current time w/ piper - #5 by pdwonline

I guess it makes sense that it neither showing or spoken as well.
Try this:

  message: >
    {% set dag = ["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag",
    "Zaterdag", "Zondag"] %} {% set maand = ["Januari", "Februari", "Maart",
    "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober",
    "November", "December"] %} {% set dag_van_de_week = dag[now().weekday()] %}
    {% set maand = maand[now().month - 1] %} 
    {{dag_van_de_week }} {{ now().day }} {{
    maand }}.

Of course a RPi4 can do most of the things.
OTH, it was anounced though that a RPi would not be the best suited for whisper.