I am a proud user of home assistant and all my modules work offline. I got a new cheap Tuya controlled smart light bulb which unfortunately can’t be flashed with tasmota (I did this with others before but they patched it) using https://github.com/ct-Open-Source/tuya-convert.
Since I refuse to call the cloud to turn on a light, I decided to create a custom component based on https://github.com/clach04/python-tuya. Unfortunately my light is using a brand new protocol version 3.3 that broke python-tuya, so I found this: https://github.com/codetheweb/tuyapi
Kudos to the team that managed to reverse engineer 3.3. Since I expect this to be temporary, I did a quick and dirty nodejs script that I can run in HA to control the light. You just need to extract the local key / id of your device using some sort of SSL proxy such as charles and your phone.
Dockerfile to embed it into the raspi image: https://gist.github.com/rdelcorro/f1ddae46d25842b83bc8d5b0f97ecabd (not needed if you don’t use docker)
switch porch local: platform: command_line switches: porch_local: command_on: "/usr/bin/node /tuyaporch/tuyaporch.js on" command_off: "/usr/bin/node /tuyaporch/tuyaporch.js off" command_state: "/usr/bin/node /tuyaporch/tuyaporch.js status" friendly_name: Porch light tuya local