Trigger lights with Roku app status

Moderator: leecollings

Post Reply
User avatar
EdddieN
Posts: 510
Joined: Wednesday 16 November 2016 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Scotland
Contact:

Trigger lights with Roku app status

Post by EdddieN »

Hello there,

I have seen a plugin for Roku, however it makes my Domoticz installation to slow to a halt (too many things going on). So I'm looking a simple channel status within Roku to trigger ambient lights. For example following this: https://sdkdocs.roku.com/display/sdkdoc ... active-app

I can do a simple query like this: http://Roku_IP:8060/query/active-app which would return this XML:

Code: Select all

<active-app>
<app id="12" subtype="ndka" type="appl" version="5.0.90479013">Netflix</app>
</active-app>
which means Netflix is active. When this happens, I would like to trigger the lights event. Here are my 2 questions:

1.- How do I read the "app id" value? I just about managed to do something similar in JSON but not in XML.
2.- I need to poll the status only during certain time of the day and if the TV switch is ON. Ideally I would use Blockly for all this so I can avoid polling the Roku stick every minute unnecessarily if the other conditions are not happening.

I know point 2 can be done in LUA too, but I would rather not as I just about cope to do with extremely simple things.

Any advice would be great!
11101101 - www.machinon.com
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest