You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_components/mqtt_statestream.markdown
+57-1Lines changed: 57 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,12 @@ Configuration variables:
32
32
Default is false.
33
33
- **publish_timestamps** (*Optional*): Publish the last_changed and last_updated timestamps for the entity.
34
34
Default is false.
35
+
- **exclude** (*Optional*): Configure which components should be excluded from recordings. See *Include/Exclude* section below for details.
36
+
- **entities** (*Optional*): The list of entity ids to be excluded from recordings.
37
+
- **domains** (*Optional*): The list of domains to be excluded from recordings.
38
+
- **include** (*Optional*): Configure which components should be included in recordings. If set, all other entities will not be recorded.
39
+
- **entities** (*Optional*): The list of entity ids to be included from recordings.
40
+
- **domains** (*Optional*): The list of domains to be included from recordings.
35
41
36
42
## Operation
37
43
@@ -44,6 +50,56 @@ For example, with the example configuration above, if an entity called 'light.ma
44
50
45
51
If that entity also has an attribute called `brightness`, the component will also publish the value of that attribute to `homeassistant/light/master_bedroom_dimmer/brightness`.
46
52
47
-
All states and attributes are passed through JSON serialization before publishing. **Please note** that this causes strings to be quoted (e.g., the string 'on' will be published as '"on"'). You can access the JSON deserialized values (as well as unquoted strings) at many places by using `value_json` instead of `value`.
53
+
All states and attributes are passed through JSON serialization before publishing. **Please note** that this causes strings to be quoted (e.g., the string 'on' will be published as '"on"'). You can access the JSON deserialized values (as well as unquoted strings) at many places by using `value_json` instead of `value`.
48
54
49
55
The last_updated and last_changed values for the entity will be published to `homeassistant/light/master_bedroom_dimmer/last_updated` and `homeassistant/light/master_bedroom_dimmer/last_changed`, respectively. The timestamps are in ISO 8601 format - for example, `2017-10-01T23:20:30.920969+00:00`.
56
+
57
+
## Include/exclude
58
+
59
+
The **exclude** and **include** configuration variables can be used to filter the items that are published to MQTT.
60
+
61
+
1\. If neither **exclude** or **include** are specified, all entities are published.
62
+
63
+
2\. If only **exclude** is specified, then all entities except the ones listed are published.
64
+
65
+
```yaml
66
+
# Example of excluding entities
67
+
mqtt_statestream:
68
+
base_topic: homeassistant
69
+
exclude:
70
+
domains:
71
+
- switch
72
+
entities:
73
+
- sensor.nopublish
74
+
```
75
+
In the above example, all entities except for *switch.x* and *sensor.nopublish* will be published to MQTT.
76
+
77
+
3\. If only **include** is specified, then only the specified entries are published.
78
+
79
+
```yaml
80
+
# Example of excluding entities
81
+
mqtt_statestream:
82
+
base_topic: homeassistant
83
+
include:
84
+
domains:
85
+
- sensor
86
+
entities:
87
+
- lock.important
88
+
```
89
+
In this example, only *sensor.x* and *lock.important* will be published.
90
+
91
+
4\. If both **include** and **exclude** are specified then all entities specified by **include** are published except for the ones
92
+
specified by **exclude**.
93
+
94
+
```yaml
95
+
# Example of excluding entities
96
+
mqtt_statestream:
97
+
base_topic: homeassistant
98
+
include:
99
+
domains:
100
+
- sensor
101
+
exclude:
102
+
entities:
103
+
- sensor.noshow
104
+
```
105
+
In this example, all sensors except for *sensor.noshow* will be published.
0 commit comments