enkama / hass-variables

Home Assistant variables component
92 stars 12 forks source link

TZOffset Default in datetime sensor #135

Open jack3308 opened 1 month ago

jack3308 commented 1 month ago

Issue

Sort of two issues in one here I think:

  1. The tz offset field is prefilled with '+0000' in the change values + attributes page regardless of the TZ the sensor was setup with. This makes switching between local times and '+0000'/utc times necessary when testing/manually updating the sensor.
  2. When the TZ offset field is emptied and left blank, the timezone defaults to '+0000'/utc regardless of what the sensor was setup with or what the last value used was.

Expected Result

  1. The timezone used to setup the datetime sensor should persist and be the "default" time zone for that entity
  2. When the TZ offset field is empty it defaults to the HA Timezone instead of '+0000'/UTC
Snuffy2 commented 1 month ago

So, behind the scenes, any time entered is converted to UTC. The actual timezone the time was entered in is not stored.