Skip to content
프로젝트

FlagX/ha-ledvance-tuya-resync-localkey

GitHub에서 보기

소개

pyscript for homeassistant to resync local keys from private tuya api

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

ha-ledvance-tuya-resync-localkey

pyscript for homeassistant to resync local keys from private tuya API.

This also works for Sylvania devices by changing/uncommenting the keys in pyscript_modules/tuya/const.py.

This repository includes

To just print out your local keys...

First, create a Python 3 environment - version 3.10 is confirmed as working.

Then install the dependencies and run the script:

pip install -r requirements.txt
python print-local-keys.py

If you want to run the script non-interactively, set the environment variables LEDVANCE_USERNAME and LEDVANCE_PASSWORD to your Ledvance account credentials.

How to resync local keys automatically (via service)

If you have many devices and reset them sometimes by accident, like me, you can create a service for resyncing the local keys. (New local keys are generated if you reset/re-register your devices).

Prerequisites

  • Pyscript Integration
  • Set allow_all_imports and hass_is_global to true. (Described here)
  • Ledvance account with devices configured

Setup

  • Replace placeholders in pyscript\sync_tuya_keys.py with your Ledvance account credentials.
  • Copy pyscript_modules and pyscript to your Home Assistant config directory.
  • In your Home Assistant dashboard should now be under Developer tools --> Services a service called Pyscript Python scripting: synctuyakeys that you can call. (You may have to restart before)
  • (If you want Log output, you need to change the log level to INFO or use jupyter)

Credits

Credits for the python Tuya API client go to: https://github.com/rgsilva/homeassistant-positivo I also extracted the keys/secrets by following his guide: https://blog.rgsilva.com/reverse-engineering-positivos-smart-home-app/

관련 프로젝트 살펴보기

불러오는 중…