Closed parautenbach closed 2 years ago
template documentation template source (message by IssueLinks)
Hey there @phracturedblue, @tetienne, @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (template
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
Bump
Don't bump stuff.
(Reopened so it's clear the linked PR fixes this issue)
Don't bump stuff.
Understood. This was the reason I did: https://community.home-assistant.io/t/issues-closed-without-any-action-from-devs/396238/51.
(Reopened so it's clear the linked PR fixes this issue)
Thank you. Really happy to see this fix/improvement.
Should I close the issue now – or what is the process?
The problem
I believe this is an edge case not catered for with the introduction (standardisation) of allowing unknown states for binary sensors.
I want to be clear that this isn't an objection against the use of the unknown state – only that there is an edge case where it doesn't actually make sense (to me).
When using template binary sensor triggered by an event, the sensor will have an unknown state (e.g. after an HA restart) until triggered for the first time. At this point, it may still make sense to allow an unknown state, but once the
auto_off
option gets specified, it indirectly implies a sensor that's normally off (by default) and sometimes on (when triggered). Considering this, it would be impossible for the sensor to have any other state.It would not be an option to perform any kind of artificial triggering, since it may lead to undesired consequences.
Perhaps one option is to introduce an
initial_state
option to make this explicit (rather than inferring a default state fromauto_off
).There doesn't seem to be any workarounds.
What version of Home Assistant Core has the issue?
core-2022.2.9
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
template
Link to integration documentation on our website
https://www.home-assistant.io/integrations/template/
Diagnostics information
No response
Example YAML snippet