Triggering on RFXtrx switch and "Group on" command

I have Nexa 433 remote (NEYCT-705) with four switches that works just fine. The fifth one is a “group on” switch that acts as a switch for the whole group.

My problem is the the RFXtrx component ignores this fifth button since the command is “Group on” instead of “On”. It is only logged as received. My question is, is there a way of triggering on this without official support from the RFXtrx component?

The logs from the group on button:

homeassistant.components.rfxtrx:Receive RFXCOM event from (Device_id: 0a7d9921 Class: LightingDevice Sub: 0, Pkt_id: 0b11000000a7d99201040f80)
homeassistant.components.rfxtrx:Device_id: 0a7d9921 device_update. Command: Group on

And from the normal button (that works)

homeassistant.components.rfxtrx:Receive RFXCOM event from (Device_id: 0a7d9924 Class: LightingDevice Sub: 0, Pkt_id: 0b11000100a7d99204010f80)
homeassistant.components.rfxtrx:Device_id: 0a7d9924 device_update. Command: On
homeassistant.core:Bus:Handling <Event state_changed[L]: old_state=<state light.sovrum=off; assumed_state=False, friendly_name=Sovrum, supported_features=1 @ 2017-01-31T19:45:28.889517+01:00>, entity_id=light.sovrum, new_state=<state light.sovrum=on; assumed_state=False, brightness=0, friendly_name=Sovrum, supported_features=1 @ 2017-01-31T19:45:48.172393+01:00>>

Looked in the code for the component and it does filter on the commands. Maybe a should file a feature request?

It would be very handy to have HA understands the group on since it will know that all my switches has been turned on.

Hi
Try something like this

alias: Button Click
trigger:
  platform: event
  event_type: button_pressed
  event_data: {'state': 'group on', 'entity_id': 'switch.nexa_button'}
action:

It is supported as @frelev explained. Just remember to set fire_event to True.
Here is how I do it: https://github.com/Danielhiversen/home-assistant_config/blob/37ee1dc542ee6be907c4c292ffccf6d5897e6d41/automation/heating.yaml#L84

It actually works! Almost, I have a problem that the group on button changes “Pkt_id” (0b11000000a7d99201040f70) frequently, and the constant Device_id (0a7d9921) is not possible to have as a switch.

I do not understand how this works, in my example above no events were fired, although switch was configured with fire_event=true? But when creating the trigger, then an event is fired, the the trigger catches?

homeassistant.components.rfxtrx:Receive RFXCOM event from (Device_id: 0a7d9921 Class: LightingDevice Sub: 0, Pkt_id: 0b11000000a7d99201040f70)
homeassistant.components.rfxtrx:Device_id: 0a7d9921 device_update. Command: Group on
homeassistant.components.rfxtrx:Rfxtrx fired event: (event_type: button_pressed, entity_id: switch.alla1, state: group on)
homeassistant.core:Bus:Handling <Event button_pressed[L]: entity_id=switch.alla1, state=group on>

The last two lines only appeared after I declared the trigger in the automation, not before when only declaring the switch…

Ah now I understand. Events are always fired when fire_event = true. My problem was that I though the fifth “group on” button had its own id and I had not configured fire_event on the four others.

However, the Pkt_id (which ends up being entity_id) jumped around being (according to RFXtrx) one of the other four, although it differed slightly in the hex in the Pkt_id. Must be some magic in the bit-byte xor-hex world.

I expanded the Json data to this and got it to work. I could limit it down to the four buttons, but then I needed four triggers and I only have one case for my “group on” now,

    trigger:
      - platform: event
        event_type: button_pressed
        event_data: 
          state: group on

Thanks!