brucecampbell Posted March 10, 2021 Share Posted March 10, 2021 I have a situation where the programmed delays don't appear to be run properly all the time. If the room starts on, the code runs ok If the room starts off, the delays seem to be ignored Any thoughts on why and how to resolve? Scenario: I use Roku for YouTube and Netflix, but here in New Zealand many of the other apps we use are not available on Roku so I need to use either Apple TV or my Panasonic TV. But to cater to my watch list, I use the Roku Mini apps for these others anyway. Along with some code on the 'When the video selection changes' function example: If I am already watching TV and I choose 'Neon', I can clearly see the TV's IR bug send a command, wait 3 seconds, send the home command, wait 3 seconds and send the Enter command. I think get NEON. If the TV is off and I select 'Neon', I can see a long glow of multiple commands with no delay. I am left with the home menu. It has worked fine in the past. I've rebooted but no change. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted March 11, 2021 Share Posted March 11, 2021 What event is this programmed against? Have you tried running this code direct from Composer with the room off? Quote Link to comment Share on other sites More sharing options...
brucecampbell Posted March 11, 2021 Author Share Posted March 11, 2021 1 hour ago, South Africa C4 user said: What event is this programmed against? When room video selection changes 1 hour ago, South Africa C4 user said: Have you tried running this code direct from Composer with the room off? Running this code from composer with the room off does not do anything, all the if statements are looking at the selected video device - when room is off, nothing is selected. Quote Link to comment Share on other sites More sharing options...
msgreenf Posted March 11, 2021 Share Posted March 11, 2021 why do you even have this code? this looks like all stuff that should work without any code Quote Link to comment Share on other sites More sharing options...
brucecampbell Posted March 11, 2021 Author Share Posted March 11, 2021 4 minutes ago, msgreenf said: why do you even have this code? this looks like all stuff that should work without any code I hope you are right - perhaps there is a better way? I use ROKU for Netflix and YouTube - using the mini-apps - no coding required - just works! I use my smart TV for TVNZ and NEON I use AppleTV Gen 3 for Disney+, Prime and Apple movies etc. To have TVNZ, NEON, Disney+, Prime on my 'Watch' list, I have used some mini apps linked to ROKU channels and added this code to run the TV IR commands when that selection is made. Note: my TV does not have direct IR codes for the apps, this is why I run the sequence of commands with delays. Cheers. Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted March 12, 2021 Share Posted March 12, 2021 I haven’t given this much thought... as is clear from my first question above... but I suspect you may need to add a delay before any of the rest of the code (start with a long delay - say 20 seconds - I.e. make the very first line of code before the ifs a 20 second delay) and if this works, reduce it until you get an optimum result (as shot as possible but it works on a stable basis )... Just a thought and it may not work. Quote Link to comment Share on other sites More sharing options...
brucecampbell Posted March 12, 2021 Author Share Posted March 12, 2021 2 minutes ago, South Africa C4 user said: I haven’t given this much thought... as is clear from my first question above... but I suspect you may need to add a delay before any of the rest of the code (start with a long delay - say 20 seconds - I.e. make the very first line of code before the ifs a 20 second delay) and if this works, reduce it until you get an optimum result (as shot as possible but it works on a stable basis )... Just a thought and it may not work. I'm just playing with this idea now. My TV's driver has a 13 second delay built in, but even this seems to be ignored in some instances. Will run some more testing over the weekend. For now, I have America's Cup racing to watch. South Africa C4 user 1 Quote Link to comment Share on other sites More sharing options...
brucecampbell Posted March 13, 2021 Author Share Posted March 13, 2021 After a few trials, I have done the following: Removed the built in delay within the TV's driver. Moved all my code to a macro. Added a variable to record if the TV is 'powering up' Added delays to the macro based on the above variable. Commands seem to be a bit more consistent now. I'm really not sure what has changed, as this was all working fine for a long time. My theory is: The programmed commands are all queued and because they are for the TV, they don't run until the TV driver's in built delay is expired. However the programmed delays are probably started immediately, therefore all expired prior to the tv driver delay. Resulting in all commands running one after the other without delay. ------------------------------------------------------------------------------------------------------------------ New macro: Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted March 13, 2021 Share Posted March 13, 2021 Glad you are making progress. 13 seconds must feel like an age! Quote Link to comment Share on other sites More sharing options...
brucecampbell Posted March 14, 2021 Author Share Posted March 14, 2021 Sure is! The apps on the TV are pretty average to be fair, they are unresponsive when the TV first turns on for anywhere from a few seconds up to about 12 seconds - which is why the big delay. button clicks are slow, the menus movement is not smooth, and they even freeze sometimes. While on the other hand, Apple TV and Roku are smooth and very responsive. I'm just waiting for the day Roku is available in NZ and all our local content is available.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.