I recently got a couple of different Tuya Wifi devices to test in HA. Motion sensor, door/window sensor and switch. Each are powered by a couple of AAA batteries.
The motion sensor and door/window sensor have been easy enough to setup automations for in HA, but the switch is proving troublesome.
When I look at the entity info it lists Events: Button 1, Button 2; Diagnostic: Battery.
In the details for the buttons it lists:
Event type - Clicked
Event types - click, press
When I try to make an automation for the switch, if I select the device, the only Trigger available is “Wireless Switch Battery battery level changes”.
If I instead select entity and Button 1 and then state, I am not sure what to enter from there. If I leave all options blank, then when I click the button the automation will work. If I enter ‘click’ in the To field and say to add custom state, then the automation does not work.
When I look at the device info and events it shows as Clicked or Long-clicked.
Hoping someone can assist with what I am doing wrong when trying to create the automation.
I did a download diagnostics from the Tuya integration (currently not using local one) and got the following for the switch:
{
"id": "bf431c1c02c667c897oa2q",
"name": "Wireless Switch",
"category": "wxkg",
"product_id": "l8yaz4um5b3pwyvf",
"product_name": "Wireless Switch",
"online": true,
"sub": false,
"time_zone": "+10:00",
"active_time": "2026-03-26T07:23:01+00:00",
"create_time": "2026-03-26T07:23:01+00:00",
"update_time": "2026-03-26T07:23:01+00:00",
"function": {},
"status_range": {
"switch_mode1": {
"type": "Enum",
"value": "{\"range\":[\"click\",\"press\"]}",
"report_type": null
},
"switch_mode2": {
"type": "Enum",
"value": "{\"range\":[\"click\",\"press\"]}",
"report_type": null
},
"battery_percentage": {
"type": "Integer",
"value": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}",
"report_type": null
}
},
"status": {
"switch_mode1": "click",
"switch_mode2": "click",
"battery_percentage": 69
},
"home_assistant": {
"name": "Wireless Switch",
"name_by_user": null,
"disabled": false,
"disabled_by": null,
"entities": [
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": "button",
"icon": null,
"original_icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "event.wireless_switch_button_1",
"state": "2026-03-27T00:14:36.627+00:00",
"attributes": {
"event_types": [
"click",
"press"
],
"event_type": "click",
"device_class": "button",
"friendly_name": "Wireless Switch Button 1"
},
"last_changed": "2026-03-27T00:14:36.627627+00:00",
"last_reported": "2026-03-27T00:14:36.627627+00:00",
"last_updated": "2026-03-27T00:14:36.627627+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": null,
"device_class": null,
"original_device_class": "button",
"icon": null,
"original_icon": null,
"unit_of_measurement": null,
"state": {
"entity_id": "event.wireless_switch_button_2",
"state": "2026-03-27T00:48:31.022+00:00",
"attributes": {
"event_types": [
"click",
"press"
],
"event_type": "click",
"device_class": "button",
"friendly_name": "Wireless Switch Button 2"
},
"last_changed": "2026-03-27T00:48:31.022253+00:00",
"last_reported": "2026-03-27T00:48:31.022253+00:00",
"last_updated": "2026-03-27T00:48:31.022253+00:00"
}
},
{
"disabled": false,
"disabled_by": null,
"entity_category": "diagnostic",
"device_class": null,
"original_device_class": "battery",
"icon": null,
"original_icon": null,
"unit_of_measurement": "%",
"state": {
"entity_id": "sensor.wireless_switch_battery",
"state": "69.0",
"attributes": {
"state_class": "measurement",
"unit_of_measurement": "%",
"device_class": "battery",
"friendly_name": "Wireless Switch Battery"
},
"last_changed": "2026-03-27T00:00:47.255699+00:00",
"last_reported": "2026-03-27T00:00:47.255699+00:00",
"last_updated": "2026-03-27T00:00:47.255699+00:00"
}
}
]