Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Set Value via HTTP out of Fibaro HC3 Scene


Question

Posted (edited)

Hi,

 

I try to set a value on a HTTP target.

In this case i try to gather the "power consumoption over time" cause Fibaro remove any usefull diagrams in HC3.

 

This works quite well for me in a browser:

http://IP:8087/set/javascript.0.fibaro.WP-Flex_Power?value=XX

 

I can cut & paste a debug output from my scene and the value will be set, but within the scene nothing happends.

The same approach works for me in QuickApps:

 

http = net.HTTPClient({timeout=3000})

url = "http://IP:8087/set/javascript.0.fibaro.WP-Flex_Power?value=XXX"

http:request(url, {})

 

 

I tried also to nail down the method but nothing changed for me:

Example: 

{
        options={
            method = 'GET'}
            })
Edited by moltos

6 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    Error message: 500

    "error: no value found for \"javascript.0.fibaro.WP-Flex_Power\". Use /set/id?value=1 or /set/id?value=1&wait=1000"

     

    But as mentioned in my browser or from a Quick App this works as to expect.

     

     

    • 0
    Posted (edited)

    is it Influx db?

     

    lelf

    {
        operator = "all",
        conditions = {
            {
                type = "date",
                property = "cron",
                operator = "match",
                value = {"*""*""*""*""*""*"},
                isTrigger = true
            }
        }
    }
     
     
    right
     

    Please login or register to see this code.

     

    Please login or register to see this attachment.

    saveByDeviceID("PhaseA"1149)
    saveByDeviceID("PhaseB"1152)
    saveByDeviceID("PhaseC"1146)
     
    saveByDeviceID("PhaseA_Energy"1148"power")
    saveByDeviceID("PhaseB_Energy"1151"power")
    saveByDeviceID("PhaseC_Energy"1145"power")
     
     

     

     

    Edited by 10der
    • 0
  • Inquirer
  • Posted

    No its not influx, I only use history in iobroker as workaround.
    With simple API you normally can directly change the value with shown url.

    My error does not make really much sense for me.

     

    In your case you have to send the data (value=1235) in the body right? 

    • 0
    Posted (edited)
    9 hours ago, moltos said:

    Error message: 500

    "error: no value found for \"javascript.0.fibaro.WP-Flex_Power\". Use /set/id?value=1 or /set/id?value=1&wait=1000"

     

    But as mentioned in my browser or from a Quick App this works as to expect.

     

     

    so as the error line ends up with \, the error seems to be there, and exact there is ? sign.

     

    http://IP:8087/set/javascript.0.fibaro.WP-Flex_Power?value=XX

     

    You have to url encode the bold part, like:

     

    Please login or register to see this code.

     

    Edited by tinman
    • Thanks 2
    • 0
    Posted
    3 hours ago, moltos said:

    data (value=1235) in the body right? 

    See answer by @tinman

    • 0
  • Inquirer
  • Posted (edited)

    Many thanks @

    Please login or register to see this link.

      this works for me .... I would never have found this without your help.

    Edited by moltos

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...