Weiter zum Inhalt
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Hell
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dunkel
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. English
  3. ioBroker general
  4. Simple API Use SOLVED

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    764

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.1k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

Simple API Use SOLVED

Geplant Angeheftet Gesperrt Verschoben ioBroker general
apisimple api
22 Beiträge 5 Kommentatoren 5.8k Aufrufe 4 Beobachtet
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • UncleSamU UncleSam

    @ap2017 Can you please share a screenshot of your object tree in ioBroker where we can see the mentioned state (and its parents)?

    A Offline
    A Offline
    ap2017
    schrieb am zuletzt editiert von
    #8

    @UncleSam Here the screenshot. Do I need to have subfolder variables in my URL?

    478101c6-03ea-4770-aca9-b414a5870a93-image.png

    paul53P UncleSamU 2 Antworten Letzte Antwort
    0
    • A ap2017

      @UncleSam Here the screenshot. Do I need to have subfolder variables in my URL?

      478101c6-03ea-4770-aca9-b414a5870a93-image.png

      paul53P Offline
      paul53P Offline
      paul53
      schrieb am zuletzt editiert von paul53
      #9

      @ap2017
      URL: http://iobrokerip:8087/set/javascript.0.variables.PI-detection?value=true

      Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
      Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

      1 Antwort Letzte Antwort
      0
      • A ap2017

        @UncleSam Here the screenshot. Do I need to have subfolder variables in my URL?

        478101c6-03ea-4770-aca9-b414a5870a93-image.png

        UncleSamU Offline
        UncleSamU Offline
        UncleSam
        Developer
        schrieb am zuletzt editiert von
        #10

        @ap2017 So, did you copy the state ID the way I asked you to?

        Because it seems to me that the name should be javascript.0.variables.PI-detection

        Bitte bei Problemen mit meinen Adaptern, Issue auf GitHub erfassen: Loxone | I2C | Luxtronik2
        ♡-lichen Dank an meine Sponsoren

        A 2 Antworten Letzte Antwort
        0
        • UncleSamU UncleSam

          @ap2017 So, did you copy the state ID the way I asked you to?

          Because it seems to me that the name should be javascript.0.variables.PI-detection

          A Offline
          A Offline
          ap2017
          schrieb am zuletzt editiert von ap2017
          #11

          @UncleSam Thank you, with subfolder "variables" added I am getting browser response
          {"id":"javascript.0.variables.PI-detection","value":true,"val":true}

          Now I need to figure out how MotionEye notification work, since I PI-detection does not change in response to motion

          1 Antwort Letzte Antwort
          0
          • UncleSamU UncleSam

            @ap2017 So, did you copy the state ID the way I asked you to?

            Because it seems to me that the name should be javascript.0.variables.PI-detection

            A Offline
            A Offline
            ap2017
            schrieb am zuletzt editiert von
            #12

            @UncleSam Everything works now. I did not realized that I have to reset the web hook variable after motion is detected.

            T 1 Antwort Letzte Antwort
            1
            • A ap2017

              @UncleSam Everything works now. I did not realized that I have to reset the web hook variable after motion is detected.

              T Offline
              T Offline
              tehMilcho
              schrieb am zuletzt editiert von
              #13

              Hey there,

              i got the same Error but little different problem. I have copyed the Object-Path with the little button.

              so i build this URL:
              http://SERVER:8087/set/0_userdata.0.VirtualDevices.hc3lite.FlurPIR-1?value=false&prettyPrint

              The Url works fine in any browser but when i try to use it in my code i get:

              "error: no value found for "0_userdata.0.VirtualDevices.hc3lite.FlurPIR-1". Use /set/id?value=1 or /set/id?value=1&wait=1000"

              I will use it in a Lua Script that runs on the "Fibaro Home center lite". When i rebuild the URL to "toggle" it works fine.. i have no clue whats the issue .. because it makes no sense for me.

              Lua Code:

              local value = fibaro.getValue(52, "value")
              local url
              
              -- Deside if value should be true or false
              if (fibaro.getValue(52, "value") == true) then
              url = 'http://SERVER:8087/set/0_userdata.0.VirtualDevices.hc3lite.FlurPIR-1?value=true&prettyPrint'
              elseif (fibaro.getValue(52, "value") == false) then
              url = 'SERVER/set/0_userdata.0.VirtualDevices.hc3lite.FlurPIR-1?value=false&prettyPrint'
              else 
              print ("No Match")
              end
              
              print(url)
              
              local selfhttp = net.HTTPClient()
              
              local headers = {
                      ["Accept"] = "application/json",
                      ["Content-Type"] = 'application/json',
                      ["Cache-Control"] = "no-cache"
                  }
              
              selfhttp:request(url, {
                options={
                  method = 'GET',
                  headers = headers,
                  timeout = 5000
                },
               success = function(response) 
                          print(response.status)
                          print(response.data)
                  end,
                  error = function(message)
                          print("error:", message)
                  end
              })
               
              

              anyone knows something? i think i had the same issue by try to use something like this in Android App - Tasker, but then give out and used toggle.

              1 Antwort Letzte Antwort
              0
              • M Online
                M Online
                MCU
                schrieb am zuletzt editiert von
                #14

                @tehmilcho sagte in Simple API Use SOLVED:

                http://SERVER:8087/set/0_userdata.0.VirtualDevices.hc3lite.FlurPIR-1?value=true&prettyPrint

                Try to encode the URL

                let encodedUrl = encodeURIComponent(url);
                

                NUC i7 64GB mit Proxmox ---- Jarvis Infos Aktualisierungen der Doku auf Instagram verfolgen -> mcuiobroker Instagram
                Wenn Euch mein Vorschlag geholfen hat, bitte rechts "^" klicken.

                T 1 Antwort Letzte Antwort
                0
                • M MCU

                  @tehmilcho sagte in Simple API Use SOLVED:

                  http://SERVER:8087/set/0_userdata.0.VirtualDevices.hc3lite.FlurPIR-1?value=true&prettyPrint

                  Try to encode the URL

                  let encodedUrl = encodeURIComponent(url);
                  
                  T Offline
                  T Offline
                  tehMilcho
                  schrieb am zuletzt editiert von
                  #15

                  @mcu said in Simple API Use SOLVED:

                  let encodedUrl = encodeURIComponent(url);

                  the Lua Script in Fibaro seems not happy about it:

                  [24.11.2023] [22:43:48] [ERROR] [SCENE29]: (load):15: syntax error near 'encodedUrl

                  M 1 Antwort Letzte Antwort
                  0
                  • T tehMilcho

                    @mcu said in Simple API Use SOLVED:

                    let encodedUrl = encodeURIComponent(url);

                    the Lua Script in Fibaro seems not happy about it:

                    [24.11.2023] [22:43:48] [ERROR] [SCENE29]: (load):15: syntax error near 'encodedUrl

                    M Online
                    M Online
                    MCU
                    schrieb am zuletzt editiert von
                    #16

                    @tehmilcho In LUA seems to be

                    local encodedUrl = url.escape(url)
                    

                    NUC i7 64GB mit Proxmox ---- Jarvis Infos Aktualisierungen der Doku auf Instagram verfolgen -> mcuiobroker Instagram
                    Wenn Euch mein Vorschlag geholfen hat, bitte rechts "^" klicken.

                    T 1 Antwort Letzte Antwort
                    0
                    • M MCU

                      @tehmilcho In LUA seems to be

                      local encodedUrl = url.escape(url)
                      
                      T Offline
                      T Offline
                      tehMilcho
                      schrieb am zuletzt editiert von
                      #17

                      @mcu said in Simple API Use SOLVED:

                      local encodedUrl = url.escape(url)

                      mhh seems like fibaro specail lua?

                      [24.11.2023] [22:54:25] [ERROR] [SCENE29]: (load):23: attempt to call a nil value (field 'escape')

                      M 1 Antwort Letzte Antwort
                      0
                      • T tehMilcho

                        @mcu said in Simple API Use SOLVED:

                        local encodedUrl = url.escape(url)

                        mhh seems like fibaro specail lua?

                        [24.11.2023] [22:54:25] [ERROR] [SCENE29]: (load):23: attempt to call a nil value (field 'escape')

                        M Online
                        M Online
                        MCU
                        schrieb am zuletzt editiert von
                        #18

                        @tehmilcho Do you use it so?

                        url = url.escape(url)
                        
                        selfhttp:request(url, {
                          options={
                            method = 'GET',
                            headers = headers,
                            timeout = 5000
                          },
                          success = function(response) 
                            print(response.status)
                            print(response.data)
                          end,
                          error = function(message)
                            print("error:", message)
                          end
                        })
                        

                        NUC i7 64GB mit Proxmox ---- Jarvis Infos Aktualisierungen der Doku auf Instagram verfolgen -> mcuiobroker Instagram
                        Wenn Euch mein Vorschlag geholfen hat, bitte rechts "^" klicken.

                        T 1 Antwort Letzte Antwort
                        0
                        • M MCU

                          @tehmilcho Do you use it so?

                          url = url.escape(url)
                          
                          selfhttp:request(url, {
                            options={
                              method = 'GET',
                              headers = headers,
                              timeout = 5000
                            },
                            success = function(response) 
                              print(response.status)
                              print(response.data)
                            end,
                            error = function(message)
                              print("error:", message)
                            end
                          })
                          
                          T Offline
                          T Offline
                          tehMilcho
                          schrieb am zuletzt editiert von
                          #19

                          @mcu yep this leads to "[24.11.2023] [22:54:25] [ERROR] [SCENE29]: (load):23: attempt to call a nil value (field 'escape')"

                          M 1 Antwort Letzte Antwort
                          0
                          • T tehMilcho

                            @mcu yep this leads to "[24.11.2023] [22:54:25] [ERROR] [SCENE29]: (load):23: attempt to call a nil value (field 'escape')"

                            M Online
                            M Online
                            MCU
                            schrieb am zuletzt editiert von
                            #20

                            @tehmilcho sagte in Simple API Use SOLVED:

                            :23: attempt to call a nil value (field 'escape')

                            Try this

                            url = url:gsub("([^A-Za-z0-9_])", function(c) return string.format("%%%02X", string.byte(c)) end)
                            

                            NUC i7 64GB mit Proxmox ---- Jarvis Infos Aktualisierungen der Doku auf Instagram verfolgen -> mcuiobroker Instagram
                            Wenn Euch mein Vorschlag geholfen hat, bitte rechts "^" klicken.

                            T 1 Antwort Letzte Antwort
                            0
                            • M MCU

                              @tehmilcho sagte in Simple API Use SOLVED:

                              :23: attempt to call a nil value (field 'escape')

                              Try this

                              url = url:gsub("([^A-Za-z0-9_])", function(c) return string.format("%%%02X", string.byte(c)) end)
                              
                              T Offline
                              T Offline
                              tehMilcho
                              schrieb am zuletzt editiert von
                              #21

                              @mcu said in Simple API Use SOLVED:

                              url = url:gsub("([^A-Za-z0-9_])", function(c) return string.format("%%%02X", string.byte(c)) end)

                              then it seems to get stuck, no error but will not finsh and also the state in iobroker is not changed, when you Output the new string you will get:

                              http%3A%2F%2F192%2E168%2E178%2E37%3A8087%2Fset%2F0_userdata%2E0%2EVirtualDevices%2Ehc3lite%2EFlurPIR%2D1%3Fvalue%3Dtrue%26prettyPrint

                              T 1 Antwort Letzte Antwort
                              0
                              • T tehMilcho

                                @mcu said in Simple API Use SOLVED:

                                url = url:gsub("([^A-Za-z0-9_])", function(c) return string.format("%%%02X", string.byte(c)) end)

                                then it seems to get stuck, no error but will not finsh and also the state in iobroker is not changed, when you Output the new string you will get:

                                http%3A%2F%2F192%2E168%2E178%2E37%3A8087%2Fset%2F0_userdata%2E0%2EVirtualDevices%2Ehc3lite%2EFlurPIR%2D1%3Fvalue%3Dtrue%26prettyPrint

                                T Offline
                                T Offline
                                tehMilcho
                                schrieb am zuletzt editiert von
                                #22

                                @MCU but this brings me on track, i now swap the "?" with "%3F" now it works .. damn @MCU you are f****** smart :) Thanks a lot. spend already hours on this :)

                                1 Antwort Letzte Antwort
                                1

                                Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.

                                Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.

                                Mit deinem Input könnte dieser Beitrag noch besser werden 💗

                                Registrieren Anmelden
                                Antworten
                                • In einem neuen Thema antworten
                                Anmelden zum Antworten
                                • Älteste zuerst
                                • Neuste zuerst
                                • Meiste Stimmen


                                Support us

                                ioBroker
                                Community Adapters
                                Donate

                                429

                                Online

                                32.8k

                                Benutzer

                                82.7k

                                Themen

                                1.3m

                                Beiträge
                                Community
                                Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                ioBroker Community 2014-2025
                                logo
                                • Anmelden

                                • Du hast noch kein Konto? Registrieren

                                • Anmelden oder registrieren, um zu suchen
                                • Erster Beitrag
                                  Letzter Beitrag
                                0
                                • Home
                                • Aktuell
                                • Tags
                                • Ungelesen 0
                                • Kategorien
                                • Unreplied
                                • Beliebt
                                • GitHub
                                • Docu
                                • Hilfe