Announcement

Collapse
No announcement yet.

Scripting Newbie - Simplifying IR Code Reference

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scripting Newbie - Simplifying IR Code Reference

    HS3 scripting newbie looking for any guidance/direction on way to simplify building events for AV Control. I have built WiFi Arduino IR blasters controlled via HTTP Post commands. I can trigger the IR from events by pasting in the IR code timings but find that very clunky to manage. I'd love some way to put all the IR remote commands I've captured into a file/script library, with a simple variable name like "LGTV_ON" that I can easily reference and call from an event. The Post command that gets sent from HS3 event to the Arduino looks like this for each button press:
    &hs.URLAction("http://10.1.1.60/play", "POST","timings=9078, 4414, 626, 474, 652, 476, 652, 1604, 626, 478, 624, 478, 650, 478, 650, 476, 626, 502, 626, 1606, 626, 1628, 600, 474, 652, 1580, 648, 1606, 626, 1580, 648, 1606, 626, 1580, 650, 1604, 626, 478, 650, 474, 628, 1606, 624, 474, 652, 1580, 650, 1580, 650, 1604, 626, 478, 652, 1602, 626, 1582, 648, 478, 624, 1606, 626, 474, 652, 476, 652, 476, 626]

    Currently I put each string in an event like below screenshot, but when looking back at it, from the string I can't tell which does what and gets really confusing. Ideally I'd want to put all of the IR commands in a script/file somewhere with a shorthand name I can reference in the event. Something like:

    LGTV_HDMI3="&hs.URLAction("http://10.1.1.60/play", "POST","timings=9078, 4414, 626, 474, 652, 476, 652, 1604, 626, 478, 624, 478, 650, 478, 650, 476, 626, 502, 626, 1606, 626, 1628, 600, 474, 652, 1580, 648, 1606, 626, 1580, 648, 1606, 626, etc..."

    LGTV_ON="&hs.URLAction("http://10.1.1.60/play", "POST","timings=9034, 4414, 626, 652, 652, 476, 478, 1604, 626, 478, 624, 478, 650, 478, 650, 476, 626, 502, 626, 1606, 626, 1628, 600, 474, 652, 1580, 648, 1606, 626, 1580, 648, 1606, 245, etc..."

    And then from the event I can call LGTV_ON and then LGTV_HDMI3, and it will run the string.

    Click image for larger version

Name:	Capture.PNG
Views:	45
Size:	100.2 KB
ID:	1358138
    Attached Files
Working...
X