Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
apwelsh
Level 8

Volume poll and control via ECP possible?

I created a Roku integration for the Hubitat Elevation Smart Home hub.  It works great, but there are some limitations.

Volume Control

To fully implement volume control, I need the following:

  1. a way to query current volume level (0 to 100)
  2. a way to query the mute state (muted or unmuted)
  3. a way to set the volume to a specific level (0-100)

Power State

Presently, I use the query/device-info to determine the powered state (power-mode), but is there a way to pull just the powered state?  Reason for question is that parsing XML is very CPU intensive.  To query just power state is highly beneficial

Summary

Are there any undocumented ECP queries and commands available?  Are the any official features that are not yet documented?  Is there a way to officially request these features?

Alexa integration helps, but being able to use local control w/o reliance on the internet is preferred when possible.

 

Thanks!

3 REPLIES 3\
aeonsablaze
Level 7

Re: Volume poll and control via ECP possible?

+1 I would also like to see these volume poll/control options added to ECP

0 Kudos
lemming622
Level 7

Re: Volume poll and control via ECP possible?

One way you might help it is to run grep for <power-state>. Then it's just one XML that would have to be parsed.

0 Kudos
apwelsh
Level 8

Re: Volume poll and control via ECP possible?

grep is a search tool that must filter through the entire dataset and returns only what matches the free expression.  What I do now is to read each line of text one line at a time, until I find the power state tag, and then throw away the rest of the text. This is faster than grep, because I stop parsing text after finding the first match, and it is all native code.  But the fact that one must scan through all that text means a lot of wasted data that must be analyzed and discarded until we find the power state.

 

Additionally, XML is about standardized documents that are easily parsed.  JSON would be better,  as there is less than half as must waste in the data payload for the same information.  Still, to have a query for power state is one way to improve performance.  Another is to have some sort of evenststream system so we can simply subscribe to change events.

0 Kudos