Closed imbehind closed 1 year ago
The device log on iot.tuya.com reads:
2023-05-11 07:00:15 Report Switch 1 OFF device itself
2023-05-11 07:00:03 Report Switch 1 ON device itself
2023-05-11 07:00:03 publish by cloud api publish by cloud api success open api cloud2cloud
2023-05-11 07:00:03 Publish Switch 1 ON
The OFF source at 2:00:15 seems to be "device itself" which appears without previous api call, as with automation at 7:00:03.
The normal sequence (7:00:03) consists of three steps - 1) iot.tuya.com receives request to turn ON (source cloud2cloud), 2) event is published through open api (source open api) and 3) the device confirms it turned itself ON (source device itself).
What I'm saying is that if Tuya smart plug by itself just went off, without any interaction and consequences on HA, I would focus on Tuya itself. But the problem is that HA reflects the change and whatsmore I just cannot manually flip the HA dashboard switch. It reverts to previous state automatically and instantaneously.
Is it possible the problem arises because of "Power on behaviour" setting under devices is set to "Remember last state"?
Any other ideas?
I've found the source of the problem. While testing Tuya app I made Tuya automation to turn off the plug at 07:00.
I'm running HA for years now, with no major problems, I guess it's my turn. 😊
Recently, I've changed some hardware - switched from Broadlink IR blaster / IR plug to Tuya Smart plug on 2 of my devices - 2 lights (hydroponics and aquarium).
configuration.yaml
(old configuration is commented)
this is automation.yaml for Hydroponics. The other one for Aquarium is the same:
The problem is that this light (Hydroponics) is turning off by itself, few seconds after it turns on triggered by automation.
The log book says:
Also, when it fails like this and turns itself off, if I try to manually turn ON the light entity on dashboard the switch won't "flip" (it goes straight back to off). The same is when I try to manually turn ON the switch entity on dashboard.
The question is what triggers switch to turn off?
The other (the same) automation for Aquarium works fine, this one also works fine after HA reset, and starts misbehaving again later.
Any ideas how to troubleshoot this?
Tuya Smart Plug Main Module v1.3.5 Tuya Smart Plug MCU Module v1.3.5