How to trigger automation when Tuya scene starts?

Hello, I have tuya scene which is “tap to run” defined im Smart life and this scene has been imported into Home assistant as scene.cvd8smy11wwgtll7_2

Can somebody please advise me how the trigger should look like that triggers an automation when this scene is triggered? From what I found I would need to make trigger based on all components because it is not possible to base it on scene. I do not believe that because there must be an event triggred together with scene start, right? It is not possible to base trigger on components of a scene, because they can all reach same status during time as defined in the scene yet the actual scene is still not triggered.

Hi,

You could try this:

- alias: Test automation
  trigger:
    platform: event
    event_type: call_service
    event_data:
      service_data:
        entity_id: scene.cvd8smy11wwgtll7_2
      domain: scene
      service: turn_on
  action:
    service: tts.cloud_say
    entity_id: media_player.enceinte_bureau
    data:
      message: Scene has been triggered
  id: be7136b339a0446abece19221beba619

Hop this helps.

Hello. I’ve tried this, but it only worked when I activated the Tuya Scene via HA. HA seems not to be able to detect a tuya “tap-to-run” nor a tuya automation when they’re activated via Tuya’s network. Is there a way to trigger an HA automation when a Tuya scene starts via Tuya itself?!?

Hello, I have same experience. I have done a workaround - I detect change in state of some device, that is changed by tap-to-run scene in tuya mobile. But it has disadvantage that this device can also be triggered by other event. Only other way I can think of is to buy 4-set relays, include them in tuya automation and then trigger home assistant by state change of these relays. Pretty ugly…

1 Like

yeah, that was basically my “solution”. I have created a topic to try and find a better solution to this, Trigger HA automation by activating a Tuya "tap-to-run" automation
but no new ideas until now…

HI,
I am facing the same problem trying to integrate Tuya Flooding Sensor into HA, Sadly found no way for days.
Yesterday I noticed that the device shows on the clients list connected to my access point Ruckus R320 which is integrated into HA and the device shows in the entities list in HA when it is triggered but I didn’t figure a way how to use this! any idea? Is there a way to have an automation that runs when a device is discovered in a certain integration?

Hello. I actually stopped buying wifi tuya devices and I am replacing them with zigbee devices. Those you do not need to use only in Tuya/Smart_Life app, but you can pair them to your own HA-connected Zigbee gateway. I bought one based on CC2531 and it arrived with correct firmware already flashed… Then with zigbee2mqtt and mosquitto it works with Home Assistant directly.

But it has disadvantage that this device can also be triggered by other event. Only other way I can think of is to buy 4-set relays, include them in tuya automation and then trigger home assistant by state change of these relays.

MyGiftCardSite

Hi guys,

tl;dr;
You can add a tuya virtual smart switch scanning this qr using the Tuya Smart App (haven’t tested with other apps):

tuya virtual device

I bumped with the same issue recently after buying a doorbell. The doorbell call event is not published to HASS but it can start a scene.

Looking around on the Tuya IoT platform, I found out that on Cloud > Development > All Devices, you can create a virtual device.

There, you have a list of devices that can be added to your account.
Once you have the virtual device, you can create the scene and hook the event on HASS.

Cheers.

1 Like