A button to trigger Home Assistant automation instantly

Hi everyone, I am trying to find a way to trigger HA automation from a physical button. I used a light switch (via tuya), but the problem is there is a significant delay between pushing the button and triggering the automation. I guess this is because HA does not recognise the switch state change from tuya integration and takes some time.
So, I am looking for other options. I read Zigbee button might be the option. Anyone has a good experience on this?
I’ve been looking at Hue, Xiaomi, Ikea brands. But please recommend any good one.

Thank you!

Do you already have a zigbee/zwave setup? Any hub/Gateway?

Zigbee/ZWave are probably the best choices, generally speaking.
I don’t have any, but I assume Ikea with a gateway will have the best availability/price/easiness ratio
Anything WiFi is to be avoided (IMHO).

I will buy a hub and button if it works instantly. Would it have no delay with HA automation?

I personally don’t know, but I assume so.
Best to search for “ikea” / “tradfri” in the forums and look for user experience.

I’ve been testing a Hue smart button recently. I haven’t see any significant delay between the button being pressed and the automation being triggered. The trigger is the button being released, though. Don’t know if this makes a difference to your application.

Edit: I’m using the Hue bridge and integration.

I’m using Hue as well myself, historically, but those tend to be much more expensive than Ikea.

Tell me about it… :roll_eyes:

First I’d check my setup with the Tuya integration. Some delay is tolerable, but that shouldn’t be more than half a second to a second.

I’m using Zigbee switches and buttons, ESPHome switches and buttons and wifi switches and buttons. None of them need more than a second to switch. For example one ESP32 connected with a LED strip. That runs on Wifi and it is instantly switching the LED strip.

Nevertheless I wouldn’t buy an IKEA gateway as these aren’t necessary nor useful. If that’s the way you wanna go, use a Zigbee Stick (Slaesh, Elektrolama, CC2531) and not the proprietary gateway. All IKEA devices work with Zigbee standards, so they are usable with Zigbee2MQTT.

I can give you more examples from my setup, where different buttons work without timing issues (Shelly1, ShellyButton, IKEA Tradfri remote…)

Did you integrated with non-hue smart product? Is there any delay? One of my use case will be to open and close a garage door. I don’t want to wait 5 seconds for HA to start opening the garage door. Currently with tuya button, it takes minutes to trigger sometimes.

Just tried it. The button is now linked to a Hue bulb (using the Hue app) and via HA to a Lightwave 1st Gen lightswitch controlled by RF commands from a Broadlink RM4 Pro:

id: '1624306817398'
alias: Test 2
description: Triggers each time smart button is pressed
trigger:
  - device_id: 7232bc1ae7d86b1e8a1430c0e2fb74a5
    domain: hue
    platform: device
    type: remote_button_short_release
    subtype: turn_on
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.study_spotlights
mode: single

There is a slight delay in the second light responding, but still less than a second and down to the Broadlink probably. Logs show both lights going off the same second.

It’s because HA is polling tuya entities’ status periodically. i guess the interval is x minutes. If i turn on the tuya switch with HA (e.g. Google Assistant or Alexa), it’s instant. But when I press the physical tuya switch, it takes minutes which means it’s not usable.

I’m not using Tuya components, but that doesn’t make any sense at all. Why would one want a switch, that has such a slow response time. There can’t be much use for that… Doesn’t the Tuya integration send a status vs letting HA poll it?

Nonetheless, I’d try to flash the device with e.g. ESPHome or someting else. What switch are we even talking about?

As I said, I have a lot of devices that act as a switch, and none of them is needing more than a second, even if triggered by an automation.

Tuya is dirty cheap, but also dirty crap :wink:
OP, you didn’t tell the model of tuya switch you experimented with.

As I said earlier, if it’s wifi, bad performances are expected.

Thank you for checking this. Less than a second is very acceptable to me.

It’s Grid Connect product and the manufacturer is Deta.

Please be specific. Which one? Grid Connect Line of Products

Tuya has its own cloud, Tuya devices can be accessed via its cloud afaik. And as I said, turning on/off the switch via HA is instant, no delay. The problem is only when the switch triggers an action in HA automation as HA doesn’t get notified the event and it has to poll the status.

This one Switches | Grid Connect

EDIT: to be more specific https://www.bunnings.com.au/deta-grid-connect-smart-double-gang-touch-light-switch_p0098812

be aware that if you use the tradfri gateway directly, the button you use with it can control the light but the button itself is not visible in HA

ikea tradfri hub is a good stand alone if you just want to control light, but if you want to use there button for something else you have to integrate with ziggbee

1 Like

Good point. It is indeed the case for Hue as well.
I hds delays with the Hue remote going through the gateway as well (but that was before the “push” update of Hue, which likely solved the issue).

I also have a Zigbee coordinator through ZHA, and I ended up hooking the remoting directly to zigbee, without the gateway. It’s instantaneous, now.