Giter VIP home page Giter VIP logo

Comments (6)

RobertD502 avatar RobertD502 commented on June 28, 2024

Can you please run the command cat /etc/timezone. This will provide the timezone that Home Assistant OS has defined. You'll need to be within the Home Assistant OS shell terminal when running the command. The env command you ran returns what the TZ variable is set to within the docker container that resides inside of the OS.

Edit: Also, run the cat /etc/timezone command within the Home Assistant container - this will let us know if the time zone in the /etc/timezone file (within the docker container) conflicts with the TZ environment variable that is defined for the HA docker container within Home Assistant OS. Disregard: The Home Assistant container within Home Assistant OS doesn't use /etc/timezone.

Edit 2: Add tzlocal: debug to logger in your configuration.yaml file, save it, then restart Home Assistant. After Home Assistant restarts, look at your full Home Assistant logs to see what/if any debug logging is returned by the tzlocal library which this integration uses to get your system's timezone name.

Edit 3: To see if the tzlocal library is able to find the TZ env variable - In the terminal (as seen in your screenshot), run the command python -c "import os; print(os.environ.get(\"TZ\"))". This is the command that the tzlocal library is using under the hood to determine the timezone name.

from home-assistant-petkit.

cybersea54 avatar cybersea54 commented on June 28, 2024

Here is output from Home Assistant OS, it seems time zone didn't set:
изображение
There is full logs:

2023-09-22 13:11:09.575 DEBUG (MainThread) [tzlocal] Found a TZ environment: Asia/Ho_Chi_Minh
2023-09-22 13:11:09.575 DEBUG (MainThread) [tzlocal] TZ does not contain a time zone name
2023-09-22 13:11:10.849 ERROR (MainThread) [custom_components.petkit] A timezone could not be found. If you are running Home Assistant as a standalone Docker container, you must define the TZ environmental variable.

There is python output:
изображение

from home-assistant-petkit.

RobertD502 avatar RobertD502 commented on June 28, 2024

Home Assistant OS does have a timezone set (Etc/UTC), so there is no issue there.

This seems to be a bug with the tzlocal library. Based on their code, the reason it is failing is because Asia/Ho_Chi_Minh is missing from their list. So, this isn't anything wrong on your end, rather, a missing timezone in their code.

from home-assistant-petkit.

RobertD502 avatar RobertD502 commented on June 28, 2024

I raised an issue with the maintainer of the library, but until that is fixed on their end and a new version of tzlocal is pushed out, the Asia/Ho_Chi_Minh timezone won't work. I do see that the Asia/Bangkok timezone has the same offset as Asia/Ho_Chi_Minh - In the meantime, if you set your timezone to Bangkok via the Home Assistant GUI, you should be able to use this integration.

from home-assistant-petkit.

RobertD502 avatar RobertD502 commented on June 28, 2024

Disregard the comment above. I am working on implementing a Timezone option in the configuration flow where you'll be able to select Asia/Ho_Chi_Minh as an option - this way you won't have to change your timezone in Home Assistant and we don't have to wait on the tzlocal library maintainer to update his code.

from home-assistant-petkit.

RobertD502 avatar RobertD502 commented on June 28, 2024

@cybersea54 Upgrade to version 0.1.10 and select Asia/Ho_Chi_Minh as your timezone during the integration setup.

from home-assistant-petkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.