I’m attempting to link a tuya based LED strip to openhab. Mirabella Genio branded with 1.06 firmware for wifi and MCU module.
I’ve just recently followed the instructions in HolgiHab’s excellent tuya-MQTT tutorial. Everything seems to be working, although the one part I’m unclear on is whether the script is actually running. I’m passable when it comes to this stuff, but by no means proficient.
I’ve got the virtual ID and local key pair from the item, made the channel in the right format but when I flick the switch I get… nothing. Forgetting any of the fancy colour changing stuff for now, it’s clear that there’s no communication at all.
I can take pictures if it helps, but any advice at this point is appreciated. I have zero idea where to go from here, or what is even likely to be an issue. I’m at a dead end. Thanks in advance!
Okay, you’ve followed some mystery tutorial, I’ll guess it might use MQTT, and made a mystery channel. If you made a channel, I’ll guess you probably made a thing too? If you’re using MQTT, you know about brokers - and have that working? One of the MQTT bindings installed - which one? If you’re trying to switch it, there is an Item involved maybe?
We’re going to need a bit more detail about these parts.
Sorry rossko57, looking back I agree that was a poorly formed post. I assumed a great deal of foreknowledge which was unfounded. I will do better.
Regardless, I would appreciate it if you could leave out the colourful snark. I realise you’re frustrated with random internet strangers asking befuddled questions, but it comes across as needlessly aggressive irrespective of intent. Again thanks in advance for taking the time to respond.
This is the tutorial I mentioned:
Tuya MQTT tutorial
I initially did post there, and perhaps it would have made more sense, but it felt like I was derailing the thread and subsequently removed it.
I have openhabian 2.4 installed on an RPi 3B+
I have the “misc-mqttbroker - 2.4.0” embedded MQTT broker installed and the “binding-mqtt - 2.4.0” MQTT binding. To the best of my knowledge the Thing I’ve made is online and fine, as reported by PaperUI.
Ignoring the colour channel/item pair for now. I’ve made a channel for the light, named headboard, and linked to a switch. I don’t think that warrants a picture. There’s a lot of extra detail in this part about getting the UUID/localkey pair of the light but I’m confident that’s fine.
Where I come unstuck is troubleshooting from here. Part of the process involves this project:
TheAgentK’s tuya-mqtt bridge
I’m inclined to think that my problem lies here, with my MQTT messages going through but never being translated properly. I just don’t understand the inner workings here; I find it difficult to grasp the programming side of things.
I do appreciate the difficulty in diagnosing and offering solutions in this environment, so apologies again. If I’ve omitted anything or there is something that needs clarifying let me know, I find it difficult to backtrack and break down processes without feeling like I’ve over explained the details to death.
Okeydoke. so follow the trail.
Assuming this means a switch in openHAB UI ?
events.log, looking for a command to your Item and any subsequent events.
openhab.log looking for error reports at this time.
Have you any other MQTT devices, do we know your broker connection works? It sounds like not yet.
Next step would be to eavesdrop on MQTT messages, I think many people use a tool MQTT.fx
Mmm, yes. The switch item in paperui that is linked to the mqtt channel. I meant expand that in the picture, sorry.
I toggle it in the control tab of PaperUI and nothing happens. The log reports the switch item activation and nothing else.
I’m not home at the moment so can’t easily check the openhab.log
No other MQTT items to test with unfortunately, leading to my loss of what to do now. As I mentioned, I don’t quite know the internal workings enough to carry out a proper investigation.
That is my feeling though, either the broker or the script that does the translation.
MQTT.fx I will go check it out when I’m awake tomorrow.
Thank you rossko, I think this will get me well along the way to sorting my problem.
Made excellent progress with your advice rossko. I can tell now that the broker is installed and functioning; testing with a program on another PC shows I can connect to the broker and both send and receive messages over the network.
This leads me to conclude that either the LED strip firmware isn’t compatible or the tuya-mqtt.js is not doing anything.
I have a script to run tuya-mqtt.js as a service (which I borrowed from the previously linked tutorial) so I’m inclined to think that’s running ok. Systemctl shows it as running at least. Regardless, I have tested by manually running tuya-mqtt.js
At this point I’m inclined to call it a lost cause as werestepping further outside my area of expertise.
Thank you again for your help rossko, if you have any other suggestions they are welcome.
Well, again we’re a bit short on info. People sometimes have trouble with MQTT topics - should they include that last slash or not? etc. Yours are still a mystery to us, but obviously worth a close look.
It’s of note that the tuya tutorial posting uses MQTT binding version 1. You are using things and channels, MQTT binding version 2. Confident you have the appropriate settings? Item linking is different.
Ahhh, that makes my head hurt a little. Before you had mentioned the possibility of version specific syntax I would, and believe I may, have said that yes, I am confident. Now the seeds of self doubt are sown.
I did try a preceding slash, so what you say about the exactness required of (and uncertainty surrounding) the channels resonates.
Towards the end of the tutorial there is a small update that applies to 2.4 using the embedded broker and binding.
From memory I used:
I can post screenshots when home. Thank you for continuing to offer assistance.
I had forgotten that I used my phone to collect the uuid and key. This is what they look like.
Not sure if you’re still monitoring this rossko, but it turns out there was some version issues with the script not supporting devices running on 3.3 protocol.
It… sort of works now. I can turn the device off once before I get a mess of errors in the script.
I’ll only get prompted if you reply to me or mention me with @ like @rossko57
Doesn’t stop other people chiming in, of course.
Meantime, there’s not much to say about “a mess of errors”. Help others to help you.
Didn’t mean to imply I needed help with that mess, sorry. Just a random thought that came out.
Edit: it works, but sometimes appears to lose synchronization and starts spouting “bad command” via paperui and “unhandled errors” in the script.
@daunte, were you ever able to solve your issue? I have a tuya LED strip as well. I flashed with Tasmota firmware and can get it to turn on, off, and dim without issue via MQTT testing app on my phone. I can’t figure out color though and haven’t started hooking it into my smarthome server. In any case, the Tasmota firmware may help you quite a bit.
Here’s some info on the TuyaMCU devices: https://tasmota.github.io/docs/#/TuyaMCU
I flashed Tasmota on mine using this method: https://github.com/arendst/Tasmota/wiki/Tuya-OTA
Hope this helps.
Thanks for posting an update! I did eventually return to this project after an update was posted to the tuya-mqtt script.
My particular issue ended up being a newer, at the time unsupported, firmware. Even less amusingly I had promised the lights to a friend for his under desk lighting.
Apologies if I never marked the thread as solved, I will attend that when I get the chance at home. I can also check how I set up the color wheel for you.