Roku plugin with a TCL Roku TV?

User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

RogueProeliator wrote: That isn't what you wanted to do... you need to call that function. Is this in an embedded action? If so, try this:
All I did was copy/past the code into an action to execute a python script. I did it with the code you just posted and interesting results....
Since the TV was dead asleep. (TV off, Network adapter off). I executed the WOL action and it woke up the TV and turned it on.

I turned off the TV (TV off, Network adapter on). I executed the WOL action just to see if that would cause the TV to turn back on and nothing happened. So I guess if the TV is totally asleep and it receives the WOL packet, it will also turn on. I guess since there is no bad things that happen from sending a WOL command, I can just embed that into the "Turn Roku TV On" action.
RogueProeliator wrote: Try pinging the television... maybe it will respond if it is On but time out if the adapter, and thus presumably the TV, is Off.
That is exactly what happens when you ping the TV. There is, however, a 5-10 minute delay until the adapter falls asleep. I'm using another plugin that does just that... it pings the TV which gives me the results of the network adapter. So it will report as On if the TV is off but the adapter is still active. For my immediate goal (status of the kid's TVs being on or off), that will work. To fine tune this or add functionality elsewhere, I was wondering if there was a way to poll a ROKU device to see what it is currently doing (on/off, idle/homescreen, playing ____ on netflix, etc.).

One of my solutions was to use an extra insteon siren in the kids room (just for the shock factor) to trigger on if the TV turns on after designated hours. The siren would then turn off once the TV is turned off. In this example, a more immediate "off" signal would be preferred over listening to the alarm for 10 minutes after the TV has been shut off.

If kid TVs only have PLEX access, then I think I can do it that way through the PLEX plugin to see what's playing on what device (I think.... I still have a way to go with my PLEX configuration after moving PLEX to it's own QNAP server)
Bill
My Plugin: My People
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

That is exactly what happens when you ping the TV. There is, however, a 5-10 minute delay until the adapter falls asleep. I'm using another plugin that does just that... it pings the TV which gives me the results of the network adapter. So it will report as On if the TV is off but the adapter is still active. For my immediate goal (status of the kid's TVs being on or off), that will work. To fine tune this or add functionality elsewhere, I was wondering if there was a way to poll a ROKU device to see what it is currently doing (on/off, idle/homescreen, playing ____ on netflix, etc.).
No, there isn't - Roku has very limited status information available. It looks like since I wrote the plugin, though, two status checks have been made available - Active App and Active Channel (Roku TV specific). We could make give that a try and see what it returns if it is asleep...
User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

RogueProeliator wrote:Active App and Active Channel (Roku TV specific). We could make give that a try and see what it returns if it is asleep...
I'll give that a spin. Just let me know how and what to do.
Bill
My Plugin: My People
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

After releasing a new version of the Roku plugin, I remembered that we had never investigated this... if you are still interested, turn on debugging and execute the following tests via the "Send Arbitrary Command" option on the Plugins menu:

/query/tv-active-channel
/query/active-app

Adam
User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

RogueProeliator wrote:/query/tv-active-channel

Code: Select all

   Roku Network Remote Plugin DebugProcessing GET operation: http|*|/query/tv-active-channel
   Roku Network Remote Plugin ErrorAn error occurred executing the GET/PUT request (Device: 398247524): 404
   Roku Network Remote Plugin ErrorAn error occurred executing the GET/PUT request (Device: 398247524): global name 'responseObj' is not defined
   Roku Network Remote Plugin ErrorError in plugin execution:

Traceback (most recent call last):
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Roku Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py", line 322, in concurrentCommandProcessingThread
    self.handleRESTfulError(command, e, responseObj)
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Roku Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py", line 452, in handleRESTfulError
    self.hostPlugin.logger.debug(RPFrameworkUtils.to_unicode(responseObj.text))
NameError: global name 'responseObj' is not defined

   Roku Network Remote Plugin DebugCommand thread ending processing
RogueProeliator wrote:/query/active-app

Code: Select all

   Roku Network Remote Plugin DebugProcessing GET operation: http|*|query/active-app
   Roku Network Remote Plugin ErrorError in plugin execution:

Traceback (most recent call last):
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Roku Network Remote.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py", line 322, in concurrentCommandProcessingThread
    self.handleRESTfulError(command, e, responseObj)
UnboundLocalError: local variable 'responseObj' referenced before assignment

   Roku Network Remote Plugin DebugCommand thread ending processing
Anything useful in that?
Bill
My Plugin: My People
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

Anything useful in that?
The first looks to be a dead end, the second I am not sure about and warrants further investigation. Quick question -- did you run this on the latest version that was released a few days ago? If not, upgrade to that and run the second test (the active-app one) again.

Adam
User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

Still getting an error in the log, but it's a different error with the updated plugin.

Plugin: 2.3.0
Indigo: 7.1.1
Roku: 8.0.0, build 4183
Watching Friends on Netflix
RogueProeliator wrote:/query/tv-active-channel

Code: Select all

   Roku Network Remote Debug       Processing GET operation: http|*|/query/tv-active-channel
   Roku Network Remote Threaddebug Full URL for GET: http://10.0.6.21:8060/query/tv-active-channel
   Roku Network Remote Error       An error occurred executing the GET/PUT request (Device: 398247524): 404
None
   Roku Network Remote Debug  
RogueProeliator wrote:/query/active-app

Code: Select all

Roku Network Remote Debug       Processing GET operation: http|*|/query/active-app
   Roku Network Remote Threaddebug Full URL for GET: http://10.0.6.21:8060/query/active-app
   Roku Network Remote Error       An error occurred executing the GET/PUT request (Device: 398247524): 404
None
   Roku Network Remote Debug  
