From b31d543f0daf5ac7b250cc2a4708c0abfac144aa Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Mon, 13 Jul 2020 18:46:12 +0200 Subject: [PATCH] Adjust documentation for change of event (#13956) Co-authored-by: Franck Nijhof --- .../binary_sensor.rfxtrx.markdown | 5 -- source/_integrations/cover.rfxtrx.markdown | 5 -- source/_integrations/light.rfxtrx.markdown | 5 -- source/_integrations/rfxtrx.markdown | 80 +++++++++++++++++++ source/_integrations/sensor.rfxtrx.markdown | 8 -- source/_integrations/switch.rfxtrx.markdown | 72 ----------------- 6 files changed, 80 insertions(+), 95 deletions(-) diff --git a/source/_integrations/binary_sensor.rfxtrx.markdown b/source/_integrations/binary_sensor.rfxtrx.markdown index 0f5a49c5a91..b20751f7f73 100644 --- a/source/_integrations/binary_sensor.rfxtrx.markdown +++ b/source/_integrations/binary_sensor.rfxtrx.markdown @@ -60,11 +60,6 @@ devices: description: Sets the [class of the device](/integrations/binary_sensor/), changing the device state and icon that is displayed on the frontend. required: false type: device_class - fire_event: - description: Fires an event even if the state is the same as before. Can be used for automations. - required: false - type: boolean - default: false off_delay: description: For sensors that only sends 'On' state updates, this variable sets a delay after which the sensor state will be updated back to 'Off'. required: false diff --git a/source/_integrations/cover.rfxtrx.markdown b/source/_integrations/cover.rfxtrx.markdown index 9e054b35906..9e6c25c9bb9 100644 --- a/source/_integrations/cover.rfxtrx.markdown +++ b/source/_integrations/cover.rfxtrx.markdown @@ -66,11 +66,6 @@ devices: description: Override the name to use in the frontend. required: true type: string - fire_event: - description: Fires an event even if the state is the same as before. Can be used for automations. - required: false - default: false - type: boolean automatic_add: description: To enable the automatic addition of new covers (Siemens/LightwaveRF only). required: false diff --git a/source/_integrations/light.rfxtrx.markdown b/source/_integrations/light.rfxtrx.markdown index 9a782a63764..b3e74da316e 100644 --- a/source/_integrations/light.rfxtrx.markdown +++ b/source/_integrations/light.rfxtrx.markdown @@ -59,11 +59,6 @@ devices: description: Override the name to use in the frontend. required: true type: string - fire_event: - description: Fires an event even if the state is the same as before. Can be used for automations. - required: false - default: false - type: boolean automatic_add: description: To enable the automatic addition of new lights. required: false diff --git a/source/_integrations/rfxtrx.markdown b/source/_integrations/rfxtrx.markdown index d85a80d6060..583bc63c59f 100644 --- a/source/_integrations/rfxtrx.markdown +++ b/source/_integrations/rfxtrx.markdown @@ -64,3 +64,83 @@ You can host your device on another computer by setting up ser2net and example c ```text 50000:raw:0:/dev/ttyUSB0:38400 8DATABITS NONE 1STOPBIT ``` + +## Events + +The rftrx integration will signal an event on reception of messages from the RFXtrx device on the following form. + +*Signal from a byron doorbell button:* + +```yaml +packet_type: 22 +sub_type: 0 +type_string: "Byron SX" +id_string: "00:90" +data: "0716000100900970" +values: + Sound: 9 + Battery numeric: 0 + Rssi numeric: 7 +``` + +*Event data from a Nexa wall socket switch:* + +```yaml +packet_type: 16 +sub_type: 1 +type_string: 'ARC' +id_string': 'C3' +data: '0710010143030170' +values': + Command: 'On' + Rssi numeric': 7 +``` + +You can setup automations to react to these events. When you do don't include more fields than needed. Always include the device identifying fields, `packet_type`, `sub_type` and `id_string`. + +So for example to trigger a action when somebody presses the doorbell, you would set up a automation with the following trigger: + +*Automation trigger:* + +```yaml +- platform: event + event_type: rfxtrx_event + event_data: + packet_type: 22 + sub_type: 0 + id_string: "00:90" + values: + Sound: 9 +``` + +*A more complete example with scene activation:* + +```yaml +light: + platform: demo + +scene: + name: WelcomeScene + entities: + light.bed_light: on + light.ceiling_lights: off + +automation: + - alias: Use doorbell button to trigger scene + trigger: + - platform: event + event_type: rfxtrx_event + event_data: + packet_type: 22 + sub_type: 0 + id_string: "00:90" + values: + Sound: 9 + action: + service: scene.turn_on + entity_id: scene.welcomescene +``` + +### Discovering events for your devices + +To figure out what your devices send, you can listen on the `rfxtrx_event` in the development tool/event page. diff --git a/source/_integrations/sensor.rfxtrx.markdown b/source/_integrations/sensor.rfxtrx.markdown index 3045d859ffe..869e6b60723 100644 --- a/source/_integrations/sensor.rfxtrx.markdown +++ b/source/_integrations/sensor.rfxtrx.markdown @@ -85,9 +85,6 @@ sensor: platform: rfxtrx automatic_add: true devices: - 0a52080705020095220269: - name: Lving - fire_event: true 0a520802060100ff0e0269: name: Bath data_type: @@ -105,11 +102,6 @@ devices: description: Override the name to use in the frontend. required: false type: string - fire_event: - description: Fires an event even if the state is the same as before. Can be used for automations. - required: false - default: false - type: boolean data_type: description: Which data type the sensor should show. required: false diff --git a/source/_integrations/switch.rfxtrx.markdown b/source/_integrations/switch.rfxtrx.markdown index 3f9e35fba82..521904e19f8 100644 --- a/source/_integrations/switch.rfxtrx.markdown +++ b/source/_integrations/switch.rfxtrx.markdown @@ -50,11 +50,6 @@ devices: description: Override the name to use in the frontend. required: true type: string - fire_event: - description: Fires an event even if the state is the same as before, for example, a doorbell switch. Can also be used for automations. - required: false - default: false - type: boolean automatic_add: description: To enable the automatic addition of new switches. required: false @@ -110,71 +105,4 @@ switch: name: Movement2 0b1111e003af16aa10000060: name: Door - fire_event: true -``` - -Light hallway if doorbell is pressed (when is sun down): - -```yaml -# Example configuration.yaml entry -switch: - platform: rfxtrx - automatic_add: false - devices: - 0710014c440f0160: - name: Hall - "0710010244080780": - name: Door - fire_event: true - -automation: - - alias: Switch the light on when doorbell rings if the sun is below the horizon and the light was off - trigger: - platform: event - event_type: button_pressed - event_data: {"entity_id": "switch.door"} - condition: - condition: and - conditions: - - condition: state - entity_id: sun.sun - state: "below_horizon" - - condition: state - entity_id: switch.hall - state: 'off' - action: - - service: switch.turn_on - entity_id: switch.hall -``` - -Use remote to enable scene (using event_data): - -```yaml -# Example configuration.yaml entry -switch: - platform: rfxtrx - automatic_add: false - devices: - 0b1100ce3213c7f210010f70: - name: Light1 - 0b11000a02ef2gf210010f50: - name: Light2 - 0b1111e003af16aa10000060: - name: Keychain remote - fire_event: true -scene: - name: Livingroom - entities: - switch.light1: on - switch.light2: on - -automation: - - alias: Use remote to enable scene - trigger: - platform: event - event_type: button_pressed - event_data: {"state": "on", "entity_id": "switch.keychain_remote"} - action: - service: scene.turn_on - entity_id: scene.livingroom ```