Skip to content

Possible extension to hide_unavailable? #218

Closed
@krisnoble

Description

@krisnoble

Hi, I've been thinking it would be useful to have some more options along the lines of hide_unavailable and think I've come up with a flexible solution although I've no experience in this kind of thing so just hoping it triggers some ideas.

Initially I was just going to propose hide_off: true/false to hide binary sensors where the state is equivalent to off. Then I got thinking it would be cool to be able to set thresholds for any sensor, and then I realised that "unavailable" is also a state so you could have a structure like this:

hide_if:
  attribute: < optional attribute name, default to the main state >
  value: < exact state/attribute value e.g. "off", "0", "on", "unavailable" > 
  above: < upper threshold for state/attr >
  below: < lower threshold for state/attr >

I guess you could combine any given value/above/below combination as ORs although not sure how actually useful that would be.

It does lengthen the current hide_unavailable implementation somewhat but I think that seems a fair price for the added functionality, and maybe hide_unavailable could be kept in for a while to ease the transition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions