Closed FezVrasta closed 5 years ago
Right now I use this API inside a command_line
control in Home Assistant to scan for its state each 10 seconds, so that I can run automations when the TV is on or off. I doubt it's very efficient, it'd be great to find a way to retrieve the power state in a different way.
Here how I use it right now:
- platform: command_line
name: Philips 65OLED873/12 state
scan_interval: 10
command: "curl -X GET -s --digest --insecure -u xxxx:xxxx https://x.x.x.x:1926/6/powerstate"
value_template: >
{% if value_json.powerstate == 'On' %}
on
{% else %}
off
{% endif %}
Thank you for the PR!
Regarding querying the TV state I have some plans to integrate MQTT for this purposes, we'll see how it goes...
The api returns a JSON object containing the
powerstate
key that can beOn
orOff