GithubHelp home page GithubHelp logo

rokupoly's Introduction

roku-polyglot

This is the Roku Poly for the Universal Devices ISY994i Polyglot interface with Polyglot V2 (c) 2019 Robert Paauwe MIT license.

This node server is intended to support the Roku Media Players.

With this node server you can launch applications and send remote command to a single Roku media box. The current application running on the box is available.

Installation

  1. Backup Your ISY in case of problems!
    • Really, do the backup, please
  2. Go to the Polyglot Store in the UI and install.
  3. Add NodeServer in Polyglot Web
    • After the install completes, Polyglot will reboot your ISY, you can watch the status in the main polyglot log.
  4. Once your ISY is back up open the Admin Console.
  5. Configure the node server with your station ID.

Node Settings

The settings for this node are:

Short Poll

  • Not used

Long Poll

  • Poll the Roku device for it's current status. Time in seconds.

Roku name / ip

  • Add custom parameters with by suppling the name for your Roku as the key and the IP address of the Roku as the value. You may have multiple name / ip entries.

Requirements

  1. Polyglot V2 itself should be run on Raspian Stretch. To check your version, cat /etc/os-release and the first line should look like PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)". It is possible to upgrade from Jessie to Stretch, but I would recommend just re-imaging the SD card. Some helpful links:
  2. This has only been tested with ISY 5.0.14 so it is not guaranteed to work with any other version.

Upgrading

Open the Polyglot web page, go to nodeserver store and click "Update" for "RokuPoly".

For Polyglot 2.0.35, hit "Cancel" in the update window so the profile will not be updated and ISY rebooted. The install procedure will properly handle this for you. This will change with 2.0.36, for that version you will always say "No" and let the install procedure handle it for you as well.

Then restart the Roku nodeserver by selecting it in the Polyglot dashboard and select Control -> Restart, then watch the log to make sure everything goes well.

The Roku nodeserver keeps track of the version number and when a profile rebuild is necessary. The profile/version.txt will contain the WeatherFlow profile_version which is updated in server.json when the profile should be rebuilt.

Release Notes

  • 2.0.3 08/11/2021
    • Handle case where roku device has no applications installed.
  • 2.0.2 10/20/2020
    • verify app is on list before updating node with running app.
  • 2.0.1 09/16/2020
    • Move some error/info log messages to debug level to reduce clutter.
    • Handle connection error when getting the current running app.
    • Handle failure when connecting to a device.
  • 2.0.0 06/12/2020
    • Full re-write to support multiple Roku devices.
  • 0.0.6 03/28/2020
    • Enable polling to get current status of Roku device.
  • 0.0.5 03/27/2020
    • Strip '&' from application names.
  • 0.0.4 12/22/2019
    • Fix requirements.txt file to have the right requirements.
  • 0.0.3 03/20/2019
    • Fix online status going false after query.
  • 0.0.2 01/11/2019
    • Initial working version published to github
  • 0.0.1 01/07/2019
    • Initial template published to github

rokupoly's People

Contributors

bpaauwe avatar

Stargazers

Dan Perovich avatar

Watchers

James Cloos avatar  avatar Dan Perovich avatar

rokupoly's Issues

roku_node:update_status: App address 562859 is not mapped to an appliction.

I've used your RokuPoly for "awhile" now and recently have a new problem. I think the screensaver (Home) is now being reported with this unexpected APP value 562859. I am using RokuPremiere.

I have some ISY programs to respond to my Roku channel selection to set some ambient lights behind my TV. When I return to Home my ISY program doesn't respond since GV1 gets set to this value 562859. I have to select some other known channel to get my ISY program to notice so my ambient lights will change (or go off which is what I used to get when returning to Home).

Maybe this is known problem with the latest Roku software updates?

TypeError: argument of type 'NoneType' is not iterable

Sorry to bother you again, even more sorry that I tried to update Roku and started down this path. Now I have UNInstall the RokuPoly, install it again to the latest version, restart the raspberryPi, restart the ISY, and I still have the result that nothing responds. And I can't get it to show the Nodes (it shows only 1 node where before it showed 3 nodes).

Something I missed?

I have two Roku devices in the custom parameters, they are listed in the attached log
RokuTCL32 with ip 10.0.0.31
RokuPremiere with ip 10.0.0.80

It gets the channels list from the RokuTCL32 then encounters this error, I never see it get discovery of the RokuPremiere.

TypeError: argument of type 'NoneType' is not iterable

I hate to give up on this but... if there is nothing obvious I will let it rest (for awhile anyway).

Thanks in advance.

RokuPolyLog.txt

Errors in logs aren't errors

I was reviewing the logs in my Polyglot server for RokuPoly and noticed a lot of errors. Looking around in the code, it looks like the error logger is used in a few places where many it should be DEBUG, especially in write_profile.py:

2020-09-16 08:54:54,219 Controller polyinterface ERROR polyinterface:_parseInput: _parseInput: received command PLAY for a node that is not in memory: roku_26
2020-09-16 08:55:17,687 MainThread polyinterface INFO polylogger:set_basic_config: set_basic_config: enable=True level=30
2020-09-16 08:55:18,083 MainThread polyinterface INFO polyinterface:init_interface: Received Config from STDIN.
2020-09-16 08:55:18,084 MainThread polyinterface INFO init:: UDI Polyglot v2 Interface 2.1.0 Starting...
2020-09-16 08:55:18,618 MainThread polyinterface DEBUG polyinterface:get_network_interface: gws: {'default': {2: ('192.168.1.1', 'wlan0'), 10: ('fe80::4a5d:36ff:fe8f:8b5d', 'wlan0')}, 2: [('192.168.1.1', 'wlan0', True)], 10: [('fe80::4a5d:36ff:fe8f:8b5d', 'wlan0', True)]}
2020-09-16 08:55:18,618 MainThread polyinterface DEBUG polyinterface:get_network_interface: gw: default=('192.168.1.1', 'wlan0')
2020-09-16 08:55:18,619 MainThread polyinterface DEBUG polyinterface:get_network_interface: ifad: wlan0=[{'addr': '192.168.1.240', 'netmask': '255.255.255.0', 'broadcast': '192.168.1.255'}]
2020-09-16 08:55:18,620 MainThread polyinterface INFO polyinterface:init: Connect: Network Interface: {'addr': '192.168.1.240', 'netmask': '255.255.255.0', 'broadcast': '192.168.1.255'}
2020-09-16 08:55:18,621 Interface polyinterface INFO polyinterface:_startMqtt: Connecting to MQTT... localhost:1883
2020-09-16 08:55:18,672 MQTT polyinterface INFO polyinterface:_connect: MQTT Connected with result code 0 (Success)
2020-09-16 08:55:18,673 MQTT polyinterface INFO polyinterface:_connect: MQTT Subscribing to topic: udi/polyglot/ns/6 - MID: 1 Result: 0
2020-09-16 08:55:18,674 MQTT polyinterface INFO polyinterface:_connect: MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0
2020-09-16 08:55:18,675 MQTT polyinterface INFO polyinterface:_connect: Sent Connected message to Polyglot
2020-09-16 08:55:18,681 MQTT polyinterface INFO polyinterface:_subscribe: MQTT Subscribed Succesfully for Message ID: 1 - QoS: (0,)
2020-09-16 08:55:18,682 MQTT polyinterface INFO polyinterface:_subscribe: MQTT Subscribed Succesfully for Message ID: 2 - QoS: (0,)
2020-09-16 08:55:18,729 NodeServer polyinterface INFO roku:start: Starting node server
2020-09-16 08:55:18,730 NodeServer polyinterface INFO polyinterface:saveCustomData: Sending customData to Polyglot.
2020-09-16 08:55:18,730 MQTT polyinterface INFO roku:process_config: found TV Room with ip 192.168.1.26
2020-09-16 08:55:18,737 MQTT polyinterface INFO roku:discover: In Discovery...
2020-09-16 08:55:18,738 MQTT polyinterface DEBUG roku:discover: {'ip': '192.168.1.26', 'configured': False, 'node_id': 'roku_26', 'apps': None}
2020-09-16 08:55:18,738 MQTT polyinterface INFO roku:discover: query 192.168.1.26
2020-09-16 08:55:19,251 MQTT polyinterface DEBUG roku:discover: FandangoNOW Movies and TV, 31012
2020-09-16 08:55:19,252 MQTT polyinterface DEBUG roku:discover: Prime Video, 13
2020-09-16 08:55:19,252 MQTT polyinterface DEBUG roku:discover: VUDU, 13842
2020-09-16 08:55:19,253 MQTT polyinterface DEBUG roku:discover: Boomerang, 149733
2020-09-16 08:55:19,254 MQTT polyinterface DEBUG roku:discover: 4K Spotlight, 69091
2020-09-16 08:55:19,254 MQTT polyinterface DEBUG roku:discover: The Roku Channel, 151908
2020-09-16 08:55:19,255 MQTT polyinterface DEBUG roku:discover: Hulu, 2285
2020-09-16 08:55:19,256 MQTT polyinterface DEBUG roku:discover: Cartoon Network, 164003
2020-09-16 08:55:19,256 MQTT polyinterface DEBUG roku:discover: Sling TV, 46041
2020-09-16 08:55:19,257 MQTT polyinterface DEBUG roku:discover: iHeartRadio Family, 297924
2020-09-16 08:55:19,257 MQTT polyinterface DEBUG roku:discover: ESPN, 34376
2020-09-16 08:55:19,258 MQTT polyinterface DEBUG roku:discover: Roku Tips and Tricks, 552944
2020-09-16 08:55:19,259 MQTT polyinterface DEBUG roku:discover: Plex - Stream for Free, 13535
2020-09-16 08:55:19,259 MQTT polyinterface DEBUG roku:discover: Nick Jr., 66595
2020-09-16 08:55:19,261 MQTT polyinterface DEBUG roku:discover: Minecraft by HappyKids.tv, 88798
2020-09-16 08:55:19,262 MQTT polyinterface DEBUG roku:discover: AFV Animals-Animal and Pet Video, 62701
2020-09-16 08:55:19,262 MQTT polyinterface DEBUG roku:discover: AFV Kids-FreeandSafe Funny Video, 62702
2020-09-16 08:55:19,263 MQTT polyinterface DEBUG roku:discover: The Gummibaer Channel, 90819
2020-09-16 08:55:19,264 MQTT polyinterface DEBUG roku:discover: Disney Plus, 291097
2020-09-16 08:55:19,264 MQTT polyinterface DEBUG roku:discover: DisneyNOW, 32828
2020-09-16 08:55:19,265 MQTT polyinterface DEBUG roku:discover: PBS KIDS, 23333
2020-09-16 08:55:19,265 MQTT polyinterface DEBUG roku:discover: Nickelodeon, 52838
2020-09-16 08:55:19,266 MQTT polyinterface DEBUG roku:discover: Roku Streaming Player Intro, 184661
2020-09-16 08:55:19,267 MQTT polyinterface DEBUG roku:discover: YouTube, 837
2020-09-16 08:55:19,267 MQTT polyinterface DEBUG roku:discover: ET Live, 261333
2020-09-16 08:55:19,268 MQTT polyinterface DEBUG roku:discover: STIRR - the new free TV, 251088
2020-09-16 08:55:19,269 MQTT polyinterface DEBUG roku:discover: Roku Media Player, 2213
2020-09-16 08:55:19,269 MQTT polyinterface DEBUG roku:discover: Netflix, 12
2020-09-16 08:55:19,270 MQTT polyinterface DEBUG roku:discover: HappyKids.tv, 32614
2020-09-16 08:55:19,270 MQTT polyinterface DEBUG roku:discover: Newsy, 11055
2020-09-16 08:55:19,272 MQTT polyinterface INFO write_profile:write_nls: write_profile: Writing profile/nls/en_us.txt
2020-09-16 08:55:19,274 MQTT polyinterface ERROR write_profile:write_nls: ('FandangoNOW Movies and TV', 1)
2020-09-16 08:55:19,274 MQTT polyinterface ERROR write_profile:write_nls: ('Prime Video', 2)
2020-09-16 08:55:19,275 MQTT polyinterface ERROR write_profile:write_nls: ('VUDU', 3)
2020-09-16 08:55:19,275 MQTT polyinterface ERROR write_profile:write_nls: ('Boomerang', 4)
2020-09-16 08:55:19,276 MQTT polyinterface ERROR write_profile:write_nls: ('4K Spotlight', 5)
2020-09-16 08:55:19,277 MQTT polyinterface ERROR write_profile:write_nls: ('The Roku Channel', 6)
2020-09-16 08:55:19,277 MQTT polyinterface ERROR write_profile:write_nls: ('Hulu', 7)
2020-09-16 08:55:19,278 MQTT polyinterface ERROR write_profile:write_nls: ('Cartoon Network', 8)
2020-09-16 08:55:19,278 MQTT polyinterface ERROR write_profile:write_nls: ('Sling TV', 9)
2020-09-16 08:55:19,279 MQTT polyinterface ERROR write_profile:write_nls: ('iHeartRadio Family', 10)
2020-09-16 08:55:19,280 MQTT polyinterface ERROR write_profile:write_nls: ('ESPN', 11)
2020-09-16 08:55:19,280 MQTT polyinterface ERROR write_profile:write_nls: ('Roku Tips and Tricks', 12)
2020-09-16 08:55:19,281 MQTT polyinterface ERROR write_profile:write_nls: ('Plex - Stream for Free', 13)
2020-09-16 08:55:19,281 MQTT polyinterface ERROR write_profile:write_nls: ('Nick Jr.', 14)
2020-09-16 08:55:19,282 MQTT polyinterface ERROR write_profile:write_nls: ('Minecraft by HappyKids.tv', 15)
2020-09-16 08:55:19,283 MQTT polyinterface ERROR write_profile:write_nls: ('AFV Animals-Animal and Pet Video', 16)
2020-09-16 08:55:19,285 MQTT polyinterface ERROR write_profile:write_nls: ('AFV Kids-FreeandSafe Funny Video', 17)
2020-09-16 08:55:19,285 MQTT polyinterface ERROR write_profile:write_nls: ('The Gummibaer Channel', 18)
2020-09-16 08:55:19,286 MQTT polyinterface ERROR write_profile:write_nls: ('Disney Plus', 19)
2020-09-16 08:55:19,286 MQTT polyinterface ERROR write_profile:write_nls: ('DisneyNOW', 20)
2020-09-16 08:55:19,287 MQTT polyinterface ERROR write_profile:write_nls: ('PBS KIDS', 21)
2020-09-16 08:55:19,287 MQTT polyinterface ERROR write_profile:write_nls: ('Nickelodeon', 22)
2020-09-16 08:55:19,288 MQTT polyinterface ERROR write_profile:write_nls: ('Roku Streaming Player Intro', 23)
2020-09-16 08:55:19,288 MQTT polyinterface ERROR write_profile:write_nls: ('YouTube', 24)
2020-09-16 08:55:19,289 MQTT polyinterface ERROR write_profile:write_nls: ('ET Live', 25)
2020-09-16 08:55:19,290 MQTT polyinterface ERROR write_profile:write_nls: ('STIRR - the new free TV', 26)
2020-09-16 08:55:19,290 MQTT polyinterface ERROR write_profile:write_nls: ('Roku Media Player', 27)
2020-09-16 08:55:19,291 MQTT polyinterface ERROR write_profile:write_nls: ('Netflix', 28)
2020-09-16 08:55:19,291 MQTT polyinterface ERROR write_profile:write_nls: ('HappyKids.tv', 29)
2020-09-16 08:55:19,292 MQTT polyinterface ERROR write_profile:write_nls: ('Newsy', 30)
2020-09-16 08:55:19,293 MQTT polyinterface ERROR write_profile:write_nls: ('Screensaver', 0)
2020-09-16 08:55:19,295 MQTT polyinterface INFO write_profile:write_nls: write_profile: done.
2020-09-16 08:55:19,299 MQTT polyinterface ERROR write_profile:write_nodedef: {'TV Room': {'ip': '192.168.1.26', 'configured': True, 'node_id': 'roku_26', 'apps': {'31012': ('FandangoNOW Movies and TV', 1), '13': ('Prime Video', 2), '13842': ('VUDU', 3), '149733': ('Boomerang', 4), '69091': ('4K Spotlight', 5), '151908': ('The Roku Channel', 6), '2285': ('Hulu', 7), '164003': ('Cartoon Network', 8), '46041': ('Sling TV', 9), '297924': ('iHeartRadio Family', 10), '34376': ('ESPN', 11), '552944': ('Roku Tips and Tricks', 12), '13535': ('Plex - Stream for Free', 13), '66595': ('Nick Jr.', 14), '88798': ('Minecraft by HappyKids.tv', 15), '62701': ('AFV Animals-Animal and Pet Video', 16), '62702': ('AFV Kids-FreeandSafe Funny Video', 17), '90819': ('The Gummibaer Channel', 18), '291097': ('Disney Plus', 19), '32828': ('DisneyNOW', 20), '23333': ('PBS KIDS', 21), '52838': ('Nickelodeon', 22), '184661': ('Roku Streaming Player Intro', 23), '837': ('YouTube', 24), '261333': ('ET Live', 25), '251088': ('STIRR - the new free TV', 26), '2213': ('Roku Media Player', 27), '12': ('Netflix', 28), '32614': ('HappyKids.tv', 29), '11055': ('Newsy', 30), '0': ('Screensaver', 0)}}}
2020-09-16 08:55:19,301 MQTT polyinterface INFO polyinterface:installprofile: Sending Install Profile command to Polyglot.
2020-09-16 08:55:19,408 MQTT polyinterface INFO polyinterface:reportDriver: Updating Driver roku_26 - GV2: 837, uom: 56
2020-09-16 08:55:19,409 MQTT polyinterface INFO polyinterface:reportDriver: Updating Driver roku_26 - GV1: 24, uom: 25
2020-09-16 08:55:19,410 MQTT polyinterface INFO polyinterface:addNode: Adding node TV Room(roku_26)
2020-09-16 08:55:19,443 NodeServer polyinterface INFO node_funcs:set_logging_level: set_logging_level: Setting log level to 0

