Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run Fibaro Scene in HA-Bridge? #560

Closed
chchiat opened this issue Mar 19, 2017 · 6 comments
Closed

How to run Fibaro Scene in HA-Bridge? #560

chchiat opened this issue Mar 19, 2017 · 6 comments
Assignees
Milestone

Comments

@chchiat
Copy link

chchiat commented Mar 19, 2017

Hi,

I tried to fill in the scene control command to HA-Bridge. But it does not work.

http:https://USER%40EMAIL.COM:PASSWORD@IPADDRESS/api/sceneControl?id=ID&action=start

I tried to fill in the scene control link to the "On Items" field in HA-Bridge, it does not work. But I tried to run in my browser it works.

How should we fill it if we want to run a scene in HA-Bridge?

Anyone? Thanks.

@Matt8119
Copy link

the fibaro commands are a little bit different and change with updates... with the last major update, you need to add an extra "/" between address and api like the example below:
http:https://USER%40MAIL.COM:PASSWORD@IPADRESS//api/devices/17/action/turnOn

@chchiat
Copy link
Author

chchiat commented Mar 20, 2017

Hi Matt,

Can I assume if I want to trigger a Scene I should put in the http command below into "On Items" field in Ha-bridge?

http:https://USER%40MAIL.COM:PASSWORD@IPADRESS//api/sceneControl?id=45&action=start

Am I right?

@chchiat
Copy link
Author

chchiat commented Mar 21, 2017

tried with the two "//" does not work.

@autofrank
Copy link

Hi

I have used
http:https:// USER%40EMAIL.COM:PASSWORD@IPADDRESS/api/sceneControl?id=ID&action=start

to start a scene with the latest HA bridge and it works
replace ID with scene id

@qnstie
Copy link

qnstie commented Sep 21, 2017

In the current Fibraro firmware (4.140) the API call is:
http:https://FIBARO_IP/api/scenes/SCENE_ID/action/start

You may try to add the user:password@ prefix before the IP to pass the parameters.
But:

Generally there is a real problem with Fibaro is with using the http:https://user@password@IP/API_CALL, which manifests itself when you try to pass JSON arguments in the HTTP body (like with a dimmer, where you need to pass a {"args":[${intensity.percent}]} JSON to the Fibaro API call (/api/devices/DEVICE_NUM/action/setValue).
With the current Fibaro firmware such a call will always result with error 405.

Mercifully a simple solution exists and I guess it is generally better than using the username and password.

All you need to do is to - instead of the user:password@ construction - use a HTTP header with a hash of the user:password part.
You just add a block like below to the "HTTP Headers" section of the HA Bridge definition:
[{name: "Authorization", "value": "Basic XYZaaaaaaaaaabbbbbbccc=="}]

The content of the XYZ... block above can be generated in a few seconds by many tools, take the first one in Google (search for e.g. "authorization: basic hash generator"). I personally use Postman Chrome extension (a great tool to test REST calls), which has the hash generator built-in.

I use the above HTTP header solution for all the calls (even without parameters), it seems a much cleaner and safer solution than using user and password in unencrypted HTTP call.

@qnstie qnstie mentioned this issue Sep 21, 2017
@bwssytems bwssytems added this to the V5.0.0 milestone Nov 14, 2017
@bwssytems
Copy link
Owner

Fibaro Scenes will be included in 5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants