How to set user presence with two buttons?

Hi,

I’m new to the forum, so a “Hello” to all of you! :smiley:
We want to use one button of a Shelly i4 to set the presence state of the user “Gast”
to “home” and another button for “not_home”.

How can I configure that configuration in Homeassistant?

Thanx for any hint! :smiley:

There is no such a thing as a “user presence”.
Assume there are 3 “person” entities created in HA - “john”, “jane”, “kid”.
And there are 2 users “john smith” & “jane smith”, and only “john smith” user is associated with a corr. “person.john” entity.
Next, only “person.jane” has associated “device_tracker” entities - so only for this person a location tracking is available; and a location of “person.jane” is defined by some “device_tracker.jane_life360” (i.e. this “device_tracker” entity is created by Life360 integration).

And in general we are not supposed to “move” some particular “device_tracker” entity (hence - a probably associated “person” entity; hence - a probably associated user) to some place (home, north pole etc) manually. This “movement” is set by a location tracking integration (like Life360) which manage corr. “device_tracker” entity.
In fact - there is a way to move a “device_tracker” entity to some coordinates manually by calling a “device_tracker.see” service.

What you probably DO need is not "setting “a user home or not_home”.
You probably need to call some script (or activate a scene, or smth else) by pressing some button & activating some physical device.

Hi Ildar,
thank you for your answer. :smile:
“Gast” is german for “guest”. Guests do not have location devices.
In case our family leaves home a guest remaining at home literally sits in the dark.
So we’re looking for a dual button solution to tell Homeassistant someone is still at home when the regular occupants have left. :wink:

This may be solved by a “presence detection” device (or “movement detection”).
If it says “someone is home” and all “person” device_trackers are “Away” → a guest is at home.
But - these kind of devices should be also used for security purpose. Then you need to have a “master switch” for “security mode is ON”: if it is ON → then this “someone” is not a “guest”, it’s an “intruder”.