Remote control external system call

  • Hi

    I hope this is the right place for this question, it is to do with using Kodi/Librelec controls, but also a shell script and I'm hoping someone can help. I'm using my remote control through LibreElec to call an external URL to perform other functions such as turning lights on/off which is done through OpenHAB. The way I've done this currently is editing my remote.xml to have the following attached to a button:

    <blue>System.Exec("/storage/LampsToggle.sh")</blue>

    Then in the LampsToggle.sh file I have the following:

    curl --request POST 'http://192.168.1.20/basicui/CMD?Livingroom_Lamps=TOGGLE'

    This works very well and controls all the other devices perfectly by using the TV remote, however I've got a problem where each time I press the button to call one of these functions if I'm watching a video in Kodi it freezes briefly for a split second. This isn't a huge deal but one of the functions I'm using requires repeated presses of a button to change the level of another device and that can be a bit painful as the if you need to press the button 10 times or similar it really interrupts the TV.

    I'm wondering if anyone can suggest an alternative method? I'm not an expert by any means, but I assume the video playback freezes while the URL is opened and that to avoid this I would possibly need to in some way make the URL open in a separate thread so the video playback continues uninterrupted while the URL opens in the background with a lower priority?

    I would appreciate any advice on this if someone can point me in the right direction.

    Thanks