百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

ha-ledvance-tuya-resync-localkey

> 编程语言
开源

用于 homeassistant 的 pyscript,用于从私有 Tuya API 中重新同步本地密钥

198 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 homeassistant 的 pyscript,用于从私有 Tuya API 中重新同步本地密钥

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

  • A script print-local-keys.py to print out local keys for your Ledvance devices (They must be already registered in the Ledvance app), which can be used in the LocalTuya integration for Home Assistant
  • Setup via Pyscript Integration to automatically resync local keys

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:

bash
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/

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonhome-assistanthomeassistantiotledvance

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言