Safari Test: For grins I copy/pasted the URL into Safari and for "active-app" it returned "Netflix".
For "Tv-active-channel" I got a blank screen (probably because I wasn't using the tv tuner)

/query/device-info retuned a bunch of data to include <power-mode>:

Code: Select all

299c0005-4c0b-1093-80c2-94e9791ce946 YW005C758722 559005758722 9d3b4985-7904-5556-8c53-6c1d615859e1 TCL TCL 65US5800 6103X US true false 65 15 ATSC true 92:e9:79:1b:e9:44 3c:58:1e:4f:17:81 wifi 8.0.0 4183 true en US en_US US/Central -300 PowerOn true false true false true true true true true true true true false 0.5 true true true true true
I didn't see any other "Query" things on their SDK page to play with. But that doesn't explain why it returned a "404" if the link works.
Bill
My Plugin: My People
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

Safari Test: For grins I copy/pasted the URL into Safari and for "active-app" it returned "Netflix".
Well now, that is interesting... I'll test on mine and see if I can get it to return via web browser and see if I can track down the discrepancy -- I just assumed it 404-ing on mine was because it was older or wasn't a TV; hadn't tried a browser. Stay tuned, I'll investigate the different states.

Adam
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

FYI, I have a version now that updates states for:
  • Is Powered On
  • Active Application
  • Is Screensaver Active
If you can get me the output to the active tv channel query when there IS a TV channel playing then I can add that. Otherwise I can publish as-is...

NOTE: Those states work for any Roku, not just TV models
User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

RogueProeliator wrote: If you can get me the output to the active tv channel query when there IS a TV channel playing then I can add that. Otherwise I can publish as-is...
I'll work on that this weekend.... I don't have a coax running to that TV yet... but if I still have enough scrap coax in the attic, I can probably rig something up to get a local station tuned in.

Currently I have an HD Antenna connected to an HD Homerun which puts about 90+/- local channels on my network viewable through a TV app or through PLEX. I've been waiting for the cost to come down on HDMI modulators to put a CCTV NVR on Coax which would also make my cameras viewable on the Channels App, through Coax as an HD channel, or on PLEX....

End goal...
Bill (me): "Siri (or Alexa), turn on security cameras" -> Indigo turns on living room TV, tunes TV to Channel XX (Whichever one the cameras are on).

I can sorta do that now by using a camera app on the TV... however, it's IP / web based, meaning there is a good lag time between opening the app then it pulling the stream versus if the cameras were continuously injected over COAX, it should be instant.
Bill
My Plugin: My People
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

Currently I have an HD Antenna connected to an HD Homerun which puts about 90+/- local channels on my network viewable through a TV app or through PLEX. I've been waiting for the cost to come down on HDMI modulators to put a CCTV NVR on Coax which would also make my cameras viewable on the Channels App, through Coax as an HD channel, or on PLEX....
I've wanted that for a while... every time I looked at them, though, only standard definition were available (of course, I am sure I had a price limit on there so may have out-priced HD ones). I am actually getting a Roku TV this weekend but won't have cable/TV channels to it. Don't stress about it this weekend, we can add that feature in later very quickly now that the polling is in place.
User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

RogueProeliator wrote:only standard definition ...price limit ...I am actually getting a Roku TV this weekend
Cheepest 1080p ATSC FM Modulator I've found out right now (about $300)
https://www.amazon.com/33-11980-High-De ... B01NAYLBNK

For that price I could get three 9-channel NVRs and put one each at a TV....
https://www.amazon.com/Foscam-FN3109H-S ... foscam+NVR

Except then I'd be streaming up to 9 cameras over my home network on multiple devices... not sure how much that would impact home network bandwidth.


Roku TV: I think you will like it. It's totally different from any "Smart" TV I've ever used in that the Roku TV is a Smart TV first that can also tune channels. Everything else I have used (Samsung, Visio, Sony, etc....) the "Smart" is something that has to load after the TV boots up and there is a lag time and horrible limits to the "apps" available for that device. My Samsung for example (the 2nd newest "smart" tv) is crap. Half the time it has to do an update or is stuck and won't load the "Smart" screen... and even when it does load.... it's crazy slow... So I have an ATV2nd gen (3 years older than the TV) hooked up to it because it is faster and more reliable.
Bill
My Plugin: My People
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Roku plugin with a TCL Roku TV?

Post by RogueProeliator »

Roku TV: I think you will like it. It's totally different from any "Smart" TV I've ever used in that the Roku TV is a Smart TV first that can also tune channels.
It came down to the same price of a slightly larger TV versus smaller with Roku TV and since I didn't need a huge TV in there (viewing distance is 8-10') I chose the Roku TV option. Worst case I am not really "out" much, but I expect to be happy with the decision anyway.

Man, $300 does seem a big much for that Modulator! I would just on that for $100 I think, or maybe even slightly more.
User avatar
whmoorejr
Posts: 844
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Roku plugin with a TCL Roku TV?

Post by whmoorejr »

I didn’t mind analog channels on TV and I sure miss the $30 Radio Shack FM modulator option.
Bill
My Plugin: My People
virgahyatt
Posts: 131
Joined: Sat Jan 11, 2014 12:50 am

Re: Roku plugin with a TCL Roku TV?

Post by virgahyatt »

Jut got a TCL Roku 65R615 and got the plugin setup. But it doesn't seem to be retrieving any status info. I am able to send commands to it, and they are working as expected. However, for example, the power status never updates. I have dumped the device details into the log to see if anything shows there and I see a couple of different entries that may pertain to the power state but none of them ever change. If I set debugging to high I see it request the full device info which appears to have the correct information and current state like I'm expecting. I included below the results of the log state and then the one from debug as well.

https://pastebin.com/raw/kwTSJ5GJ

Thanks for your help!
Post Reply

Return to “Roku Network Remote”