[ST Edge] Roku Driver

Sorry for any confusion, my reply was to @cptkiger . I’m not aware of any way to force add Roku devices.

I’ll ask a couple questions in case I think of something.

  • Are your Ultras or TCL new models? I know the Roku Ultra has a 2024 version.
  • Are you positive they aren’t hiding in a room already?
1 Like

I looked through the code of Todd’s driver and I don’t know enough about lua socket to understand completely. I see a few places where it might fail so if you wanted to run discovery while running the CLI LOGCAT, I might be able to see see what’s happening based on the log. I’m 100% novice but I enjoy problem solving.

thank you!

Ahhh… I missed that! Thanks.

No, I think they are from around 2020±

Good question! I triple-checked. It found and identified the two StreamBars as “Roku Streambars”, as well as a bunch of Shelly Devices I had. Scanned multiple times, but not finding them anywhere.

Does anyone know if the new Roku TVs that replaces the TCL TVs work?

I’d like to pass along this information for any current or former Roku driver users out there: if, starting towards the end of last year, you noticed that the app was no longer showing the media player status, it is because Roku made a change to their firmware which requires you to go into Roku Settings (on the physical Roku device itself, not the driver), and give permission for “mobile apps” to access the Roku. You’ll find this option in the Systems - Advanced settings. Once you do that, you should see the media player status restored as before. Note that this firmware change does not appear to affect older Roku streaming sticks.

There may have been other issues you were experiencing that this fix will address. If so, please share…

7 Likes

I just found this topic. I’m pretty much new to ST, I have a SmartThing Station (hub) and I was able to add your Roku driver. I was able to add the TV to the ST app but it only allowed me to do Screen Mirroring. After that I found this comment and I activated the “mobile app“ control but I still have no other features. What could I be missing? @TAustin

I’d like to pass along this information for any current or former Roku driver users out there: if, starting towards the end of last year, you noticed that the app was no longer showing the media player status, it is because Roku made a change to their firmware which requires you to go into Roku Settings (on the physical Roku device itself, not the driver), and give permission for “mobile apps” to access the Roku. You’ll find this option in the Systems - Advanced settings. Once you do that, you should see the media player status restored as before. Note that this firmware change does not appear to affect older Roku streaming sticks.

There may have been other issues you were experiencing that this fix will address. If so, please share…

Dismiss, I was not using the Hub to add the Roku. It wouldn’t pick it up idk why. I had to put my router in only 2.4G and hub found roku. Sadly we don’t have a GUI but it is what it is. Thanks for your great job @TAustin

Thank you for the tip. We have two TCL ROKU TVs, the the driver wouldn’t allow me to power them on or off. The only thing I could control was volume, Device Status was displaying correctly.

Once I went to Roku Settings/System/Advanced System Settings/Control by mobile apps/Network Access and set to Permissive it resolved the problem and now I can power them on\off via the ST device toggle and control the state via automations.

1 Like

DRIVER UPDATE NOTICE

Version 1.4 of the Roku driver has been pushed out to my shared channel. Those subscribed will get the update automatically.

This update changes the behavior of TV devices. Previously, when a TV was turned off it eventually went offline in SmartThings since it was no longer responding on the network. This was pretty much as originally designed, after many discussions with early testers. However, I’ve recently purchased a Roku TV myself and have had some time to see how it worked with the driver, and I wasn’t really happy with the way it was working. So I’ve made some changes to keep the SmartThings device from showing offline. In fact, you can still power back on the TV from the SmartThings device up to about 13-14 minutes after turning off, since the TV doesn’t completely shut down for that amount of time: it first goes into a ‘DisplayOff’ status, then finally really powers down later. Once it is really powered off, if you try to turn it back on using the SmartThings device, you will get a network error, but the device will still show as online - just with the power OFF. I hope all that makes sense and doesn’t cause any heartache for anyone.

I’ve also made some adjustments to hopefully improve recovery whenever devices do go offline. I know for some of you they would stay in an offline state and the only way to get them back would be a hub reboot, or the IP address change trick noted earlier.

One thing I have noticed that is strange is that when devices are being discovered on the network, it can take quite a bit of time for them to respond, so you do have to be patient if they don’t appear to be online after a hub reboot or driver update. Once one finally responds, they all seem to, which doesn’t make sense to me. I’m wondering if the hub is now doing some caching like they do with mdns queries. I’m going to have to investigate that.

Please report any problems. I will be more responsive now!

2 Likes

Thank you @TAustin . I can confirm that I did autouodate to the new driver. Unfortunately, it left my pre-existing Roku devices in SmartThings basically non-functional. I had to delete them all, do a rescan using the scan nearby feature and then update all of the routines with the newly detected devices. Not the end of the world, just sharing my experience.

That said, the newly detected devices appear to be working again. I’ll run it for a few weeks and see if I notice any problems or recurrence of my Roku TV devices getting marked as offline again.

