I’m a bit confused how to read values from osmc via the integration. In other words, I want to know if the osmc device is playing some media, or has stopped or paused the media (if it was playing).
Is there some way to do this? All the docs point to controlling osmc. I’m looking for triggering lighting automations based on what osmc is doing.
Awesome info and thanks for sharing your automation scripts. As you were probably composing that, I did finally use the dev tools to check the state of the player, and for me it’s a little different (entity_id):
Here’s my evening lighting on (30 mins. before sunset) script so far:
alias: 'Daily timed events: Evening lighting on'
description: A little before sunset, turn some lights on
trigger:
- platform: sun
event: sunset
offset: '-30'
condition: []
action:
- scene: scene.kitchen_cabinets_normal
- scene: scene.dennis_office_back_hallway_lamp_purple
- condition: state
entity_id: media_player.kodi_9f7b06e0e40ef9b873f50
state: idle
- service: automation.trigger
target:
entity_id: automation.family_room_tv_lights_on_daily_color
mode: single
The idea is that if the TV is playing something, don’t turn on the lights next to the tv. Otherwise, turn on the lights next to the TV if osmc is idle.