How do I change Home Assistant Voice PE to 24-hour clock?

How do I change the Nabu Casa Home Assistant Voice PE to use 24-hour time?

It currently responds to “What time is it” in AM/PM time notation.

I can’t find any related localization settings anywhere in Home Assistant. My Home Assistant app and web interface displays all times in 24-hour notation, though.

1 Like

I have the same problem. I have the web interface in 24 hour time (“military time” in the US), but Voice responds with 12 hour time.

I think the root issue is the Home Assistant assistant pipeline always uses 12 hour time in the US, despite what is set in your profile. I am not sure how to change that, but am hoping someone else does.

Turns out I was thinking about it wrong. Voice assistant conversations use intents and responses, which can be customized!

We need to override the default response to the HassGetCurrentTime intent.
Create a file /config/custom_sentences/en/HassGetCurrentTime.yaml (exact file name doesn’t matter, but the path is critical):

language: en
responses:
  intents:
    HassGetCurrentTime:
      default: >
        {% set hour_str = '{0:02d}'.format(slots.time.hour) %}
        {% set minute_str = '{0:02d}'.format(slots.time.minute) %}
        {{ hour_str }}:{{ minute_str }}

Now go to Developer Tools (the hammer icon near the settings on the left nav bar).
Under the YAML tab, find the YAML configuration reloading section.
Click CONVERSATION to reload the conversation intents/responses.

Your voice assistant should now respond with 24 hour / military time!
Depending on your TTS engine and voice, it might not pronounce 06:30 as “zero six thirty”. Mine says “six thirty” out loud, but in the text conversation it shows 06:30 as expected.