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

HTTPS from EKEY dLine fingerprint scanner to HC3


Question

Posted

Hey,

 

I am trying to turn on a Binary Switch in the HC3 automatically.

 

It should turn on in the case that I open our front door with a "EKEY dline fingerprint scanner".

In the EKEY APP, I can configure a HTTP-Request with 

a) method (Post, Get, etc.)

b) URL

c) Request-Header

d) Request Body

e) Security level (AllowHtttp, TlsWithCACheck, TlsAllowSelfSigned, tlsPinnedCertificate)

f) authentication (Access-Token, no authorization, Refresh-Token, OAuth-Authentifizzierung)

 

As I am a newbie in programming things like that, I kindly ask for your help/advise

how I have to configure the a) to f) fields in the EKEY Application, or even help with settings things in the HC3 if necessary.

 

Thanks in advance,

Christian

10 answers to this question

Recommended Posts

  • 0
Posted (edited)

One approach would be to create one or more custom events on the HC3 (panel General->Events).

These events can be emitted and trigger ex block scenes where you could set up things on the HC3.

 

Assume you have a custom event named 'DoorOpen', if you can create this request it could work...

 

URL: http://<your-HC3-ip>/api/customEvents/DoorOpen/publish

Method: GET

Request headers:

                accept: */*'

                X-Fibaro-Version: 2

                Accept-language: en

                Authorization: Basic YWRtaW46YWRtaW4=   <-- Add your own credentials here

 

Security level AllowHtttp

authentication no authorization

 

I'm guessing on no authorisation here because we are including the authorization as a headers instead.

To create the authorisation string "Basic ...." from your username and password, use this helper page

Please login or register to see this link.

 

Ok, missed  that you just wanted to turn on a binary switch. The the url then is

URL: http://<your-HC3-ip>/api/callAction ?deviceID=768&name=turnOn

Method: GET

 

the rest is the same... 768 is the deviceId of your device.

Edited by jgab
  • 0
  • Inquirer
  • Posted

    Hi jgab, 

     

    thank you very much for your quick and detailed response, very kind of you!

     

    I can almost fully follow your instructions.

    One question come up right now:

     

    The information I should write in the header - 

     

     accept: */*'

                    X-Fibaro-Version: 2

                    Accept-language: en

                    Authorization: Basic YWRtaW46YWRtaW4=   <-- Add your own credentials here

     

    - is not possible as the Ekey App doesn't have a blank field to write in.

    The app comes up with two lines in the Header:

    1) Key

    2) Value

     

    I tried to insert the given information from you but it says "invalid content-encoding".

     

    Can you please give me further information which of the information I have to insert where?

     

    Thank you very much in advance.

     

    Best regards

    Christian

     

    • 0
    Posted (edited)
    16 minutes ago, CE1981 said:

    Hi jgab, 

     

    thank you very much for your quick and detailed response, very kind of you!

     

    I can almost fully follow your instructions.

    One question come up right now:

     

    The information I should write in the header - 

     

     

     accept: */*'

                    X-Fibaro-Version: 2

                    Accept-language: en

                    Authorization: Basic YWRtaW46YWRtaW4=   <-- Add your own credentials here

     

    - is not possible as the Ekey App doesn't have a blank field to write in.

    The app comes up with two lines in the Header:

    1) Key

    2) Value

     

    I tried to insert the given information from you but it says "invalid content-encoding".

     

    Can you please give me further information which of the information I have to insert where?

     

    Thank you very much in advance.

     

    Best regards

    Christian

     

    So there are 4 headers with key, value,

    Key:accept

    Value:*/*

     

    Key:X-Fibaro-Version

    Value:2

     

    Key:Accept-language

    Value:en

     

    Key:Authorization

    Value:Basic YWRtaW46YWRtaW4=   <-- Add your own credentials here

     

    I assume that the webUI allows you to add one key-value and then add more key-values...

    If you can only add one, Authorisation is the most crucial

    Edited by jgab
    • 0
  • Inquirer
  • Posted

    Hey jgab,

     

    thanks again for you kind help.

     

    Indeed the app allows to create multiple headers.

     

    Unfortunately I can not add the first header:

    + accept --> "invalid content-encoding"

    + */* --> "invalid value"

     

    The test run says then: Error 400 

    Please login or register to see this attachment.

     

    Do you have any further idea to make it work out?

     

    Thank you very much.

     

    Christian

    • 0
    Posted

    and if you just ignore that particular header?

     

    If that doesn't work try

    application/json

    • 0
  • Inquirer
  • Posted

    Hey,

     

    I was able to fill in all the headers.

    The word "accept" had to start with a capital A...

     

    Unfortunately the request does not work:

    Please login or register to see this attachment.

     

    Any idea why?

     

    Thanks in advance.

     

    Christian

    • 0
    Posted

    How does the url look like that you are sending now?

    • 0
  • Inquirer
  • Posted

    It's the one you gave me, to be precise:

     

    http://fibaro-ip/api/callAction?deviceID=220&Dimmer=turnOn

     

    Dimmer is the name I gave to the Fibaro device. Is that correct?

     

    Thanks and regards

    Chris

    • 0
    Posted
    18 minutes ago, CE1981 said:

    It's the one you gave me, to be precise:

     

    http://fibaro-ip/api/callAction?deviceID=220&Dimmer=turnOn

     

    Dimmer is the name I gave to the Fibaro device. Is that correct?

     

    Thanks and regards

    Chris

    It should be 'name' not 'Dimmer'. The 220 is the id that identifies the QA

    http://fibaro-ip/api/callAction?deviceID=220&name=turnOn

    • 0
  • Inquirer
  • Posted

    jgab!

     

    My hero!

     

    Thanks a lot!!

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