Skip to content

Commit 2c2ebba

Browse files
thecodefrenck
andauthored
Update off and unavailable in standby state (#2728)
Co-authored-by: Franck Nijhof <[email protected]>
1 parent 612d557 commit 2c2ebba

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

docs/core/entity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ To avoid calculations in a property method, set the corresponding [entity class
7373
| ------------------------ | ------------------------------| ------- | -----------
7474
| assumed_state | `bool` | `False` | Return `True` if the state is based on our assumption instead of reading it from the device.
7575
| attribution | <code>str &#124; None</code> | `None` | The branding text required by the API provider.
76-
| available | `bool` | `True` | Indicate if Home Assistant is able to read the state and control the underlying device.
76+
| available | `bool` | `True` | Indicate if Home Assistant is able to read the state or control the underlying device, see [entity-unavailable](/docs/core/integration-quality-scale/rules/entity-unavailable.md) for more details.
7777
| device_class | <code>str &#124; None</code> | `None` | Extra classification of what the device is. Each domain specifies their own. Device classes can come with extra requirements for unit of measurement and supported features.
7878
| entity_picture | <code>str &#124; None</code> | `None` | Url of a picture to show for the entity.
7979
| extra_state_attributes | <code>dict &#124; None</code> | `None` | Extra information to store in the state machine. It needs to be information that further explains the state, it should not be static information like firmware version.

docs/core/entity/media-player.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ The state of a media player is defined by using values in the `MediaPlayerState`
9292
| `PAUSED` | Entity has an active media and is currently paused |
9393
| `BUFFERING` | Entity is preparing to start playback of some media |
9494

95+
:::note
96+
97+
It is common that media players can't be controlled when in a standby state. If Home Assistant can turn on the device using another protocol or method, it should be shown as `off` even if the main channel used to control the device is currently unavailable. If Home Assistant has no way to turn on the device, it should be shown as `unavailable`. See [entity-unavailable Exceptions](/docs/core/integration-quality-scale/rules/entity-unavailable.md#Exceptions) for more details.
98+
99+
:::
100+
95101
## Methods
96102

97103
### Play media

docs/core/integration-quality-scale/rules/entity-unavailable.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ For more information about managing integration state, see the [documentation](/
8181

8282
## Exceptions
8383

84-
There are no exceptions to this rule.
84+
If an integration can turn on a device, either via a user-defined automation trigger or by automatically creating a secondary control channel (e.g., using Wake-on-LAN or infrared blaster), then the device should be reported as `off` when it is in standby and unresponsive to the main channel (e.g., TCP). If no such method exists, and the device cannot be controlled in its current state, it should be reported as `unavailable`.
85+
86+
An example scenario, for a media player that enters standby mode and can only be turned on using an external device (e.g., an IR blaster):
87+
88+
- When first added to Home Assistant, and there's no active connection, the device will be shown as `unavailable`.
89+
- If the user configures an automation (e.g., using an IR blaster) to turn it on, the device will be shown as `off` while in standby.
90+
- Once turned on via the external method, and the main connection is established, the state will update to `on`.
8591

8692
## Related rules
8793

0 commit comments

Comments
 (0)