Home Assistant - Set the smartphone's ring mode if you are somewhere

Home Assistant - Set the smartphone's ring mode if you are somewhere

Hi guys,

Today I want to introduce a useful automation to change the ring mode of your smartphone based on your current position.

Use case

You arrived at the office. To avoid disturbing your colleagues, you want your smartphone's ringer mode is automatically set to vibrate mode.

Software configuration

  1. Home Assistant. I'm currently running version?2022.8.0
  2. Mobile App integration?configured in Home Assistant. This integration allows Home Assistant mobile apps (Android / IOS) to integrate with your Home Assistant environment.
  3. The person integration has to be configured as well. It allows connecting?a device_tracker entity defined by the Mobile App integration, to one or more person entities.
  4. The Office zone, based on coordinates (latitude / longitude), has to be defined. During zone definition, you can also set the radius of the zone (in meters).

Home Assistant code (yaml)

This is the piece of code you have to write down as automation:

alias: Smartphone - Set the vibrate mode if I'm at the office
description: Smartphone - Set the vibrate mode if I'm at the office for at least 30 seconds
trigger:
? - platform: state
? ? entity_id: person.A
? ? from: not_home
? ? to: Office
? ? for: "00:00:30"
condition: []
action:
? - service: notify.mobile_app_[yoursmartphone]
? ? data:
? ? ? message: command_ringer_mode
? ? ? title: vibrate
mode: single

        

Some specifics about the code above

  1. The automation trigger is based on the state of the person.A. When the person.A enters the Office zone for at least 30 seconds, the action to change the ringer mode of the smartphone is executed. To do this a notification command is used to trigger certain actions on your phone.

I do hope you have enjoyed this article. I'm available for any feedback so, feel free to contact me or share your thoughts in the comments section below!

Thank you for reading.

--------------------------------------------------------------------------------------------------------

Other recent articles about Home Assistant:

Home Assistant - Stop streaming on Google Home speakers when not home

Home Assistant - Create a button to do something

Home Assistant - Know the distance between two people

Home Assistant - Get notified when ISS is above your home

Home Assistant - Getting the position?of ISS

Home Assistant - Getting the distance between people and zones

Home Assistant - Automation: Stop chromcast streaming if TV has turned OFF

Home Assistant - Sensor: Getting the operational state of a household appliance

Home Assistant - Automation: Power up your TV / DVD based on Chromcast

要查看或添加评论,请登录

Emiliano Guerzoni的更多文章

社区洞察

其他会员也浏览了