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 API for Scene


rhalbheer

Question

Hi All,

I am trying to trigger a scene through http. I know that we have Swagger showing the interface but somehow I seem to be unable to translate this ins curl command. 

If I take 

Please login or register to see this code.

What is wrong? It does not trigger my scene....

I get: 

Please login or register to see this code.

I see that it is forbidden but the user has access to the scene

Thank you

Roger

 

 

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0
41 minutes ago, rhalbheer said:

VGVtcFRhYmxldDpNdVJzMmNLLg==

please remove and change password for 

Please login or register to see this code.

Link to comment
Share on other sites

  • 0
29 minutes ago, rhalbheer said:

Thats not the password but a hash it seems. But thank you

No sir, it’s base64 you password, trust me

Your password started MuR[censored]

Link to comment
Share on other sites

  • 0
1 hour ago, rhalbheer said:

Thats not the password but a hash it seems. But thank you

 

yeah, hash-ish notation … that example explains the security in most apps today ?

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • LOL, reset the password, thank you. I actually ignored it was I expected a real hash and not base64...............

    However, does somebody have an idea regarding the POST?

    Link to comment
    Share on other sites

    • 0
    29 minutes ago, rhalbheer said:

    However, does somebody have an idea regarding the POST?

     

    Please login or register to see this code.

     

    Edited by tinman
    • Thanks 1
    Link to comment
    Share on other sites

    • 0
    30 minutes ago, rhalbheer said:

    an idea regarding the POST?

    Sir idk

    really 

    it’s works as for me

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hmm, it does not for me. I get a 403 (even though the user has access) or a 401 (user not logged in) when I run it that way. I tried to encode the password without success

    Link to comment
    Share on other sites

    • 0
    2 hours ago, rhalbheer said:

    Hmm, it does not for me. I get a 403 (even though the user has access) or a 401 (user not logged in) when I run it that way. I tried to encode the password without success

     

    after 3 not succ trying fibaro HC3 should ban you on 30min. you will alwaya got 403 in this case.

    • Like 1
    Link to comment
    Share on other sites

    • 0

    I'm the developer for the Home Remote app that's been working with @rhalbheer  & another user to try & figure out how scenes are controlled in HC3. The other user I'm working with is seeing a different error. He's seeing a HTTP 400 error that returns:

    {“type”:“ERROR”,“reason”:“JSON_PARSE_ERROR”,“message”:“Invalid value.”}


    The big question we are trying to figure out is what, if any, data needs to be passed? 

     

    A user in another thread suggested to just pass in {} when we don't need to pass in any arguments. Not sure why that isn't working.

     

    curl --verbose --header "Content-Type: application/json" --request POST --data '{}' -u admin:xxxxxx http://192.168.1.222/api/scenes/14/execute

     

    EDIT - I think the reason for this error may have been because of the single quotes around the data. He's on a Windows machine & from what I've read I think that needs to use double quotes instead. I've sent this revised command to the user to test. Waiting to hear back.  I'll report back if it fixes the issue or returns a different error.

     

    curl --verbose --header "Content-Type: application/json" --request POST --data "{}" -u admin:xxxxxx http://192.168.1.222/api/scenes/14/execute

     

     

     

     

    Edited by billv
    Link to comment
    Share on other sites

    • 0

    @rhalbheer I think on Windows we have to use double quotes for CURL commands. Try the revision that @tinman made & see if that works. Sorry I didn't notice that sooner.

     

    13 hours ago, tinman said:

    curl --verbose --header "Content-Type: application/json" --request POST --data "{\"args\":{}}" -u username:password http://10.10.0.100/api/scenes/25/execute

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • This really drives me crazy...... I tried different versions, espcially as @10der says that it works for him. I constantly get a 403.

    What confuses me completely: If I log in as any user (excpet for the admin), I do not see any scenes in the user interface. The user has access to all scenes but there is not way to start a scene in the user interface (to test access control). Any idea what I am missing here? I guess this is the root cause.

    Link to comment
    Share on other sites

    • 0
    46 minutes ago, rhalbheer said:

    This really drives me crazy...... I tried different versions, espcially as @10der says that it works for him. I constantly get a 403.

    What confuses me completely: If I log in as any user (excpet for the admin), I do not see any scenes in the user interface. The user has access to all scenes but there is not way to start a scene in the user interface (to test access control). Any idea what I am missing here? I guess this is the root cause.

    IMHO its works for me cuz my user 

    Please login or register to see this image.

    /monthly_2020_06/image.png.230af64036e33081e760ff80c53cb791.png" />

     

    scene

    Edited by 10der
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Mine has access rights to all scenes. Do you see scenes in the UI when you log in with the user? It sounds like an access control problem but I checked again and again 

    Link to comment
    Share on other sites

    • 0
    1 minute ago, rhalbheer said:

    Mine has access rights to all scenes. Do you see scenes in the UI when you log in with the user?

    never logged as this user to UI ? TBH

    it's python user :_) 

    Edited by 10der
    • Thanks 1
    Link to comment
    Share on other sites

    • 0

    Please login or register to see this code.

    Here is the command i use from my mac and it is working.

    • Thanks 1
    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
    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...