Home Assistant - How to automatically re-enable bluetooth on your smartphone after it has been disabled
Emiliano Guerzoni
Project Manager / Technical Manager renewables/energy efficiency projects | Demand Manager digital energy domain at algoWatt
Hello guys,
In this article we saw how to disable automatically the bluetooth of the smartphone if your smartwatch gets disconnected at least for 1 minute.
But how to automatically re-enable it ? Below a possible solution.
Scenario
You want the bluetooth is automatically turned ON as soon as you are interacting with your smartphone.
Software configuration
Home Assistant code (yaml) / procedure
This is the piece of code you have to write as Automation:
领英推荐
alias: Smartphone - Turn ON bluetooth if smartphone interactive sensor goes ON
description: Turn ON bluetooth (if disable) as soon as smartphone's interactive sensor goes ON
trigger:
? - platform: state
? ? entity_id:
? ? ? - binary_sensor.yoursmartphone_interactive
? ? from: "off"
? ? to: "on"
condition: []
action:
? - if:
? ? ? - condition: state
? ? ? ? entity_id: binary_sensor.yoursmartphone_bluetooth_state
? ? ? ? state: "off"
? ? then:
? ? ? - service: notify.mobile_app_yoursmartphone
? ? ? ? data:
? ? ? ? ? message: command_bluetooth
? ? ? ? ? data:
? ? ? ? ? ? command: turn_on
mode: single
Some specifics about the code above
As already said before, this is just a possible solution to get the bluetooth automatically enabled.
Thanks to the great flexibility of Home Assistant it's possible to thinking about different ways to get?the same result based on your needs and habits.
Thank you for reading. ?? I 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!
Meanwhile,?if you liked this article share it or?subscribe?to my newsletter?about?Home Assistant?to read previous episodes and still up to date on latest news.