IATkachenko / HA-SleepAsAndroid

Sleep As Android integration for Home Assistant
Apache License 2.0
165 stars 25 forks source link

Update Blueprint To Allow Utilizing New Sensor Attributes. #32

Closed MikeKMiller closed 2 years ago

MikeKMiller commented 2 years ago

General information

Could I request an update to the Blueprint to allow entering a value for the the new attributes from Issue 30

(specifically the Label attribute) When using the Blueprint to create an automation, to create a Condition based on the Label. For example, only run if the Label matches, or Run Except if the Label Matches.

IATkachenko commented 2 years ago

@MikeKMiller, hello.

How should we use attributes in blueprint? In condition part (like person state) or somewhere else?

Generally you may use "choose" action for trigger and do different actions based on attribute

MikeKMiller commented 2 years ago

Yes I would suggest using it like the person state, as a Condition.

IATkachenko commented 2 years ago

It will not work in way like you expect: condition applied to all triggers, but not all triggers have attribute value and it will have attributes "unknown". So if you have automatization that require label == foo, then only action with defined label will be usable, because all others will have label unknown.

But it is possible to create second blueprint for triggers that have label attribute. It seems that we should work in this way.

MikeKMiller commented 2 years ago

Ok, I am completely open to what you think will work best.

IATkachenko commented 2 years ago

Blueprint is available in dev branch. Is it look like you need?

MikeKMiller commented 2 years ago

yes thank you!!

IATkachenko commented 2 years ago

Welcome! Will merge to master soon.

IATkachenko commented 2 years ago

Merged.