I am struggling with integrating a button correctly so that each click does something and not only a state change. Example: the button is setup by local tuya as followed (copied from core.entity_registry) but this leads to a situation where e.g. a single click on button 1 sets the switch of button 1 to “single click”. If I now e.g. click on button 2 and want to single click on button 1 again, the log of the device doesn’t show any changes since the state is already on “single click”
{"aliases":[],"area_id":null,"categories":{},"capabilities":{"options":["Single click","Double click","Long Press"]},"config_entry_id":"01JHTEETVGSF8AX02Q2J1ZAXV6","created_at":"2025-01-17T15:27:51.756600+00:00","device_class":null,"device_id":"ABCDEF","disabled_by":null,"entity_category":"config","entity_id":"select.wohnzimmer_couch_switch_switch_1","hidden_by":null,"icon":null,"id":"ABCDEF","has_entity_name":true,"labels":[],"modified_at":"2025-01-17T15:35:32.731029+00:00","name":null,"options":{"cloud.alexa":{"should_expose":false},"cloud.google_assistant":{"should_expose":false},"conversation":{"should_expose":false}},"original_device_class":null,"original_icon":"mdi:square-outline","original_name":"Switch 1","platform":"localtuya","supported_features":0,"translation_key":null,"unique_id":"local_ABCDEF","previous_unique_id":null,"unit_of_measurement":null},
Is there a way to configure this in a way that each click on a button triggers something and not only when a state change from e.g. single click to double click ist registred?
The standard status set from Tuya API is:
switch1_value Enum
{
"range": [
"single_click",
"double_click",
"long_press"
]
}
switch2_value Enum
{
"range": [
"single_click",
"double_click",
"long_press"
]
}
switch3_value Enum
{
"range": [
"single_click",
"double_click",
"long_press"
]
}
switch4_value Enum
{
"range": [
"single_click",
"double_click",
"long_press"
]
}
battery_percentage Integer
{
"unit": "%",
"min": 0,
"max": 100,
"scale": 0,
"step": 1
}