-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TuyaMCU actions no commands when MQTT Broker is connected #20608
Comments
I'm not sure to follow In the 1st log block where you say "MQTT connect => Not working, I can clearly see:
That I can translate by
And right after the same dialog with value 0 for OFF So it looks like it is working as expected The 2nd block of logs with MQTT not connected doesn't show a valid exchange on dpId 101 |
Hey, sorry, maybe the second logs with MQTT not configured were not complete. Here again with MQTT not configured and device turning On/Off correctly:
The MCU responds correctly, but the device does not. When MQTT is configured I can Send/Receive commands and status from the MCU, but the device itself does nothing at all. As soon as I unconfigure MQTT the device works fine when toggeling both Relays. Thanks! |
Hey @JustH4ppy After a thorough analysis, I would claim that the standard Tuya Wifi Serial Protocol is not implemented in your Tuya MCU. It could be the Wifi for Low Power Protocol or a Bluetooth Serial Protocol (which would, of course, not be compatible with the TYWE1S). As I interpret it, Tasmota supports the standard Wifi Serial Protocol (@barbudor, would you agree with me on this?) The following observations led me to this assumption:
Tasmota reports the Network State in several stages. When Wifi is activated, Tasmota sends Network State 3 (0x02 = The Wi-Fi network is set up, but the device is not connected to the router).
When Tasmota is connected to Wifi, it sends an incremented Network State 4 (0x03 = The Wi-Fi network is set up, and the device is connected to the router).
The next stage would be a connection with MQTT. Then Tasmota would send Network State 5 (0x04 = The device is connected to the cloud). I would have liked to see this in your first LOG (with MQTT enabled). Regardless of which Network State Tasmota sends, your TuyaMCU always responds with 55 AA 00 03 00 00 02. In the normal Wifi Serial Protocol, this response does not exist. It is invalid! However, assuming that your Tuya MCU responds to the Wifi Low Power Protocol, it would repeatedly signal the Wifi Reset command in its response. Check here: https://developer.tuya.com/en/docs/iot/wifie1smodulemcu?id=K9hhi0xp301u1 |
Hey @benjaminnestler, thank you very much for your deep research! Meanwhile I quickly want to post my workaround, how I currently managed to get the device controlled by Home Assistant without MQTT. Maybe it's useful for somebody dealing with the same.
|
Great analysis @benjaminnestler Actually I always refer to the "Tuya Wifi Serial Protocol" documentation and I even didn't noticed that "Wifi for Low Power Protocol" At least we see possibility for improvements as it should be possible to indentify which of those 2 protocols the MCU is using and adapt the dialog accordingly. |
Hey @barbudor, I don't know if this is helpful, but I would like to provide any help remotely needed if this somehow helps. |
Hi @JustH4ppy,
Currently, there is no SetOption or similar functionality to prevent reporting the network state. For the standard Tuya serial protocol, suppressing it does not seem practical.
Flashing the firmware of the TuyaMCU is not feasible unless you know the manufacturer of the firmware/device and have contact with them. Tasmota is designed to adhere to the protocol by reporting the network state. The following lines are extracted from the Tuya serial protocol description:
Perhaps we could consider implementing a configuration option to allow users to switch between different Tuya protocols, enabling them to decide which one to use. @barbudor, I'm not sure if we can identify which of the tuya protocols is used by the TuyaMCU. The only difference lies in the third byte of the protocol versions (in some cases, 0x00 is used, and in others, 0x03), as well as in the available commands. |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue still exists, please keep it open. |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
Please keep issue open. |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
Please keep open |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
please keep open |
This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue was automatically closed because of being stale. Feel free to open a new one if you still experience this problem. |
PROBLEM DESCRIPTION
A clear and concise description of what the problem is.
I have a Sichler dehumidifier, which is currently not a supported device. It has a TYWE1S chip, which I flashed successfully. I was able to successfully assign TuyaRx and TuyaTx and was able to assign the fnids to dpids. I was able to toggle the relays I need successfully via the webinterface. As soon as I configure MQTT the device does not turn on/off anymore when toggeling the relays. No matter if actioned via Webinterface or MQTT.
When I remove the Host from the MQTT configuration it starts working again. When MQTT is enabled but the MQTT Broker is stopped, it is working too.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:Status 0
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:TO REPRODUCE
Steps to reproduce the behavior:
Add/Remove MQTT Host IP. Toggle Power1 via Webinterface
EXPECTED BEHAVIOUR
A clear and concise description of what you expected to happen.
Device turning On/Off when toggling DpID 101 which is working when MQTT is not configured
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
MQTT Broker used: eclipse-mosquiotto and emqx. With both the same problem
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: