Events
Your device must be added to localtuya to use Events
Localtuya fires an events on homeassisstant
that can be used on automation or monitoring your device behaviour from Developer tools -> events (1)
- to monitor your device subscribe to any event below and trigger action on the device using tuya app
With this you can automate devices such as scene remote
(1) to trigger an action on homeassistant
- e.g.
single click
,double click
orhold
.
Event | Data |
---|---|
localtuya_status_update |
{"data": {"device_id", "old_status", "new_status"} } |
localtuya_device_dp_triggered |
{"data": {"device_id", "dp", "value"} } |
Examples
# This will always triggers if DP used.
trigger:
- platform: event
event_type: localtuya_device_dp_triggered
condition: []
action:
- service: persistent_notification.create
data:
message: "{{ trigger.event.data }}"
example of an automation to trigger a scene when the first button on a remote is single-clicked
Database flooding
If the recorder is enabled, devices like temperature sensors may update frequently (e.g., every second). This can cause excessive events and significantly increase database size. It is recommended to exclude localtuya events from the recorder to prevent database overload.