Tuya Lights - Control Tuya group at once

I just got 6 Tuya wifi lights (Aoycocr lights from Amazon - use the Tuya platform). I got them setup using the Smart Life app. I then setup the Tuya integration (https://www.home-assistant.io/integrations/tuya/), and they work well independently.

I have a “group” setup in Smart Life which controls all the lights at once. Using this, all lights update at the same time, instantly. This group does not appear via the Tuya HA integration (only the individual lights), so I created a light group through HA and added the lights individually. Controlling this group via HA, it updates the lights one-by-one with about a 1 second delay between each light. For example, turning on the lights, they go 1-by-1 about a second apart. I’m assuming this is because HA is using Tuya to send the commands one by one for each entity instead of all at once, versus the Smart Life app sends all commands at once.

How can I get HA to recognize and control the “Group” in Tuya rather than sending commands one-by-one? Or is there another way to have all the lights update together?

I figured out somewhat of a “solve” for this, in case anyone comes along this in the future (surprised this issue hasn’t been brought up before).

I created 2 scenes in Tuya. One turns all the lights on, and one turns all the lights off. These scenes will control all of the lights at once, not one-by-one with a one second delay between each as the Home Assistant group does. I then called the pull_devices tuya service to get these scenes into HA. Now I can trigger the lights on and off all at once using the scenes.

I further created an input_boolean and hooked up automations for when the input_boolean turns on or off. On, it calls the scene to turn lights of, and off calls the scene to turn lights off. This allows it to look and act as a typical light switch.

This works nicely for most common use-cases. It would still be nice to control the Tuya group directly though, so you don’t have to setup a scene for any scenario you may want to set the lights to (ie changing colors, brightnesses, etc).

1 Like

Slightly off-topic, but have you had any success calling a scene?

I want to be able to make my tuya lights do a colorloop, and one of the scenes in the tuya app does this. I just can’t seem to call it??

Yes my scenes are working, that’s the only way I can successfully control my group of lights really. Here’s an example automation that tracks an input boolean I’m using as the “group” of lights, to turn them off via a scene.

- alias: 'Porch Lights Off Scene'
  initial_state: On
  trigger: 
    platform: state
    entity_id: input_boolean.porch_lights
    to: 'off'
  action: 
    service: scene.turn_on
    entity_id: scene.porch_lights_off

Ah - not sure that I worded that correctly.

I’m talking about activating a tuya scene, not a homeassistant scene. See the screen shot of my tuya app.

In the Tuya app, there are 8 scenes. I’d like to activate one of these, but can’t work out how?

The scene.porch_lights_off is actually a scene I setup in the Tuya app, then when I pulled devices from Tuya it shows up as a scene within Home Assistant and I can call it using scene.turn_on within HA like above.

I’m not sure if you can call the preset Tuya scenes directly, but I just looked and it does look like you can create your own Automation in Tuya. For the condition just use ‘Click to Execute’, select the appropriate device(s), and in the Task section turn on the device and in the “Mode” options the scenes are available there. So pick your scene from the Tuya presets, then save your action in Tuya. Once you’ve done that, you can pull this into Home Assistant and control from there.

Not sure if there is a more direct way of doing this, but I think the above should at least accomplish your end goal.

1 Like

I came across the same issue and trying to follow your instructions.

Can you please share the config and automation yaml code.

I would like to also use 1 input_boolean to either call the scene to turn the group on or off.

Thanks

I was trying to get the same thing. I dont know if this topic was out dated or the persons did not search right. I respond because this is the 1st google hit.

you can create groups in home assistant Group - Home Assistant

Maybe you missed this part in your reading:

Controlling this group via HA, it updates the lights one-by-one with about a 1 second delay between each light. For example, turning on the lights, they go 1-by-1 about a second apart. I’m assuming this is because HA is using Tuya to send the commands one by one for each entity instead of all at once, versus the Smart Life app sends all commands at once.

I have none of those troubles.

Integrated seamlessly with no delay