Hi, I'm looking for some hints to lead me down the right path in my project.
I have some basic home automation going on. HTPC with Eventghost controlling IPPower box, Kodi, Lifx bulbs, TV, Projector, Denon AVR etc. Commandfusion on a Nexus 7 as remote controller unit.
My issue is that communications to eventghost can sometimes be a little flaky. HTPC is setup as a UDP system. Normally it's not a problem, but 1 issue has to be sorted.
Currently I use advanced actions to call a JS that sends a button_press and button_release to eventghost. When scrolling through media lists if I press "Down Arrow" eventghost sends down arrow to Kodi, it also pauses for 600ms waiting to see if there has been a button release. If no button_release then it starts repeating the "Down Arrow" at 300ms intervals. After 3 seconds if no "button_release" it increases speed to 100 ms intervals.
I really like this function, but sometimes a button_release is never received and the scrolling gets locked on. I have confirmed in debugger that nexus 7 sends the button_release, but wireshark on HTPC never receives the "button_release". I looked into changing communications protocols but it was over my head. So I'm sticking with UDP for now.
Next option was to move the "repeat" function from Eventghost to CF.
I started with this;
"Down Arrow" has 3 "OnPress" actions.
1. Send "Down Arrow", 0 "Repeat Delay", 0 "Hold Delay"
2. "Hold Delay" 600ms then send "Down Arrow" with a "Repeat Delay" of 300ms
3. "Hold Delay" 3000ms then send "Down_Arrow" with a "Repeat Delay" of 100ms.
So after 3 seconds both step 2 and 3 are running. it's workable but a bit chaotic. any clues how I could do this more effectively.
Questions:
Is there a way to change the "Repeat Delay" using JS. ie after 3 seconds change "Repeat Delay" from 300ms to 100ms?
or
Is there a way to stop action 2 once action 3 starts?
or
Is there a way to do all this in JS? If so I'm going to need some hints on where to read up. :)
Anything thoughts you can add would be appreciated.
Thanks
Anthony