i have spent many days getting this to work on windows 10.
to get TheAgentK/tuya-mqtt installed I had to install python 3 for windows. i followed this:
install node.js (use the LTS version) from:
i installed gitHub Desktop for windows 10, from this URL:
use gitHub Desktop: (file-> clone repository…choose URL…enter in TheAgentK/tuya-mqtt…and select c:\openhab2\userdata\etc\scripts directory). Now you have the repository in the right place. open powershell with admin and type “npm install -g” at the tuya-mqtt directory
clone the repository “codetheweb/tuyapi”, and place it in c:\openhab2\userdata\etc\scripts. in powershell change dir to tuyapi and type “npm install -g” then I think I changed directories back to tuya-mqtt and did “npm install” command again
the install must not produced errors…once you get it installed the tuya-mqtt.js file needs to be installed as a service
so i found this topic:
and installed node-windows and qckwinsvc by:
open powershell with admin type “npm install -g qckwinsvc” then after install ran qckwinsvc in cmd.exe with admin and answered the questions. the tuya-mqtt is now installed as a service and is running when you log off or the system reboots
tuya-mqtt is the client at 127.0.0.1 and will now be listening on your openhab server running on windows 10.
Now follow THE ABOVE GUIDE right after the tuya-mqtt.js script is running. Find all your Tuya-Devices IP address, DeviceID and LocalKeys. I install Bluestacks and followed his steps and found them all.
To interface with openhab2 follow the instructions for “Update for MQTT-Binding 2.4”
I have both lights and plugs so for the use “lightbulb” for the lights and for smart plugs use “socket”. Also make sure you do the copy of the “config.json.sample” to “config.json”. Because the “config.json” needs to be there. I did not edit mine. I just used 127.0.0.1 which is the default.
i hope this helps.