(Sunrise) scene doesn't always trigger

Hello,

For some time now, I’ve been using Tasker to trigger the sunrise scene 15 minutes before my morning alarm. All along I’ve had trouble with it not always triggering. At first I found and solved some Tasker-related problems that prevented the task (automation) from triggering in Tasker. Now it reliably triggers (as confirmed in Tasker’s run log), but the bulb doesn’t always initiate the scene.

In an attempt to solve the problem, I made Tasker ping the bulb before it sends the scene command (using the Yeelight Tasker plugin). It pings in a loop, up to 5 times, until it receives a response. While testing I’ve always gotten a response to the first ping, but yet the scene doesn’t always trigger. It’s as if the bulb goes into some kind of sleep mode - yet it keeps responding to pings.

When the bulb seems to be in what I call “sleep mode”, manually triggering the Tasker task that should initiate the sunrise scene doesn’t work. The only solutions I have found so far is to 1) just wait, 2) open the Yeelight app and interact with the bulb there somehow so that it becomes “detected” in the Yeelight app. After doing #2, the sunrise task in Tasker will work for some time (but not necessarily the next morning).

This is becoming very frustrating, since there’s always a long delay between the previous manual action and the task triggering (since I’ve been sleeping).

Some more details:

  • The bulb has the latest firmware (1.4.1_48).
  • Developer mode is activated.
  • Music mode is activated (to prevent it from becoming unresponsive in Home Assistant).

Today I uninstalled the Mi Home app in case it interferes with the Yeelight app somehow. I’ve not done any “natural” testing since then (but will find out tomorrow morning if it helped).

What else can I do to solve the problem?

Thanks for reading.

Does the sunrise work if you set it from Yeelight application.

Yes, it does. :slight_smile:

Let me explain how Yeelight app work with Tasker.

There is component, we call it Action Executor, be in charge of handling Tasker request asynchronously.

When Yeelight app not running in the background, the Tasker trigger could launch Yeelight app, but there need couple seconds to initiate the device list and get device current status before Yeelight app could handle that trigger. Action Executor will cache the trigger and try again after device list initiated.

According to your issue description, there must be something wrong with Action Executor.

Is there any chance you can help to capture log from your phone?

I just went through the code and I suspect the root cause is your network latency too hight.

There is a timer (timeout in 2 seconds) to retrieve scene from Yeelight backend.

Could you please change your tasker action from SCENE to TOGGLE, and try to manually trigger that action again?

Hi, I am facing the same problem as well.
I link my light to Alarmpad, which is an app that can trigger task in tasker.
I have it turn on the light with a favorite scene when my alarm is fired. It used to work until last week.
I am trying to troubleshoot this prob, I tried it with other task, it works for other task but light is not turned on.

Could you please change your tasker action from SCENE to TOGGLE, and try to manually trigger that action again?

Seems unlikely to me. If I ping the bulb it responds in a few milliseconds.

I can try what you suggested, but will have to wait until the next time the bulb becomes unresponsive (I can’t trigger it). Will report back.

It has nothing to do with the latency between your phone and the bulb.

It depends on the latency between your phone and Yeelight backend server.

Please try the case I suggested in previous response.

@RonnyAL you don’t need to wait the bulb becomes unresponsive. You can just kill Yeelight app that running in background and manually trigger your Takser action.

Aha. Is it possible to enforce local control (while using Tasker)? I’ll kikk the app etc. like you say when I get home later today. Will report back.

Thanks.

When you choose SCENE type tasker action, tasker will only save scene ID instead of detailed scene content, the detail scene content need to be retrieved from yeelight server when this action is triggered.

Weiwei, I realised that only one of my phone has problem with tasker.
It doesn’t trigger task for Yeelight consistently.
I have no idea what happened to out of suddenly, it show green light everytime I test but nothing happen to the light sometimes.

I understand, thanks. It would be cool if you implemented local scene control though! That would even make it possible to design custom scenes. :slight_smile:

For now I’ve set it up so that the Yeelight app runs before Tasker triggers the scene. We’ll see how that works.

Ive got it working perfectly using IFTTT. I user Maker web hooks and use tasker to send the webhook and then IFTTT to triggger the yeelight. From my testing its worked 100% of the time

IFTTT is cloud to cloud inter-operation. Tasker is local based.(APP to APP)

Im aware of that, but due to this issue with takser not always triggering the device, I set it up through the cloud and its working perfectly.

As what I have mentioned in previous response, we need to figure out why tasker not always triggering the device.

Appreciate if you can help to try change your tasker action from SCENE to TOGGLE, and then manually trigger that action to check if tasker could be triggered every time.

To all who encountered scene doesn’t always trigger, please check this and make sure disable Battery Optimization for both tasker and yeelight.

http://tasker.dinglisch.net/userguide/en/androidpowermanagement.html