TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    \ are disapearing

    Scheduled Pinned Locked Moved Linux
    4 Posts 2 Posters 1.1k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • farolF Offline
      farol
      last edited by

      I'm trying to use Triggercmd to control a Sensibo Smart Air Conditioning with the string:"
      curl -X PUT https://home.sensibo.com/api/v2/pods/<deviceid>/smartmode?apiKey=<mykey> -d "{"enabled":false}
      I've added the command to the commands.json, but when it runs, the "" from the -d arguments are removed.
      I've tried to use "\" instead, but then when "node src/agent.js --console" it errors and goes back to last good file.
      The command doesn't work without the "", it's required on the API syntax.
      How should I fix it ?

      RussR 1 Reply Last reply Reply Quote 0
      • RussR Offline
        Russ @farol
        last edited by Russ

        @farol, you could try this. I think you need to double-escape the \'s inside the quotes inside the quotes like this:

        "command": "curl -X PUT https://home.sensibo.com/api/v2/pods/<deviceid>/smartmode?apiKey=<mykey> -d \"{\\\"enabled\\\":false}\"",
        

        If I'm trying to format a commands.json entry for my Raspberry Pi where I don't have a GUI editor, I generally put the command as I'd execute it on the command line, in the GUI editor command field, then copy the result from the commands.json file. The GUI editor handles the \ escaping for you.

        1d6a55ed-4a7f-464b-8cc2-12d7d82b62fa-image.png

        Russell VanderMey

        farolF 1 Reply Last reply Reply Quote 0
        • farolF Offline
          farol @Russ
          last edited by

          @Russ Thank you ! Worked as a charm !
          Any clue how can I auto-start the agent as a daemon ?

          farolF 1 Reply Last reply Reply Quote 0
          • farolF Offline
            farol @farol
            last edited by

            @farol Nevermind. Found it.

            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post