Replies: 5 comments 7 replies
-
I think that we should aim for the correct solution. |
Beta Was this translation helpful? Give feedback.
-
I think the proposed solution isn't correct. A binary sensor is a read-only entity and in that was not similar to what switch_as_x resolved, as the entity only provides information. A cover is a read/write entity that can be interacted with. |
Beta Was this translation helpful? Give feedback.
-
There is an analogous issue with Climate/Temperature sensors. Only |
Beta Was this translation helpful? Give feedback.
-
Do we have any decision on how these problems should be solved? |
Beta Was this translation helpful? Give feedback.
-
I have similar Problems currently. In my opinion another not technically solution would be to make things like windows, doors, temperature sensors and heating valve (maybe others as well) explicit configurable in the frontend for each area. Like it's already done for temp and humid sensor. I know this will not solve all problems but it could be an 'easy' way which every user of HA understand? |
Beta Was this translation helpful? Give feedback.
-
Problem
Asking Assist "how many windows are open?" or "which doors are closed?" will only count/list the doors and windows that are defined as
cover
s (with the respectivedevice_class
, of course). If a user hasbinary_sensor
doors and windows (i.e. just for reporting status, not for actuating them), then they will simply be ignored.Asking "is [door entity name] open?" will work, because
binary_sensor
s can be queried by name.Cause
The architecture of hassil and the default conversation agent permit referencing a single entity "filter" in a sentence. That filter can have a
domain
, adevice_class
, anarea
, aname
or a combination thereof, but it does not allow for multiple such filters.As such, all sentences have been defined per domain and, as a result, there's no current way of querying both
device_class: door
cover
s anddevice_class: door
binary_sensor
s to answer a question such ashow many doors are open?
. The current implementation only targetscover
entities.Solutions
The proper solution
The best ("most correct") way to handle this would be to allow multiple filters per entity referenced in a sentence (e.g. accept all entities which have either
{domain: cover, device_class: door}
or{domain: binary_sensor, device_class: door}
).However, this takes a lot of overhaul of the entire
conversation
logic, along withhassil
.The dirty solution
A current patch job would be to target questions about doors and windows towards the
binary_sensor
domain, which seems to be more prevalent than thecover
entities. However, that would be a breaking change in how Assist works (with no easy fix for users who do havecover
doors/windows). It would be just as bad as defaulting.It has been opened up here.
The compromise solution
If
binary_sensor
s withdevice_class: door
anddevice_class: window
could easily be converted tocover
entities, then this would be an easily fixable problem. For that to happen,cover
s must support not havingopen
andclose
services, as thebinary_sensor
representation of these covers only reports state and cannot be actuated programatically.Approach
Allowalready supportedcover
entities which don't have any actuation, such asopen
andclose
controls (services, interface etc.).binary_sensor_as_x
, similar toswitch_as_x
which allows abinary_sensor
to be converted to an entity pertaining to a different domain (initially,cover
, but maybe more in the future) from the web interface, without writing any YAML. New integration: Change device type of a binary sensor core#117423Beta Was this translation helpful? Give feedback.
All reactions