FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for setting the timezone · Issue #436 · python-kasa/python-kasa · GitHub

Repository navigation

Add support for setting the timezone #436

Closed

Description

I recently acquired a set of KP115(AU) units to setup for power monitoring, and have them integrated into my Home Assistant Setup. Used python-kasa to pair them to the network on a separate device. Devices were automatically set to a timezone value of 6, corresponding to US Pacific Time which is outside of my location.

As Home Assistant is polling data from the Units to be logged, and the charts are reporting around 19 hours of Zero data.
The data begins to be captured when the Device clock is on Midnight, and the dates match between the Devices, and the Server.


The current way to adjust the Timezone of the Kasa Devices is to use the official TP-Link app. At present, the python application can only fetch the Timezone data, as stated in the following Terminal Output

$ kasa time | grep Time: && date
	Time:         2023-02-21 21:50:56 (tz: {'index': 6, 'err_code': 0}
	Time:         2023-02-21 21:50:56 (tz: {'index': 6, 'err_code': 0}
	Time:         2023-02-21 21:50:55 (tz: {'index': 6, 'err_code': 0}
Wed 22 Feb 2023 16:50:59 AEDT

Can it be possible to adjust and save Timezone configuration changes to the Kasa devices using the API?

Activity

  1. rytilahti commented on Feb 22, 2023

    Member

    This is not currently implemented, but PRs to add it to the time module (https://github.com/python-kasa/python-kasa/blob/master/kasa/modules/time.py) are welcome.

    For the time being, you could use a raw command. The link below mentions that it's necessary to provide current time information but you could start testing with something like this:

    kasa raw-command time set_timezone '{"index": 1}'
    

    See https://github.com/GadgetReactor/pyHS100/pull/55/files for the command and GadgetReactor/pyHS100#53 (comment) for a list of index-tz mapping.

  2. changed the title [-][Feature Request] Setting Timezones[/-] [+]Add support for setting the timezone[/+] on Feb 22, 2023
  3. Jimmyson commented on Feb 26, 2023

    Author

    This is not currently implemented, but PRs to add it to the time module (https://github.com/python-kasa/python-kasa/blob/master/kasa/modules/time.py) are welcome.

    For the time being, you could use a raw command. The link below mentions that it's necessary to provide current time information but you could start testing with something like this:

    kasa raw-command time set_timezone '{"index": 1}'
    

    See https://github.com/GadgetReactor/pyHS100/pull/55/files for the command and GadgetReactor/pyHS100#53 (comment) for a list of index-tz mapping.

    Thanks for the information!!
    The raw-command helped. Since I have a couple of devices on the network, I had to individually run the command for each device, but the time is now for updated.

  4. github-actions commented on Sep 28, 2024

    There hasn't been any activity on this issue recently. This issue has been automatically marked as stale because of that. It will be closed if no further activity occurs.
    Please make sure to update to the latest python-kasa version and check if that solves the issue.
    Thank you for your contributions.

  5. rytilahti commented on Oct 6, 2024

    Member

    Reopened as #1147 aims to add support for this.

  6. added a commit that references this issue on Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL