Hardware: I’m using an old laptop that I formatted and installed ubuntu server on to. intel Core i5 -5200U/ 4gb ram/ 1tb hard drive
OS: Ubuntu Server 20.04.4
Java Runtime Environment: I have installed java I just have no clue which version
openHAB version: openhab 3
Issue of the topic: Connecting Tuya Power plugs to Openhab
Hi all,
So quickly on to the next question. I recently bought myself some tuya smart plugs without realizeing how difficult it would be to connect them to Openhab.
Everything seem to be going fine till I came to step 5.
Next you have to define your MQTT-channels - I simply did that via PaperUI. Use a “Generic MQTT Thing” (for example “MQTT Tuya”) and add your channels here according to your devices.conf:
I also had some permission issues (ESSA Error) with step 4 but got that sorted out and was able to install the node and run the package.
node tuya-mqtt.js
Nothing specific happened the cursor would just got to the next line and stay there.
I went to the Openhab MQTT bindings and tried to scan and install them. One came up and is online (but has no channels) the other says error in communication.
I’m not sure what to do or how to setup this up properly. Any help on would be great. And I can share any code or screen shots required just let me know.
Hang on, you don’t need the system broker - you can delete it… On the other mqtt-thing on top you have the tab “Channels” - here you can define your MQTT topics:
I tried several approaches to integrate my Tuya smarthome devices. I flashed a few to Tasmota and eventually got them working with MQTT, but most devices are not flashable over the air, so I tried setting up the Alexa SmartLife skill and using the amazonechocontrol. That worked pretty well, but then I found the smarthome/j Tuya binding, which has worked well for me and isn’t dependent on having the Internet connection or Amazon Alexa connected and working. You can learn more here: addons/bundles/org.smarthomej.binding.tuya at 3.2.x · smarthomej/addons · GitHub
It’s the same principle like tuya-mqtt - you only need a initial internet connection to get the device-id’s and the key. Then you can control them via LAN. But if this Binding is available for OH and tuya-mqtt is currently not maintained anymore, it might be the better solution!
I already have the device IDs and their keys. so that’s one hurdle down I’ll try adding the channels… If i’m so close to the MQTT installation I’m going to try and finish that but if I keep hitting a road block I’ll google a tutorial on how to add bindings to OH via github and i’ll try the smarthome/J binding. Any specific tutorials on how to add bindings would be greatly appreciated.
the devices.conf file was empty and actaully wasn’t there I had to created it and populate it with the details I got from the Tuya development platform (the device ID and key) I haven’t added any other details than that
So tuya-mqtt isn‘t sending any data to the broker. Try to remove the colon at the end of your devices.conf and make sure node tuya-mqtt.js is running - then you should see it in MQTT explorer
When using local tuya control, whether it’s tuya-mqtt or the smarthome/j binding, only one thing can be active. If you have your app open on your phone, close it. Don’t run both tuya-mqtt and the smarthome/j tuya binding at the same time.
There are no colons at the end of code. I’ve copied and pasted all the code I’ve added to the device.conf file bellow. This is all there is in the file.
Sorry if this is a little away from smart plug but it is on topic with using the J Tuya binding.
Hi All,
I have managed to get Tuya device control of a smart Colour LED GU10 from OH3 using the GitHub - smarthomej/addons: SmartHome/J addons for openHAB however, I can’t seem to control/select Scenes from OH. If I select scenes with the Smart Life App I can see the string of “Scene Data” changing to match what is selected (For example 06464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000) but I can’t then apply that string to directly recall it on the device from OH. Is this a limitation/not possible or just me?