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:
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!
+1 I would also like to see these volume poll/control options added to ECP
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.
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.
What file are you running grep against?