GithubHelp home page GithubHelp logo

ederjc / ha-ledvance-tuya-resync-localkey Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flagx/ha-ledvance-tuya-resync-localkey

0.0 0.0 0.0 22 KB

pyscript for homeassistant to resync local keys from private tuya api

License: MIT License

Python 100.00%

ha-ledvance-tuya-resync-localkey's Introduction

ha-ledvance-tuya-resync-localkey

pyscript for homeassistant to resync local keys from private tuya api

This repository includes

To just print out your local keys...

Install the dependency and run the script (python 3):

pip install pycryptodome
python print-local-keys.py

On Windows you may have to install the requests module before:

pip install requests

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 be now 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/

ha-ledvance-tuya-resync-localkey's People

Contributors

flagx avatar salamandar avatar

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.