Facebook Tracking Pixel
Android TV

Turn the TV on when a guest enters their door code or walks in (Home Assistant)

Use Home Assistant to turn your BetterSTR TV on the moment a guest unlocks the door or a motion sensor sees them, instead of only at the check-in time.

Updated 5 min read

Your BetterSTR TV already turns itself on at the booking’s check-in time. If you would rather it came on at the moment your guest actually arrives, when they enter their door code or walk into the room, you can do that with Home Assistant. The TV shows up in Home Assistant with a Power switch, and any Home Assistant automation can flip it.

What is Home Assistant?

Home Assistant is free smart home software that you run on a small box at the property (a Home Assistant Green, a Raspberry Pi or similar). It connects to thousands of brands of smart locks, motion sensors, lights and heat pumps, and lets you build rules such as “when this happens, do that”. BetterSTR does not connect to your lock or sensor itself. Home Assistant is the piece in the middle: it notices the door code or the motion, and it tells the TV to turn on.

What you need

  • Home Assistant running at the property, on the same network as the TV.
  • Your smart lock or motion sensor already added to Home Assistant.
  • The TV on Premium (or in its free trial), running BetterSTR TV 1.0.204 or newer.
  • The TV connected to Home Assistant. Follow Option 1: Home Assistant in Smart Home on your TV: Home Assistant & Shelly first. It takes a few minutes.

Step 1: Check the Power switch works

  1. In Home Assistant, go to Settings → Devices & services → ESPHome and open your TV. Its name starts with betterstr-tv.
  2. Under Controls you will see Power, Volume and buttons for Home screen, Open guidebook and Back.
  3. Put the TV in standby with its remote, wait a couple of minutes, then switch Power on in Home Assistant. The TV should turn on and show the welcome screen.

Do this test before building anything. If the TV turns on, you are ready for step 2. If it doesn’t, see If the TV doesn’t turn on below.

Step 2: Create the automation

  1. In Home Assistant, go to Settings → Automations & scenes and click Create automation, then Create new automation.
  2. Under When, add a trigger:
    • Door code: choose Device, pick your lock, and choose Unlocked. Some lock brands also offer a trigger for a code being entered on the keypad, which is better if you have it, because it ignores someone unlocking from the inside.
    • Motion: choose Device, pick your motion sensor, and choose Started detecting motion.
  3. Under And if, add conditions so it only runs when it should (see the suggestions below).
  4. Under Then do, choose Device, pick your BetterSTR TV, and choose Turn on Power.
  5. Click Save and give it a name, for example Lounge TV on when the door is unlocked.

Conditions worth adding

  • Only when a guest is staying. The TV gives Home Assistant a Guest name sensor that holds the current guest’s name and is empty between stays. Use it so your cleaner doesn’t turn the TV on every time they open the door.
  • Only when the TV is off. Check that the TV’s Power switch is off, so the automation does nothing while the guest is already watching.
  • Only during the day and evening. A motion sensor will also see a guest walking to the kitchen at 2am. Add a time condition, for example between 7am and 10pm.
  • Only once per arrival. For motion, consider triggering only when the room has been still for a few hours first, or use the door code instead. Otherwise the TV turns back on every time the guest switches it off and walks past.

Example automation

If you prefer to paste YAML, open the automation’s menu (the three dots), choose Edit in YAML and use this as a starting point. Replace the entity names with your own: you will find them on each device’s page in Home Assistant.

alias: Lounge TV on when the guest unlocks the door
triggers:
  - trigger: state
    entity_id: lock.front_door
    to: unlocked
conditions:
  # a guest is staying (the sensor is empty between stays)
  - condition: template
    value_template: >-
      {{ states('sensor.betterstr_tv_guest_name')
         not in ['', 'unknown', 'unavailable', 'Premium only'] }}
  # the TV is not already on
  - condition: state
    entity_id: switch.betterstr_tv_power
    state: "off"
  # not in the middle of the night
  - condition: time
    after: "07:00:00"
    before: "22:00:00"
actions:
  - action: switch.turn_on
    target:
      entity_id: switch.betterstr_tv_power
mode: single

For motion, swap the trigger for your sensor:

triggers:
  - trigger: state
    entity_id: binary_sensor.lounge_motion
    to: "on"

What the guest sees

The TV turns on to its home screen with the guest’s welcome, exactly as it does at check-in. If you would like it to open the guidebook as well, add a second action that presses the TV’s Open guidebook button a few seconds after the Power switch.

Using this instead of turning on at check-in

The TV still turns on at the check-in time by default. If you only want it to come on when the guest arrives, edit the TV in your BetterSTR dashboard, open Power and switch off Auto power with bookings. Keep in mind that this also stops the TV going to standby at checkout, so you may want a second automation that turns Power off when the Guest name sensor becomes empty.

If the TV doesn’t turn on

  • The TV shows as unavailable in Home Assistant while it is off. Home Assistant can only reach the TV while the device has power and is on the network. A streaming stick powered from the TV’s own USB port loses power when the TV is off, so nothing can wake it. Plug it into a wall adapter instead.
  • The device wakes but the TV screen stays off. Turning the screen on relies on HDMI-CEC. Make sure CEC is enabled in the TV’s own settings (brands call it Anynet+, Bravia Sync, Simplink and so on). If your TV is a Roku, Samsung or LG on the same network, TV Network Control can power it on over the network as well.
  • Nothing happens at all. Open the automation in Home Assistant and look at Traces. It shows whether the trigger fired and which condition stopped it.
  • The TV isn’t listed in Home Assistant. Go back through the setup steps in Smart Home on your TV, including its troubleshooting section.

Related articles

More in Android TV

All Android TV articles →

Still need a hand?

Book a free 1-on-1 video call and we will go through it with you on screen, or send us a message.

Contact support