Fibaro HC3 - Scene activate

That’s not using the onChangeRequest revision I shared with you a little bit ago. If you already set the username & password in Settings then there’s no need for you to enter them again in onChangeRequest. From that screenshot you shared with me showed that you had added Username & Password Settings. So I just made a revision to use those new settings you created.

If you don’t want to use plugin Settings then just hardcode the URL like this:

function onChangeRequest(device, attribute, value) {
    http.post("http://admin:XXXXXX@192.168.1.222/api/scenes/" + device.Id + "/execute", {});
}

I think we are getting there.

Now I get this error.

I don’t know. I think we might have to get help from Fibaro on this one. I’m kind of playing the guessing game here. I’ll see if I can get my hands on an HC3 to test. Although it doesn’t look like it is even available here in the US yet.

If it helps I can set up TeamViewer PC for you and you get play along with my HC3.
I have a spair pc that can be running with TeamViewer so you can login when ever it fits you.

Try sending the command in CURL & then post your results in that Fibaro forum. Someone in that community should be able to answer this question or at least be able to direct us to the docs we need.

Can you try this CURL command that I sent @rhalbheer earlier?

It looks like we may have found what data needs to be passed in. Although, he’s seeing a 403 error which is a little different than what you were seeing.

Sorry for my ignorance but I have no Idea how to add the verbose option.
Do I add it to the plugin?
if yes just anywhere or after any other syntax?
and should I replace the username and password to the current one does it pick it up in the “defaultSettings”

If it is not in the plugin, where and how.

I am sorry not knowing how use this :slight_smile:

Just use the Windows Command Prompt

I have send you screen shot of the CMD respond.
It get a error.

{“type”:“ERROR”,“reason”:“JSON_PARSE_ERROR”,“message”:“Invalid value.”}* Connection #0 to host 192.168.1.222 left intact

More details in email screenshoot

You tried to run a scene that doesn’t exist. 25 was from the example I shared with Roger. It looks like 14,63,64,66,67,68,72,73,74,75,etc. Pick 1 of those or try a couple.

I did change it to ID14 just right after… I just send the wrong screensshoot. new one is on the way in email

Sorry . :upside_down_face:

Please try this command instead. I think we need double quotes around the data.

curl --verbose --header “Content-Type: application/json” --request POST --data “{}” -u yourusername:yourpassword http://192.168.1.222/api/scenes/14/execute

Also, can you please send me your HRP file that was generating the error in this post?

I have sent you the hrp file and the plugin back after my manipulations.
All sent to support email.

I stepped through the TestScene2.hrp you sent & everything looks good. So every time you run it you see the 405 error when you click the button?

Correct error 405.
Here we have a screen shoot of the config of the button. ( to be sure that it is correctly done )

I have a suspicion it may have to do with authorization. I sent you a revised file that forces Basic authorization. Can you let me know if that works?

It is working.
No error.

This was the answer from Fibaro Support btw (got it just now):
Please try to do it like that:
• curl -X POST “http://10.2.3.43/api/scenes/17/execute” -H “accept: /” -H “Content-Type: application/json” -H “X-Fibaro-Version: 2” -H “Accept-language: en” -H “Authorization: Basic YWRtaW46YWRtaW4=” -d “{}”`

• Authorization has to be coded in base64. You can use https://www.base64decode.org/ this site to do this.

• Hope you will find that helpful!

1 Like

Can you please test the attached file in the Designer Simulator?
Roger_HC3_Scene.hrp (81.7 KB)

You’ll need to update the username & password in the Script. This worked for @hrannar.

Now I am completely confused but I might have to take that to Fibaro support (happy to do if you want me to):
With the admin account it worked like a charm! So, I almost wanted to write COOL, GREAT!
But then I tested with two non-admin account which have access to everything in my HC3 but are non-admin. And there I get a 403. I guess this is time for Fibaro support, right? Will keep you posted