RFXCOM, HA 0.113, LightwaveRF Mood Switches

Discovered that my LightwaveRF Mood switches do not work ‘out of the box’ with 0.113 - previous 0.112.x configuration values (device IDs) does not seem to work as expected.

The main On/Off button seems to be registered in 0.113, but not the 4 Mood switch buttons (unit has 6 buttons in total, previously the On/Off had a different ID to the 4 mood buttons).

Logging this here, for anyone else that has the same issues and wants to chime in, might take me a week or so to work through - as I have to do it when the family are out, otherwise I get moaned at. Running on 0.112 for now, as I have about 10 of these devices as wall switches.

Previous configuration:

      0a140000f410de01010070:
        name: Living Room Switch
        fire_event: true
      0a140001f410de10020070:
        name: Living Room Mood
        fire_event: true

Upgraded to 0.113, configuration was modified inline with the changes for 0.113. With all RFX devices removed and in debug mode, debug button presses for the above Mood Switch below:

2020-07-26 07:48:14 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:1 Class: LightingDevice Sub: 0)
2020-07-26 07:48:14 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:1', 'data': '0a14000ef410de01000060', 'values': {'Command': 'Off', 'Rssi numeric': 6}}

2020-07-26 07:48:14 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:1 Class: LightingDevice Sub: 0)
2020-07-26 07:48:17 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:1', 'data': '0a14000ff410de01010070', 'values': {'Command': 'On', 'Rssi numeric': 7}}

2020-07-26 07:48:17 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:1 Class: LightingDevice Sub: 0)
2020-07-26 07:48:19 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a140010f410de10020060', 'values': {'Command': 'Group off', 'Rssi numeric': 6}}

2020-07-26 07:48:19 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:16 Class: LightingDevice Sub: 0)
2020-07-26 07:48:21 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a140011f410de10030070', 'values': {'Command': 'Mood1', 'Rssi numeric': 7}}

2020-07-26 07:48:21 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:16 Class: LightingDevice Sub: 0)
2020-07-26 07:48:22 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a140012f410de10040060', 'values': {'Command': 'Mood2', 'Rssi numeric': 6}}

2020-07-26 07:48:22 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:16 Class: LightingDevice Sub: 0)
2020-07-26 07:48:23 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a140013f410de10050060', 'values': {'Command': 'Mood3', 'Rssi numeric': 6}}

Bit more testing:

Both ‘devices’ (main on/off button and the 4 separate mood buttons) DO in fact appear in HA:

Main on/off switch :1
Moodswitch buttons :16

Main on/off button seems to update correctly:

Moodswitch buttons do not:

2020-07-26 08:14:26 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:16 Class: LightingDevice Sub: 0)
2020-07-26 08:16:26 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a14000df410de10040070', 'values': {'Command': 'Mood2', 'Rssi numeric': 7}}
2020-07-26 08:16:26 DEBUG (MainThread) [homeassistant.components.rfxtrx.binary_sensor] Binary sensor update (Device ID: f410de:16 Class: LightingDevice Sub: 0)
2020-07-26 08:16:27 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a14000ef410de10050060', 'values': {'Command': 'Mood3', 'Rssi numeric': 6}}

Has been so long since I set all this up originally, having to work back through…

In 0.112, I have/had automation rules to pick up the button presses then modify room scene drops in the UI, which in turn then executes a scene change:

  alias: Living Room - Lights - Switch On
  trigger:
  - event_data:
      entity_id: switch.living_room_switch
      state: 'on'
    event_type: button_pressed
    platform: event
  condition: []
  action:
  - service: input_select.select_option
    data:
      entity_id: input_select.living_room_scene
      option: 'All Lights On'

I do note that the states (Command) appear to be capitalised in the debug logs, so tried changing to the below:

  alias: Living Room - Lights - Switch On
  trigger:
  - event_data:
      entity_id: switch.living_room_switch
      state: 'On'
    event_type: button_pressed
    platform: event
  condition: []
  action:
  - service: input_select.select_option
    data:
      entity_id: input_select.living_room_scene
      option: 'All Lights On'

Modified the entity ID’s on the new 0.113 devices noted above, to match the automation rules…

Does not appear to work at this time. Going to have to roll back for now, the family have returned!

