appdaemon icon indicating copy to clipboard operation
appdaemon copied to clipboard

constrain_presence and person=true

Open andyinno opened this issue 5 years ago • 5 comments

Please forgive me if I am wrong, with appdaemon4 I saw that the person=true parameter was added to the constraints for the callbacks.

I would like to use it from the configuration file in order to completely disable an app to run.

Is it possible? There are some arguments that I need to apply like the person=true in the callback constraint? In that case, how can I apply it?

thank you in advance Andrea

andyinno avatar Jul 05 '20 16:07 andyinno

with appdaemon4 I saw that the person=true parameter was added to the constraints for the callbacks.

i think you mix things up. because constraints are parameters and they dont have parameters. so i wonder where you saw that.

i think what you are looking for are the normal constraints: https://appdaemon.readthedocs.io/en/latest/APPGUIDE.html#callback-constraints

those can be in the yaml or in the listener or schedular function.

and if those are not good enough there is the option to create custom constraints: https://appdaemon.readthedocs.io/en/latest/APPGUIDE.html#custom-constraints

ReneTode avatar Jul 05 '20 19:07 ReneTode

Hi, thank you for your reply...

My question is related to the callback constraints as you referred in the first link.

And in detail to this: https://appdaemon.readthedocs.io/en/latest/APPGUIDE.html#presence

I read this issue #980 where a new infrastructure that is able to use the Person from Home Assistant was introduced and for being able to use the methods self.noone_home(): and friends you have to pass a param to the method "self.noone_home(person=True)" like this.

So my question is basically related to:

  • there is a way for use noone_home and friends with Person Home Assistant entities
  • is there a way for use the same logic also for the constraints defined in yaml?
  • is yaml code only intended to be used with tracked devices?

thank you again Andrea

andyinno avatar Jul 06 '20 16:07 andyinno

Hi there - so far the "person=True" function only works on the api calls such as anyone_home() - we will add support for callback and app level constraints in a future release.

acockburn avatar Jul 06 '20 18:07 acockburn

the noone_home() and friends functions are not related to constraints. so there is no perso=True option for that.

there need to be new seperate constraints for person.

but Andrew just said that it will be added.

ReneTode avatar Jul 06 '20 18:07 ReneTode

Thank you both for the kind reply.

All clear.

andyinno avatar Jul 06 '20 19:07 andyinno