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


Send command to node-red


Martin Windsmose

Recommended Posts

Hi All 

I want to send this command to node-red. Is this possible with quickapp. I used VD on my HC2

 

GET /googlehome?announcement=someone%20at%20the%20door HTTP/1.1
Host 192.168.2.160:1880

Thanks in advanced.

Link to comment
Share on other sites

Please login or register to see this code.

 

Edit this code to your liking. ;)

Edited by Joep
Link to comment
Share on other sites

  • Topic Author
  • Hi Joep

     

    Thanks for your response, I am not very good in this. and not sure where to insert the string in the command using Lua scene on HC3 - Guess its all wrong since nothing happened ;-) I inserted the bold. hope you can help. 

     

    net.HTTPClient():request(url, {192.168.2.160:8080
        options={
          method = 'GET',/googlehome?announcement=someone%20at%20the%20door HTTP/1.1
          headers = {
              headers = {['Content-Type']  = 'application/json'},
            },
          timeout = 2000,
        },
        success = function(response) 
                fibaro.debug("Scene1", response.status)
                fibaro.debug("Scene1", response.data)
        end,
        error = function(message)
                fibaro.debug("Scene1", "error:", message)
        end
    })

    Link to comment
    Share on other sites

  • Topic Author
  • Hi Sankotronic

     

    I get the below error when i try a Quick app. If i create a scene nothing happened. It should come with the string.

     

    [15.02.2021] [08:57:00] [ERROR] [QUICKAPP435]: QuickApp crashed[15.02.2021] [08:57:00] [ERROR] [QUICKAPP435]: Unknown error occurred: std::exception: 'unable to make cast'

     

    My flow looks like this, and i should see it in the debug mode on Node-red when i click the quick app or scene

    Please login or register to see this image.

    /monthly_2021_02/image.png.56d5a47e03f76441fb2286b87bee368e.png" />

     

    Hope it makes sense. 

    Thanks in advanced

    Martin

    Link to comment
    Share on other sites

    Please edit: 

    Please login or register to see this code.

    with

     

    Please login or register to see this code.

    And in Node-RED you have to add a http response node so the HC3 gets a reply with a status. Now the HC3 is waiting and waiting and times out at one point. This makes your HC3 slow.

    Link to comment
    Share on other sites

  • Topic Author
  • Hi Joep and Sankotronic

    Apparently its sending something to Node-red

     

    Please login or register to see this image.

    /monthly_2021_02/image.png.5c44f27fcea927e459de1f4c27318a5f.png" />

     

    So guess i am closer, just need to figure out why the /googlehome?announcement=someone%20at%20the%20door

    are not beeing send. 

    Link to comment
    Share on other sites

  • Topic Author
  • Hello guys 


    I see on my HC2 it was marked as string in the VD. do you think thats why is msg.payload: Object empty

    If i just type in chrome: http://192.168.2.160:8080/googlehome?announcement=someone%20at%20the%20door

    I receive the following in node-red

     

    15.2.2021 13.15.34

    Please login or register to see this link.

    msg : error

    "TypeError: msg.payload.toLowerCase is not a function"

    Link to comment
    Share on other sites

    Join the conversation

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

    Guest
    Reply to this topic...

    ×   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...