update for xknx 0.16.1 - event_register service (#16202)

This commit is contained in:
Matthias Alphart 2021-01-25 12:14:21 +01:00 committed by GitHub
parent 7bbb6e6290
commit 5dd3cc340e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,23 +157,17 @@ local_ip:
```yaml ```yaml
knx: knx:
fire_event: true event_filter: ["1/0/*", "6/2,3,4-6/*"]
fire_event_filter: ["1/0/*", "6/2,3,4-6/*"]
``` ```
{% configuration %} {% configuration %}
fire_event: event_filter:
description: If set to True, platform will write all received KNX messages to event bus description: Defines a list of patterns for filtering KNX group addresses. Telegrams with destination addresses matching this pattern are sent to the Home Assistant event bus as `knx_event`.
required: inclusive required: false
type: boolean
default: false
fire_event_filter:
description: If `fire_event` is set `fire_event_filter` has to be specified. `fire_event_filter` defines a list of patterns for filtering KNX addresses. Only telegrams which match this pattern are sent to the Home Assistant event bus.
required: inclusive
type: [list, string] type: [list, string]
{% endconfiguration %} {% endconfiguration %}
Every telegram that matches the filter will be announced on the event bus as a `knx_event` event containing data attributes Every telegram that matches the filter with its destination field will be announced on the event bus as a `knx_event` event containing data attributes
- `data` contains the raw payload data (eg. 1 or "[12, 55]"). - `data` contains the raw payload data (eg. 1 or "[12, 55]").
- `destination` the KNX group address the telegram is sent to as string (eg. "1/2/3). - `destination` the KNX group address the telegram is sent to as string (eg. "1/2/3).
@ -183,7 +177,9 @@ Every telegram that matches the filter will be announced on the event bus as a `
## Services ## Services
In order to directly interact with the KNX bus, you can use the following service: In order to directly interact with the KNX bus, you can use the following services:
### Send
```txt ```txt
Domain: knx Domain: knx
@ -203,8 +199,26 @@ type:
type: [string, integer, float] type: [string, integer, float]
{% endconfiguration %} {% endconfiguration %}
### Read
You can also use the `homeassistant.update_entity` service call to issue GroupValueRead requests for all `*state_address` of a device. You can also use the `homeassistant.update_entity` service call to issue GroupValueRead requests for all `*state_address` of a device.
### Register Event
The `knx.event_register` service can be used to register (or unregister) group addresses to fire `knx_event` Events. Events for group addresses matching the `event_filter` attribute in `configuration.yaml` can not be unregistered. See [knx_event](#events)
{% configuration %}
address:
description: Group address that shall be added or removed.
required: true
type: string
remove:
description: If `True` the group address will be removed.
required: false
type: boolean
default: false
{% endconfiguration %}
## Exposing entity states, entity attributes or time to KNX bus ## Exposing entity states, entity attributes or time to KNX bus
KNX integration is able to expose entity states or attributes to KNX bus. The integration will broadcast any change of the exposed value to the KNX bus and answer read requests to the specified group address. It is also possible to expose the current time. KNX integration is able to expose entity states or attributes to KNX bus. The integration will broadcast any change of the exposed value to the KNX bus and answer read requests to the specified group address. It is also possible to expose the current time.
@ -238,6 +252,10 @@ knx:
``` ```
{% configuration %} {% configuration %}
address:
description: Group address state or attribute updates will be sent to. GroupValueRead requests will be answered.
type: string
required: true
type: type:
description: Type of the exposed value. Either 'binary', 'time', 'date', 'datetime' or any supported type of [KNX Sensor](#sensor) (e.g., "temperature" or "humidity"). description: Type of the exposed value. Either 'binary', 'time', 'date', 'datetime' or any supported type of [KNX Sensor](#sensor) (e.g., "temperature" or "humidity").
type: string type: string
@ -258,10 +276,6 @@ default:
type: [boolean, string, integer, float] type: [boolean, string, integer, float]
default: None default: None
required: false required: false
address:
description: KNX group address.
type: string
required: true
{% endconfiguration %} {% endconfiguration %}
## Binary Sensor ## Binary Sensor