Node server "crashes"

After an undetermined period of time, the RokuPoly node server no longer works...requests to interact with a Roku no longer work. Looking at the logs, I see the same exception occurring anytime the node server stops working:

2020-10-17 18:09:48,029 Controller polyinterface ERROR polyinterface:write: Exception in thread Controller: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/home/pi/.local/lib/python3.7/site-packages/polyinterface/polyinterface.py", line 854, in _parseInput self.longPoll() File "/home/pi/.polyglot/nodeservers/RokuMediaPlayer/nodes/roku.py", line 71, in longPoll self.nodes[node].longPoll() File "/home/pi/.polyglot/nodeservers/RokuMediaPlayer/nodes/roku_node.py", line 29, in longPoll self.update_status(self.active) File "/home/pi/.polyglot/nodeservers/RokuMediaPlayer/nodes/roku_node.py", line 34, in update_status self.setDriver('GV1', self.apps[address][1], report=True, force=True) KeyError: '65067'

Further features

Love the control this gives.... but want to see if something could be added.

My biggest problem with my roku/plex system in my home is my autistic child will sit and play/pause/play/pause. Despite us telling her not to, she will keep doing it, (At times she stops the movie/cartoon at a funny frame and giggles from it.)
While this doesn't damage anything too much (aside from a little more wear-and-tear on the remotes), we would like to actively discourage this behavior.
Is there a way to monitor the active status of a Roku, whether it is playing or paused?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.