RFLink switch in automation

I think I’m getting unnecessarily confused by something that should be simple by reading multiple replies from searches so I’ll ask directly.

I want to use rflink switches as triggers.

The response I get in the log is:

20-09-23 01:09:19 DEBUG (MainThread) [homeassistant.components.rflink] event of type command: {‘id’: ‘ev1527_06146b_08’, ‘command’: ‘on’}
2020-09-23 01:09:19 DEBUG (MainThread) [homeassistant.components.rflink] entity_ids: [‘switch.muteamp’]
2020-09-23 01:09:19 DEBUG (MainThread) [homeassistant.components.rflink] passing event to switch.muteamp

My switch.yaml is:

- platform: rflink
  devices: 
    ev1527_06146b_08:
      name: muteamp
  switches:
    automatic_add: true        

And the latest try at automation that doesn’t do anything is :


- id: mute
  alias: mute musiccast
  description: ''
  trigger:
  - event_data: 
      entity_id: light.ev1527_06146b_08
    event_type: button_pressed
    platform: event

I’ve removed the action for brevity but it’s a mute toggle.

automatic_add does not do anything for switches.

You need something like this :

- platform: rflink
  device_defaults:
      fire_event: true
      signal_repetitions: 2 
  devices: 
    ev1527_06146b_08:
      name: muteamp

and as automation :


- id: mute
  alias: mute musiccast
  description: ''
  trigger:
  - event_data: 
      entity_id: switch.muteamp
    event_type: button_pressed
    platform: event

The fire events part did it! I’d tried switch.muteamp amongst other possibilities .

Perhaps now I can stop have weird HomeAsssitant dreams ; ).

Thank you so much! :slight_smile: