acon96 / home-llm

A Home Assistant integration & Model to control your smart home using a Local LLM
483 stars 56 forks source link

Wrong time zone in system prompt? #129

Closed HenryKleinschmidt closed 2 months ago

HenryKleinschmidt commented 2 months ago

I think I'm getting the wrong time zone with this: {{ (as_timestamp(now()) | timestamp_custom("%I:%M %p on %A %B %d, %Y", "")) }} Can someone tell me how to fix this?

I've added this to a title card to visualize it.

Screenshot 2024-04-26 at 12 00 17 PM
fhteagle commented 2 months ago

If it's templating out that way it's probably an issue with your HA config. What's your Settings > System > General time zone set to?

Screenshot_20240426-081842_Home Assistant

If using docker, what's the docker container TZ environment variable set to?

HenryKleinschmidt commented 2 months ago

Hi thanks for your response. My HA config has the correct time zone set. I'm using Home Assistant OS as a VM and the date/time there is correct as well.

fhteagle commented 2 months ago

Try to set the timezone in the last "" , it spits out UTC without something there....

Example {{ (as_timestamp(now()) | timestamp_custom("%H:%M %p on %A %B %d %z, %Y", "")) }}

gives 14:26 on Friday April 26 +0000, 2024

{{ (as_timestamp(now()) | timestamp_custom("%H:%M %p on %A %B %d %z, %Y", "MDT")) }}

gives 08:26 on Friday April 26 -0600, 2024

HenryKleinschmidt commented 2 months ago

Yes that's it! Thank you.