Hi experts,
I would like to know the fundamental differences between writing an trigger automation for a sonoff switch platform state OR a trigger for a switch turned on/off. Both the below works and I am trying to see the difference.
Technically, I would like to only catch the switch turning on/off by a user or a service. But seems that the automation triggers also when the unreliable WIFI knocks out the switch for a few minutes - and I don’t need that to be triggered.
Any advice please ?
Automation 1
alias: Sonoff Switch State Change
description: ""
trigger:
- platform: state
entity_id:
- switch.sonoff_100066a913
for:
hours: 0
minutes: 3
seconds: 0
condition: []
action:
- service: ifttt.trigger
data:
event: Sonoff_T_Switch_State_Change
value1: "{{ trigger.from_state.attributes.friendly_name }}"
mode: single
Automation 2
alias: "Sonoff Switch OnOff Change"
description: ""
trigger:
- platform: device
type: changed_states
device_id: 74113e4baff67904e45de6b8e35a9a5c
entity_id: switch.sonoff_100066a913
domain: switch
for:
hours: 0
minutes: 3
seconds: 0
condition: []
action:
- service: ifttt.trigger
data:
event: Sonoff_T_Switch_State_Change
value1: "{{ trigger.to_state.name }}"
mode: single