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

DonZap

Question

Hi

 

I am new here, so sorry if I post this at the wrong forum :)

I'm using fibaro HC2 together with google home  by ifttt.
I have created a user who only has access to a virtual device that I send the http command to.
It works fine when I using device ID directly:

 
 
http://User:Password@/api/callAction?deviceID=93&name=turnOn

but when i usen the button indside the virtual device, it dose not work at all:

     http://User:Password@/api/callAction?deviceID=201&name=pressButton&arg1=button0

 

Please login or register to see this attachment.

 

Please login or register to see this attachment.

 

 

 

and I am getting the virtual device ID from the http link:
 
/fibaro/en/devices/virtual_edit.html?id=201

I have no idea why it dose not work, its pretty Straight froward?
 
thanks in advance for your inputs :)
Edited by DonZap
Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • There is really nobody  who can help me with the problem and tell me what i am doing wrong?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi

     

    I am new here, so sorry if I post this at the wrong forum :)

    I'm using fibaro HC2 together with google home  by ifttt.
    I have created a user who only has access to a virtual device that I send the http command to.
    It works fine when I using device ID directly:

     
     
    http://User:Password@/api/callAction?deviceID=93&name=turnOn

    but when i usen the button indside the virtual device, it dose not work at all:

         http://User:Password@/api/callAction?deviceID=201&name=pressButton&arg1=button0

     

    Please login or register to see this link.

     

    Please login or register to see this link.

     

     

     

    and I am getting the virtual device ID from the http link:
     
    /fibaro/en/devices/virtual_edit.html?id=201

    I have no idea why it dose not work, its pretty Straight froward?
     
    thanks in advance for your inputs :)
    Link to comment
    Share on other sites

    • 0

    Not sure but I think you need to use the button number 1 or 2 or whatever number of buttons you have, instead of "button0"

     

    Please login or register to see this image.

    /monthly_2018_03/Capture.JPG.ccc6d337bd7f01dbda72766b4d3d9b75.JPG" alt="Capture.JPG.ccc6d337bd7f01dbda72766b4d3d9b75.JPG" />

    Link to comment
    Share on other sites

    • 0

    You're calling to virtual device using webhook in Iftt? Then you need to define ipaddress (external) to http line

     

    it should look like http://user:password@ipaddress/api/.....

     

    don't forget to forward traffic to your ipaddress to HC2 in your router. See portforwarding instructions if you don't know how...

     

    sccs

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi Reintjan

     

    Thank you for your reply.

    I've done everything that you describe there.
    As I wrote, it works just fine, when I am using det device ID directly in the http link:

    http://User:Password@/api/callAction?deviceID=93&name=turnOn

     

    but as soon as I use virtual device, it does not work.
     

    ttp://User:Password@/api/callAction?deviceID=201&name=pressButton&arg1=button0

     

    so the reason is the virtual device configuration, but I just can not figure out what? 

    Edited by DonZap
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Hi Remi

     

    Thank you for your reply.

    I have tried that too, it dose not change anything:/

    Link to comment
    Share on other sites

    • 0

    I don't see the ipaddress in your link. If you're trying to push the button using ifttt ipaddress must be used in the link otherwise it does nothing. 

     

    So in the link use ipaddress after @ sign. You have to use external ip and set forwardrule in your router to lead traffic to your homecenter

    Edited by Reintjan
    Link to comment
    Share on other sites

    • 0

    I would recommend, you are setting up another account in the HC2 and use that user and password, and not the username and password from administrator or own account

     

    Please login or register to see this link.

    2

     

    deviceID = needs to be set by user according to their VD

    pressButton = needs to be set by user according to their VD

    Edited by samuel
    Link to comment
    Share on other sites

    • 0

    For example: These are the strings I am using for geofencing:

     

    Please login or register to see this link.

     

    Please login or register to see this link.

    3

     

    As you can see in the screenshots the 2 and 3 at the end of the string are a direct mapping to the label and buttons, not the ID.

    This number is a counter and can change if you add buttons and labels.

    If I for example add a button on top it will effect the count and then I need to change the strings to 3 and 4

     

    So I am not using the ID of the label or buttons.

     

    Please login or register to see this attachment.

     

    Please login or register to see this attachment.

     

    If this doesn't solve your problem there must be something wrong else, besides this.

    But I think you need to fix this too.

     

    When you try to run the string, are you running them from a browser like IE?

    Maybe try a different brower, Chrome for example.

     

    Hope this will help you a bit further.

     

    greets,

    Remi

     

    • Like 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Reintjan:

    yes offcourse I have the ip adrress in the link, otherwise it would not work at all, this one was just an example :

    http://User:Password@/api/callAction?deviceID=201&name=pressButton&arg1=button0

     

    mine looks like this:

    http://User:Password@IP:Port/api/callAction?deviceID=201&name=pressButton&arg1=button0

     

    Samuel:

    yes it is exactly what I have done ,I have created another user that only has access to the this virtual device.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I will try that again just to make sure that i didn't missed anything last time.

    But what are you using as IP adresse for your virtual device, you are using port 80, so you probably using some web-interface? 

    I will off course try this too, regarding the browser, but it should not influence the result, since this one working just fine:

     

    http://User:Password@IP:Port/api/callAction?deviceID=93&name=turnOn

     

    Link to comment
    Share on other sites

    • 0

    hi

     

    http://USERNAME:PASSWORD@IP:PORT/api/callAction?deviceID=614&name=pressButton&arg1=2

     

    this definitely works as i use all the time. amend the device ID to yours ie 201 and the number 2 at the end to represent the button number you wish to press.

     

     

    Link to comment
    Share on other sites

    • 0

    @DonZap  your ID of the Button is not the name you gave it in the webinterface.

     

    We had the same topic in here

     

    Your command should look like:

     

    http://User:Password@IP:Port/api/callAction?deviceID=201&name=pressButton&arg1=1

     

     

    Edited by bl5cky
    Adding sentence
    Link to comment
    Share on other sites

    • 0
    2 hours ago, DonZap said:

    I will try that again just to make sure that i didn't missed anything last time.

    But what are you using as IP adresse for your virtual device, you are using port 80, so you probably using some web-interface? 

    I will off course try this too, regarding the browser, but it should not influence the result, since this one working just fine:

     

    http://User:Password@IP:Port/api/callAction?deviceID=93&name=turnOn

     

     

    Honestly I cant remember why I put in those "" in the IP field and 80 as port number.

    My best gues is the "" is replacement for leaving the IP.

    But I don't think its of any use since I'm not pointing to any netwerk device either.

     

    First step for you is the fix the button ID to the correct button number.

     

    If you havent already done so, maybe its a good test to try the string on your local network first, with local IP of the Fibaro controller.

    If that's working, maybe your port forwarding rule has an error.

    I am at work now so I cant check, but I think I forwarded port 80 to 80 in the router.

     

    Edited by Remi
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Remi:

     

    it did actually did the trick:

     

    Please login or register to see this image.

    /monthly_2018_03/image.png.f92a53a43abdc541a05ccd4f2a758cb3.png" alt="image.png.f92a53a43abdc541a05ccd4f2a758cb3.png" />

     

    I have no idea why it is possible at all and what it dose, but works, thank you very much  :) 

     

    Best regards 

    Zap 

    Link to comment
    Share on other sites

    • 0

    That's great! Glad its working!

     

    I think the local host IP (127.0.0.1) messed it up.

    Leaving the IP field empty would have solved the problem too, I gues.

     

    Will test that tonight for fun and to learn :)

     

     

    • Thanks 1
    Link to comment
    Share on other sites

    • 0

    Many of us are concerned about the security of IFTTT Webhook accessing  HC2 via basic authentication. People have generally tried creating a new user and limiting the rights for that user. For those even more paranoid about security, there is another, more sophisticated solution (tried and tested):

    • IFTTT Webhook sends commands to ThingSpeak channel via API
    • ThingSpeak channel data insertion triggers a Matlab analysis app in the cloud. You can use this app to generate a mathematical encryption of the command you want to forward to HC2. Sky is the limit for encryption here (you can read the Cryptonomicon for insipartion:)
    • ThingSpeak sends an HTTP API request to HC2 to trigger a scene with the encrypted command in the body of the request (to be used in fibaro:args())
    • HC2 Scene processes takes the command from the fibaro:args(), decrypts it and takes appropriate actions

    Here are the reasons this solution works:

    • You have all the versatility of IFTTT
    • You have the flexibility of ThingSpeak Matlab - you can post process and encrypt...
    • On HC2 you only have to give the 'IFTTT user' the right to access that one scene that decrypts the command and takes action

    Speed is ok - requests triggered by IFTTT take 2-4 seconds to be executed by HC2.

     

    Unless Fibaro develops a genuine IFTTT service, the above is the most secure and versatile solution I've come across.

    Also the Google Assistant integration of Fibaro is a joke. But with the above you can do anything you want with GA via IFTTT service - devices, scenes, global variables, all of it together, etc.

     

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

    • 0
  • Inquirer
  • have you guys had success with controlling the fibaro dimmer  by IFTTT and fibaro?
    let say that we want to set the dimmer to a specific value, 10-20-25-30 and so on.
    My slider link looks like this:

     

    http://<IP>/api/callAction?deviceID=<ID>&name=setSlider&arg1=<SLIDER ID>&arg2=<VALUE>

    but how can I make the arg2=<Value>  as variable and not a fixed value.

    I am using google assistent as tiger by sayin: "set the kichen light to # precent", but how can I use # in the frase as value for arg2, so i don't have to create a trigger for every step, like 10-20-30 precent  in the vartual device and IFTTT app ....?

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