To be continued…

EDIT: Think I probably need to manually add the devices back to the configuration (modified for 0.113) and enable fire_event there (as I have in 0.112) so that things are triggered on button presses with the ‘event’ platform in the automation rules, not sure if I can do this (fire_event) in the UI.

Next steps to try:

  • Modify the rfx configuration for 0.113, including explicitly specifying the devices and fire_event: true for each (as I have in 0.112)
  • Upgrade to 0.113
  • Modify either the new entity ID’s to match the automation rules, or the automation rules to match the new switch.xxxxx names
  • Restart
  • Success?

Nope. I give up for now. 0.112 will do :slight_smile:

To try next… using the example on the documentation page, modifying my automation rules:

- platform: event
  event_type: rfxtrx_event
  event_data:
    packet_type: 20
    sub_type: 0
    id_string: "f410de:16"
    values:
      Command: Mood2

Should then trigger when something like the below is received:

2020-07-26 08:16:26 DEBUG (Thread-2) [homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f410de:16', 'data': '0a14000df410de10040070', 'values': {'Command': 'Mood2', 'Rssi numeric': 7}}

Did that work for you? I use AppDaemon and the following is working for me:

def initalize(self):
    id_string = self.args["id_string"]
    self.log("Initalising Mood Switch {}".format(mood_switch))
    self.listen_event(self.mood_event, "rfxtrx_event", id_string=id_string)

and then the mood_event:

  def mood_event(self, event_name, data, *args, **kwargs):
    self.log(event_name)
    self.log(data)
    mood_event = data['values']['Command'].lower()
    script_to_execute  = "undefined"
    if mood_event == "mood1":
      self.mood1()
    ....

so I’m not using packet type or subtype. I did a .lower() as the command was now “Mood1” instead of “mood1” and I was too lazy to change all the switch statements

To be honest, I haven’t felt the desire to fiddle again yet - was waiting for 0.114 for a patch that might restore ‘name:’… but it didn’t make it.

What I need works well on 0.112.4, content without ‘new shiny’… for now. But thanks for another option to try :slight_smile:

Bit the bullet and upgraded to 0.115… only thing I was missing from earlier attempt was the “” around the command string:

- platform: event
  event_type: rfxtrx_event
  event_data:
    id_string: "f410de:16"
    values:
      Command: "Mood2"
1 Like

I wonder if anyone can help. I’m running v117 of HA, and installed RFXCOM today. I have the following in my configurations.yaml, and have lightwaveRF entities in the system using auto-add.

automation:
  - alias: mood test
    trigger:
    - platform: event
      event_type: rfxtrx_event
      event_data:
        packet_type: 20
        sub_type: 0
        id_string: "f54e4c:16"
        values:
          Command: "Mood3"
    action:
      service: notify.prowl
      data_template:
        message: | 
          Mood button pressed!
          
  - alias: mood test 2
    trigger:
    - platform: event
      event_type: rfxtrx_event
      event_data:
        packet_type: 20
        sub_type: 0
        id_string: "f54e4c:1"
        values:
          Command: "On"
    action:
      service: notify.prowl
      data_template:
        message: | 
          on button pressed!

When I press the mood switch, I see the following in the logs:

RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f54e4c:16', 'data': '0a140003f54e4c10050060', 'values': {'Command': 'Mood3', 'Rssi numeric': 6}}

RFXCOM event: {'packet_type': 20, 'sub_type': 0, 'type_string': 'LightwaveRF, Siemens', 'id_string': 'f54e4c:1', 'data': '0a140003f54e4c01010050', 'values': {'Command': 'On', 'Rssi numeric': 5}}

but the automations never trigger. I’m not sure why, and what I should do next. Can anyone assist?

1 Like

I’d double check that Fire Event is enabled in the UI:

Configurations -> Integrations -> RFXCOm -> Options (top level) -> Select Device to configure -> Choose the device -> Submit -> Make sure that ‘Enable device event’ is enabled -> Repeat for others

That was it! Thank you @iMiMx, I’m not sure I would ever have thought to look there…!

2 Likes

Hugely helpful. Thanks!

Had troubles setting this up recently, probably due to lack of knowledge but I wrote a short guide in case it helps others in the future