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

HC3 (maybe HCx) and Nodered


Guest kallecux

Question

Guest kallecux
Posted

When I call the HC3 api

http://192.168.3.116/api/customEvents/sunrise

to trigger the "sunrise" event, then this works via the SWAGGER console.

 

If I want to trigger the event via nodered, I can't do it.

 

Neither via the basic authentication built into, nor when I incorporate the user name and password in the URL.
I always get:

Error "405 not allowed".

 

What can be wrong here?
Best regards
Karl Heinz

8 answers to this question

Recommended Posts

  • 0
Posted

You probably need to call it with a user/pass?
Like http://admin:[email protected]/api/customEvents/sunrise

 

Does that work?

  • 0
Posted
2 hours ago, kallecux said:

When I call the HC3 api

http://192.168.3.116/api/customEvents/sunrise

to trigger the "sunrise" event, then this works via the SWAGGER console.

 

If I want to trigger the event via nodered, I can't do it.

 

Neither via the basic authentication built into, nor when I incorporate the user name and password in the URL.
I always get:

Error "405 not allowed".

No problem posting from NR to HC2 (you do a POST do you?)

I would expect the problem being something in your NoderRed http node config...

  • 0
Guest kallecux
  • Inquirer
  • Posted

    Do you prefer Basicauthentication via the http Request node or inline authentication via URL?

    • 0
    Guest kallecux
  • Inquirer
  • Posted

    Please login or register to see this spoiler.

     

    • 0
    Guest kallecux
  • Inquirer
  • Posted (edited)

    GET works but not POST

     

    I did it this way:

     

    the URL is: http://admin:[email protected]/api/customEvents/sunrise

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    the NR response is: 

    Please login or register to see this image.

    /monthly_2020_02/image.png.8b64350bdadb3ab7c03d47b15568f034.png" />

     

    Greetings!

     

    Edited by kallecux
    • 0
    Posted

    If get works that mean your PUT have something wrong maybe your payload?

    • 0
    Posted
    On 2/11/2020 at 2:56 PM, kallecux said:

    GET works but not POST

    I did it this way:

    the URL is: http://admin:[email protected]/api/customEvents/sunrise

    Did you get it to work?

    It turned out that I needed to add the header "X-Fibaro-Version:  2" or the HC3 got into a catalytic shock and showed 504. Usually needed a reboot.

    • 0
    Guest kallecux
  • Inquirer
  • Posted

    Hello @jgab, no not yet - I put it aside. I will check the JSON content and follow your advice regarding the header.
    Thanks for the hints!

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