Thanks for reporting that, and I’m sorry for the hassle. I don’t know what would have caused it. We’ll see if anyone else reports the same.

Not complaining, I really appreciate your contribution and continued support of the driver! Glitches happen- it’s always possible something was going on with my network or hub. Fortunately, SmartThings keeps the routines with a pointer now when devices are deleted instead of just deleting the routines like they used to so recovery was pretty quick.

1 Like

It could have been related to the network discovery. Sometimes it really takes a long time to re-discover your devices. This will appear as offline devices until they are re-discovered. One way I’ve found to force this to happen is to temporarily unplug one of your Roku devices to force it to restart. This can, for some reason, break the log jam for all devices.

I’ve noticed an annoying trend with the new driver. After your devices turn off and ultimately go into low power mode, after the driver seemingly looses contact with the device, while it no longer appears to report as offline in SmartThings anymore, the driver itself seems to default the power status of the device to ‘on’.

In a really weird case, at around 7:09am yesterday, it appear to arbitrarily mark all of my Roku devices as power state of ‘on’ even though they were all still off. This is the third time since the driver updated that I’ve notice this.

Yea, that definitely shouldn’t be happening. Are these TV devices or no? Would you be able to run some driver logs?

Yes, all Roku TV. Mostly TCL along with one Hisense and one Onn.

Yes, I can do some driver logs - just let me know what you need me to do.

It would be helpful to capture a sequence with everything starting at a correct/normal state, then you exercise the device to recreate the issue. Then you can DM me the complete log. You can DM me rather than filling up this topic; just be sure to surround the text with triple back ticks (```) for formatting.

Happy New Year @TAustin

Thank you as always for your amazing work !

I just installed v1.4 of your Roku Drivers. Found all 5 of my Roku Devices (1 Ultra; 2 StreamBars; 1TCL TV; 1 Stick+)

They wouldn’t respond to any commands until I changed the settings in each Roku Device as Follows:

  1. Roku Device > Settings > System > Advanced System Settings > Network Access
  2. Change from “Limited” to “Enabled”
  3. Yes, Allow

I did find that other users had mentioned this in the past as well.

Would it be possible to edit your original post to instruct new users to do the same?

After 15± Minutes of being powered off, my experience is the same as @ThomasTrain above, with the Device Cards showing the Power as “on”.

As well, the above appears to be how mine are behaving. Edit: I misspoke… I do “not” get a Network Error. The Power Button toggles to Off for a few seconds, then switches back to indicating being “On”. However, the actual Roku Device does not toggle On or Off.

I wonder if there is anything to be gleaned from the Google Home/Roku Linked Devices?

Google Home will provide basic Roku Device Cards: When Google Home is linked to your Roku Account within Google Home Settings, it shows all of the Roku Devices on your network.

I was able to Power On/Off all Roku Devices using Google Home, regardless of how long they had been powered off, and without having set the Network Access=Enabled I noted above.

Also, I’m dropping this in for anyone that may wish to go down the Rabbit Hole to get their Roku’s to Power On from within SmartThings by using a “Virtual Switch” in SmartThings to trigger an Automation in Google Home (note that these steps may need to be further refined as I’m doing this from memory) :

SmartThings:

Note: This assumes you already have a Google Home Account & App and have linked to SmartThings: Within SmartThings App (Menu > Settings Gear > Linked Services > “Google , Inc”: But please see first step in Google Home App as SmartThings may need to be linked from within Google Home App.

Menu (bottom-right corner) > Labs > Virtual Switch > “+” > Switch > Enter Name/Location/Room > Register on Hub will appear then Enable it.

Example Name: Living Room Roku SmartThings Virtual Switch (note this long form name will be helpful when getting into Google Home)

Google Home App:

First Assure you’ve linked your Roku Account and it finds all of your Roku Devices within Google Home App: Account > Home Settings > Works with Google > Add New > Roku. Repeat to link SmartThings. (if you’ve done these already, Roku & SmartThings will appear at the top under Linked Services).

Google Home App (typically opens on Favorites) > All Devices (four square icon) > Scroll down list until you find the Virtual Switch you created in SmartThings > LONG-press it > Gear > Add to Home & Room

Edit/note re above paragraph/procedure: It’s worth noting there can be a slight delay from when first adding the Virtual Switch in SmartThings and when it’s showing up/available to add into Google Home. Sometimes exiting & restarting the Google Home App causes the new SmartThings Device to show up quicker.

Automations > “+” (create new) > Automation> Starters + > Device > Select Virtual Switch from SmartThings > On > Done

Conditions (none)

Actions + > Device > Select the native/linked Google Home/Roku Device > Turn On > Save

Test it to assure it’s working, then create a second Automation to turn off instead of on using the same steps above.

Now, when you toggle the Virtual On/Off in SmartThings, Google Home App will detect the change and Power On/Off the Roku.