Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95284

Trigger adb command when Harmony Activity runs

$
0
0

@Ricardo_Franco wrote:

Hey guys ,

Trying to setup an automation for Harmony and my AndroidTV Box (Mibox 3) that works following way :

  1. Start an Harmony Activity
  2. Launch an App on my Android TV after that activity starts

So far I have the following code :

- alias: "Netflix Mode"
  trigger:
    platform: state
    entity_id: remote.living_room~
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "Watch Netflix" }}'
  action:
    service: androidtv.adb_command
    data:
      entity_id: media_player.mibox3_android_tv
      command: am start -n com.netflix.ninja/.MainActivity

However, I want it to work so that even if my Netflix activity is already active it will still execute the adb action .

Possible scenarios :

  • Current activity is poweroff or any other activity and it starts netflix activity
  • Current activity is already netflix activity but it will still run the action when I try to run netflix activity on harmony hub .

Just started messing around with Homeassistant / Hassio a couple of days ago so not really sure how to tackle this , what kind of aditional conditions do I need to add in order to achieve my goal ?

Edit : Just realized there is a huge delay before the netflix app is actually launched ! When I call the service directly through Hassio it launches the app instantly, but with this automation it takes a good 15 to 20seconds before netflix is opened ! Any clues ?

Thanks !

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95284

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>