'Remote control'

Discussion in 'C-Bus Automation Controllers' started by nathanbull, Apr 27, 2021.

  1. nathanbull

    nathanbull

    Joined:
    Apr 15, 2021
    Messages:
    6
    Likes Received:
    0
    Hi there,

    I've read that it's possible to trigger scenes or values etc from remote control such as below, but it returns this error.

    http://192.168.0.10/scada-remote/?m=json&r=grp&fn=write&alias=0/56/1&value=255
    returns : Not supported parameter "r" (request)

    Does anyone know if there is a fix/work around for this? I'd love to be able to trigger our lights via other equipment as well such as companion!

    Cheers.
     
    nathanbull, Apr 27, 2021
    #1
    1. Advertisements

  2. nathanbull

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    158
    Likes Received:
    24
    Location:
    New Zealand
    Pie Boy, Apr 27, 2021
    #2
    1. Advertisements

  3. nathanbull

    nathanbull

    Joined:
    Apr 15, 2021
    Messages:
    6
    Likes Received:
    0
    Hey mate,

    Thanks for your reply. I've tried the script you put in that other thread and I'm not getting anywhere with it. Am I doing something wrong?

    Code:
    dst = '/www/user/C_bus.lp'
    if not io.exists(dst) then
      io.writefile(dst, [[<?
      require('socket.url')
      require('cbuslogic')
      rx = socket.url.unescape(getvar('cmd'))  s = string.split(rx, ',')
      SetCBusLevel(s[1], s[2], s[3], s[4], s[5])
      grptag = GetCBusGroupTag(s[1], s[2], s[3])
      print('Sent C bus command to : ' ..'Network '.. s[1]..' Application '.. s[2]..' Group '.. s[3]..' '.. '('..grptag..') To level ' ..s[4]..' Ramp Rate '..s[5])
       ?>]])
    end
    
    script.disable(_Remote)
    I get this error when using the html http://172.16.1.5/user/C_bus.lp?cmd=0,56,4,255,0 you put in the reply:

    Error in /www/user/C_bus.lp at line 4: unfinished string near '')'
     
    nathanbull, Apr 28, 2021
    #3
  4. nathanbull

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    158
    Likes Received:
    24
    Location:
    New Zealand
    this line didn’t format correctly swap it out

    rx = socket.url.unescape(getvar('cmd
    Needs ‘)) after cmd

    you will need to also change a couple of other things to get this to work,

    this script needs to run once to make the file, if the file already exists in your case it will, you will need to comment out the line
    if not io.exists(dst) then And also the end at the bottom

    also replace the last line with
    script.disable(_SCRIPTNAME)

    make sure to back up before running the script.
     
    Pie Boy, Apr 28, 2021
    #4
  5. nathanbull

    nathanbull

    Joined:
    Apr 15, 2021
    Messages:
    6
    Likes Received:
    0
    Sorry I forgot to add that into the code I quoted - that was the first thing I tried. Still get the exact same error unfortunately.
     
    nathanbull, Apr 28, 2021
    #5
  6. nathanbull

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    158
    Likes Received:
    24
    Location:
    New Zealand
    Did you comment out the
    if not io.exists(dst) then and the end at the bottom?

    After you changed the code and ran the script again,
    It won’t update the changes if the above line and end is not commented out
     
    Pie Boy, Apr 28, 2021
    #6
  7. nathanbull

    lcrowhurst

    Joined:
    Dec 2, 2004
    Messages:
    231
    Likes Received:
    75
    Location:
    Sydney, NSW, Australia
    The Remote API documentation (one pager - ok half pager) is available to ecoxperts, I use it in my CTC Wiser app to send a command on start up, and also in the Today widget.
     
    lcrowhurst, Apr 28, 2021
    #7
  8. nathanbull

    nathanbull

    Joined:
    Apr 15, 2021
    Messages:
    6
    Likes Received:
    0
    Sent C bus command to : Network 0 Application 56 Group 4 (D2-GA03 Row 3) To level 255 Ramp Rate 10

    Works mate!! Thanks a bunch!!
     
    nathanbull, Apr 29, 2021
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.