Glad it works now! I was just wondering why your @tuyapi is installed in /usr/lib/node_modules/@tuyapi
No idea, I just followed the instructions.
// switch to opt directory
cd /opt
// clone this project
sudo git clone GitHub - TheAgentK/tuya-mqtt: Nodejs-Script to combine tuyaapi and openhab via mqtt
// change directory to the project directory
cd tuya-mqtt
//installs this project along with codetheweb/tuyapi project
sudo npm install
cp config.json.sample config.json
sudo nano config.json
// This should be all that is required for the tuya-MQTT software.
//==================================================================
// For the wizard software, perform the following
sudo npm i @tuyapi/cli -g
sudo tuya-cli wizard
// If your having issues, with the above, use the below.
sudo DEBUG=* tuya-cli wizard
sudo nano devices.conf
sudo node tuya-mqtt.js
Whilst Iâm in this area, I will make a contribution:
The Wizard generated the following:
For the Thing/Channel configuration of my new Tuya SmartPlug, I needed to setup the device like this:
Note the different MQTT structure.
The YAML code looks like this.
UID: mqtt:topic:genio_adaptor
label: Genio Adaptor
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:f44b9520f1
channels:
- id: relay
channelTypeUID: mqtt:switch
label: Relay
description: ââ
configuration:
commandTopic: tuya/genio_adaptor/dps/1/command
stateTopic: tuya/genio_adaptor/dps/1/state
off: âfalseâ
on: âtrueâ
I do have the problem in that OH does nothing when I turn the Switch Off via OH3. Turn the Switch On via OH3 and there are tail logs and MQTT commands and the actual switch turns On.
Off. Nuthin. Itâs like I havenât touch the screen at all ???
Ideas on this one?
JFYI - I got warnings when installing because I had NodeJS version 10.21.0 but it seems to be working. I also had to âsudoâ the install for permission reasons (I know - naughty).
hello,
is there a way to discover dps topics?
i have a tuya pet wifi feeder, and if i send a manuel feeding with the app its: tuya/harvey_feeder/dps/105/state âNumber of partsâ but if i want to send a command to it its not 105 but tuya/harvey_feeder/dps/101/command , please dont ask me how i get the 101 because its was just guessing and little luck,
so is there a way to discover the dps commands?
So if I understood correctly, you want a list of all possible dps topics right?
Unfortunately, I donât know any other way than using a tool like âMQTT Explorerâ to reverse engineer the topicsâŠ
Maybe @tsightler knows a better way?
Yes thatâs what i mean.
Because:
dps 105 is state
dps 101 is commando
But 101 never exposes itself so i was Just tyring Them all
So what I would do is to monitor the MQTT-Explorer output while controlling the pet feeder (I guess normally via a mobile app?). Then you should see all dps topics used and it should give a picture how the device gets controlledâŠ
Yes like i said in my first post,
If start mqtt Explorer and send a commando with the app then dps 105 changes and i see the value, but i cant send a commando to it because its a Read only. If i send a commando to dps 101 then Will the device receive the command and 105 changes to the new value, but how expose the command channels? Because i had to gues.
Ah ok, now I got it! So what you can try:
- Login to https://iot.tuya.com
- On the left pane click on âProductâ
- Click âCreateâ
- Choose your product (on top right there is a search bar)
- Enter a âProduct Nameâ (this can be any name you want) and select
- Click on âCreate Productâ
- Now you should see a window âCreate Standard Functionsâ - click on âAllâ and then âConfirmâ
Then you should see the DP IDâs and the descriptionâŠ
I hope that helps!
Hi, thanks for think about this,
I did this yesterday but the dps idâs are around 1 TM 20 and the device at home is around 100, i wil make a gif when i am at home
You can capture the traffic between the app and your tuya device and then use tuyadump to decode it:
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.