Fix direct state attribute access in HomeMatic example (#17283)

This commit is contained in:
Franck Nijhof 2021-04-06 11:21:55 +02:00 committed by GitHub
parent ce3629dd3b
commit 113e3bf5de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,8 @@ If you want to see if a specific device you have is supported, head over to the
We automatically detect all devices we currently support and try to generate useful names. If you enable name-resolving, we try to fetch names from Metadata (Homegear), via JSON-RPC or the XML-API you may have installed on your CCU. Since this may fail this is disabled by default. We automatically detect all devices we currently support and try to generate useful names. If you enable name-resolving, we try to fetch names from Metadata (Homegear), via JSON-RPC or the XML-API you may have installed on your CCU. Since this may fail this is disabled by default.
You can manually rename the created entities by using Home Assistant's [Customizing](/docs/configuration/customizing-devices/) feature. The Homematic integration is also supported by the [Entity Registry](https://developers.home-assistant.io/docs/en/entity_registry_index.html), which allows you to change the friendly name and the entity ID directly in the Home Assistant UI. You can manually rename the created entities by using Home Assistant's [Customizing](/docs/configuration/customizing-devices/) feature. The Homematic integration is also supported by the [Entity Registry](https://developers.home-assistant.io/docs/en/entity_registry_index.html), which allows you to change the friendly name and the entity ID directly in the Home Assistant UI.
## Configuration
To set up the component, add the following information to your `configuration.yaml` file: To set up the component, add the following information to your `configuration.yaml` file:
```yaml ```yaml
@ -159,38 +161,38 @@ password:
type: string type: string
{% endconfiguration %} {% endconfiguration %}
#### Example configuration with multiple protocols and some other options set: ### Example configuration with multiple protocols and some other options set
```yaml ```yaml
homematic: homematic:
interfaces: interfaces:
rf: rf:
host: 127.0.0.1 host: 127.0.0.1
resolvenames: json resolvenames: "json"
username: Admin username: "Admin"
password: secret password: "secret"
wired: wired:
host: 127.0.0.1 host: 127.0.0.1
port: 2000 port: 2000
resolvenames: json resolvenames: "json"
username: Admin username: "Admin"
password: secret password: "secret"
ip: ip:
host: 127.0.0.1 host: 127.0.0.1
port: 2010 port: 2010
groups: groups:
host: 127.0.0.1 host: 127.0.0.1
port: 9292 port: 9292
resolvenames: json resolvenames: "json"
username: Admin username: "Admin"
password: secret password: "secret"
path: /groups path: /groups
hosts: hosts:
ccu2: ccu2:
host: 127.0.0.1 host: 127.0.0.1
port: 2001 port: 2001
username: Admin username: "Admin"
password: secret password: "secret"
``` ```
@ -214,7 +216,6 @@ This does *not* affect the entities in Home Assistant. They all use their own co
Most devices have, besides their state, additional attributes like their battery state or valve position. These can be accessed using templates in automations, or even as their own entities using the [template sensor](/integrations/template) component. Here's an example of a template sensor that exposes the valve position of a thermostat. Most devices have, besides their state, additional attributes like their battery state or valve position. These can be accessed using templates in automations, or even as their own entities using the [template sensor](/integrations/template) component. Here's an example of a template sensor that exposes the valve position of a thermostat.
{% raw %} {% raw %}
```yaml ```yaml
@ -239,8 +240,8 @@ The values of variables are polled from the CCU/Homegear in an interval of 30 se
When Homematic devices change their state or some other internal value, the CCU/Homegear sends event messages to Home Assistant. These events are automatically parsed and the entities in Home Assistant are updated. However, you can also manually use these events to trigger automations. Two event-types are available: When Homematic devices change their state or some other internal value, the CCU/Homegear sends event messages to Home Assistant. These events are automatically parsed and the entities in Home Assistant are updated. However, you can also manually use these events to trigger automations. Two event-types are available:
- **homematic.keypress**: For devices with buttons, see information below - `homematic.keypress`: For devices with buttons, see information below
- **homematic.impulse**: For impulse sensors - `homematic.impulse`: For impulse sensors
#### Devices with buttons #### Devices with buttons
@ -256,7 +257,7 @@ automation:
platform: event platform: event
event_type: homematic.keypress event_type: homematic.keypress
event_data: event_data:
name: Kitchen Switch name: "Kitchen Switch"
channel: 1 channel: 1
param: PRESS_SHORT param: PRESS_SHORT
action: action:
@ -309,7 +310,7 @@ Simulate a button being pressed:
action: action:
service: homematic.virtualkey service: homematic.virtualkey
data: data:
address: BidCoS-RF address: "BidCoS-RF"
channel: 1 channel: 1
param: PRESS_LONG param: PRESS_LONG
``` ```
@ -321,7 +322,7 @@ Open KeyMatic:
action: action:
service: homematic.virtualkey service: homematic.virtualkey
data: data:
address: LEQ1234567 address: "LEQ1234567"
channel: 1 channel: 1
param: OPEN param: OPEN
``` ```
@ -335,7 +336,7 @@ action:
target: target:
entity_id: homematic.ccu2 entity_id: homematic.ccu2
data: data:
name: Variablename name: "Variablename"
value: true value: true
``` ```
@ -351,7 +352,7 @@ Manually turn on a switch actor:
action: action:
service: homematic.set_device_value service: homematic.set_device_value
data: data:
address: LEQ1234567 address: "LEQ1234567"
channel: 1 channel: 1
param: STATE param: STATE
value: true value: true
@ -364,7 +365,7 @@ Manually set temperature on thermostat:
action: action:
service: homematic.set_device_value service: homematic.set_device_value
data: data:
address: LEQ1234567 address: "LEQ1234567"
channel: 4 channel: 4
param: SET_TEMPERATURE param: SET_TEMPERATURE
value: 23.0 value: 23.0
@ -377,7 +378,7 @@ Manually set the active profile on thermostat:
action: action:
service: homematic.set_device_value service: homematic.set_device_value
data: data:
address: LEQ1234567 address: "LEQ1234567"
channel: 1 channel: 1
param: ACTIVE_PROFILE param: ACTIVE_PROFILE
value: 1 value: 1
@ -392,7 +393,7 @@ action:
service: homematic.put_paramset service: homematic.put_paramset
data: data:
interface: wireless interface: wireless
address: LEQ1234567 address: "LEQ1234567"
paramset_key: MASTER paramset_key: MASTER
paramset: paramset:
WEEK_PROGRAM_POINTER: 1 WEEK_PROGRAM_POINTER: 1
@ -406,7 +407,7 @@ action:
service: homematic.put_paramset service: homematic.put_paramset
data: data:
interface: wireless interface: wireless
address: LEQ1234567 address: "LEQ1234567"
paramset_key: MASTER paramset_key: MASTER
rx_mode: WAKEUP rx_mode: WAKEUP
paramset: paramset:
@ -457,7 +458,7 @@ binary_sensor:
- sensor.office_voltage - sensor.office_voltage
- sensor.time - sensor.time
value_template: >- value_template: >-
{{as_timestamp(now()) - as_timestamp(states.sensor.office_voltage.last_changed) < 600}} {{ as_timestamp(now()) - as_timestamp(state_attr('sensor.office_voltage', 'last_changed')) < 600 }}
automation: automation:
- alias: "Homematic Reconnect" - alias: "Homematic Reconnect"
@ -528,7 +529,7 @@ To use this notification platform in your installation, add the following to you
notify: notify:
- name: my_hm - name: my_hm
platform: homematic platform: homematic
address: NEQXXXXXXX address: "NEQXXXXXXX"
channel: 2 channel: 2
param: "SUBMIT" param: "SUBMIT"
value: "1,1,108000,8" value: "1,1,108000,8"