Advertisement
VikingOy

Media selector Script

Apr 29th, 2021
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. media_pause:
  2. alias: Media Pause
  3. sequence:
  4. - data:
  5. command: Pause
  6. entity_id: remote.harmony
  7. data_template:
  8. device: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  9. \ %}\n Get GB2\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  10. \ 'Apple-TV') %}\n Apple TV\n{% else %}\n Windows Computer\n{% endif %}\n"
  11. service: remote.send_command
  12. media_play:
  13. alias: Media Play
  14. sequence:
  15. - data:
  16. command: Play
  17. entity_id: remote.harmony
  18. data_template:
  19. device: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  20. \ %}\n Get GB2\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  21. \ 'Apple-TV') %}\n Apple TV\n{% else %}\n Windows Computer\n{% endif %}\n"
  22. service: remote.send_command
  23. media_rewind:
  24. alias: Media Rewind
  25. sequence:
  26. - data:
  27. entity_id: remote.harmony
  28. data_template:
  29. device: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  30. \ %}\n Get GB2\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  31. \ 'Apple-TV') %}\n Apple TV\n{% else %}\n Windows Computer\n{% endif %}\n"
  32. command: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  33. \ %}\n Rewind\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  34. \ 'Apple-TV') %}\n Rewind\n{% else %}\n SkipBack\n{% endif %}\n"
  35. service: remote.send_command
  36. media_forward:
  37. alias: Media Forward
  38. sequence:
  39. - data:
  40. entity_id: remote.harmony
  41. data_template:
  42. device: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  43. \ %}\n Get GB2\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  44. \ 'Apple-TV') %}\n Apple TV\n{% else %}\n Windows Computer\n{% endif %}\n"
  45. command: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  46. \ %}\n FastForward\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  47. \ 'Apple-TV') %}\n FastForward\n{% else %}\n SkipForward\n{% endif %}\n"
  48. service: remote.send_command
  49. media_stop:
  50. alias: Media Stop
  51. sequence:
  52. - data:
  53. command: Stop
  54. entity_id: remote.harmony
  55. data_template:
  56. device: "{% if is_state_attr('remote.harmony', 'current_activity', 'Get-TV')\
  57. \ %}\n Get GB2\n{% elif is_state_attr('remote.harmony', 'current_activity',\
  58. \ 'Apple-TV') %}\n Apple TV\n{% else %}\n Windows Computer\n{% endif %}\n"
  59. service: remote.send_command
  60.  
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement