Repository navigation
|
Firstly thanks for providing these awesome extensions to HA - one of the things it is very useful for is making automations more terse and readable. With this in mind I have a number of different classes of devices that are not always powered on - Sonos Roam speakers, smart plugs etc. so I often find myself writing the following condition to check to see if the thing is available (basically any other state that isn't unavailable or unknown): condition: not
conditions:
- condition: state
entity_id: media_player.bathroom
state:
- unavailable
- unknownA handy condition to wrap this up would be useful (to me!). Cheers. |
Replies: 2 comments 2 replies
|
You don't need Spook for this, core already has conditions:
- "{{ has_value('media_player.bathroom') }}"That's the shorthand template condition, same as |
|
Good one, thanks @nevvob! 👻 This is now in: condition: spook.is_available
target:
entity_id: media_player.bathroomIt takes devices, areas, floors and labels too, with ../Frenck Blogging my personal ramblings at frenck.dev |
Good one, thanks @nevvob! 👻
This is now in:
spook.is_available, added in #1868. It passes for anything butunavailableorunknown, so your example becomes:It takes devices, areas, floors and labels too, with
behavior: allwhen every one of them has to be there. It ships with the next release.../Frenck
Blogging my personal ramblings at frenck.dev