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


Recommended Posts

Posted

Hi,

 

As the location services from HC2 were not very reliable i started to look for alternative ways of making location based scenes.  I read around the forum about tasker but i found it a little too complex for my needs.

 

Finally i found IFTTT.  I just set up a rule to change a global variable in HC2 when i enter / exit an area and of course have my scenes run when that global variable changes.

 

I tested it over the course of 2 weeks and it never missed one entry/exit from the zone. Even better the IFTTT app doesn't even have to be opened on my phone. Battery impact is minimal.

 

Just wanted to share this info in case other people are looking for the same thing as i was.

 

Posted

Is it not unsecure though? requires port open for HC2

  • Topic Author
  • Posted

    This you can solve from the router. Configure port forwarding  with brute force detection and mac filter. Safe enough imo.

    Posted

    This you can solve from the router. Configure port forwarding  with brute force detection and mac filter. Safe enough imo.

     

    not a bad idea... i remember creating a new user called IFFFT with access to only simple virtual device buttons... i thought you may have found a new solution

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Posted

    What recepie do yu use in IFTTT? Geolocation triggering what?

     

    Thanks!

  • Topic Author
  • Posted

    geolocation triggering a scene that changes a global variable with 2 values: home or nothome, using Maker channel to send a web request like

    Please login or register to see this code.

    Method in Maker channel is GET, content type is application/Json.

     

    I did 2 recipes, one for entry an area, one for exit an area.

    In HC2 there are 2 corresponding scenes that look like : - one with home, one with nothome

    Please login or register to see this code.

    Posted

     

    geolocation triggering a scene that changes a global variable with 2 values: home or nothome, using Maker channel to send a web request like

    Please login or register to see this code.

    Method in Maker channel is GET, content type is application/Json.

     

    I did 2 recipes, one for entry an area, one for exit an area.

    In HC2 there are 2 corresponding scenes that look like : - one with home, one with nothome

    Please login or register to see this code.

     

    I do mine slightly different using put and url / body to change a variable directly. Then only one scene checks for change of variable. Works extremely well.

    Posted

    Hi,

     

    As the location services from HC2 were not very reliable i started to look for alternative ways of making location based scenes.  I read around the forum about tasker but i found it a little too complex for my needs.

     

    Finally i found IFTTT.  I just set up a rule to change a global variable in HC2 when i enter / exit an area and of course have my scenes run when that global variable changes.

     

    I tested it over the course of 2 weeks and it never missed one entry/exit from the zone. Even better the IFTTT app doesn't even have to be opened on my phone. Battery impact is minimal.

     

    Just wanted to share this info in case other people are looking for the same thing as i was.

    Hi Momos,

      Cool info, thanks for sharing, I'm a late comer to IFTTT, indeed I didn't know it existed until your post

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> Can you tell me what do you select in IFTTT / maker channel it as it looks very device specific at a cursory glance ? Hopefully I get some time in the coming few days to give it a bit of a go !

     

    Cheers,

    al.

     

    Edit : Got it, you posted it I just didn't read it

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> Doh!

     

    Method in Maker channel is GET, content type is application/Json.

     

    Cheers,

    al.

  • Topic Author
  • Posted

    You just create an IF this then That rule.  The first part (If This) you select ios location or android device to enable geolocation, then at the second part  of the recipe (then That) you select the Maker channel and you will only have one option: Web request. Then you just enter the info i wrote in the previous post and you are done.

    Posted

    You just create an IF this then That rule.  The first part (If This) you select ios location or android device to enable geolocation, then at the second part  of the recipe (then That) you select the Maker channel and you will only have one option: Web request. Then you just enter the info i wrote in the previous post and you are done.

    Yep it's dead simple .. I just had a few minutes in the car between meetings, and already have it triggering. neat !

    Cheers,

    al.

    Posted

    I guess I need to restart the IFTTT app upon every restart of my iphone?

  • Topic Author
  • Posted

    I don't know. I never restart my phone and the IFTTT app is not even running in the background, yet it still works. Weird but true.

     

    Edit: i restarted the phone and yes you need to just open the IFTTT app and then close it in case you restart.

    Posted

    no need to start app after a phone restart... 1 x nexus 5 and 1 x nexus 5x

    Posted

    ignore my comment... just realised my variable changes work but as usual FIBARO has another f*****g bug that does not detect the trigger from a variable change from external api modification. STUPID! Back to VD and buttons for me aswell!

    • 1 month later...
    Posted

    This you can solve from the router. Configure port forwarding  with brute force detection and mac filter. Safe enough imo.

     

     

    I don't understand what MAC filtering has to do with your open port? If a port is open and forwarded to port 80 on your HC2, your HC2 is exposed to the WAN no matter what MAC address the potential hacker uses.

     

     

    ignore my comment... just realised my variable changes work but as usual FIBARO has another f*****g bug that does not detect the trigger from a variable change from external api modification. STUPID! Back to VD and buttons for me aswell!

     

     

    This used to be true for a long time but now (on 4.090) the invokeScenes command works fine and scenes are triggered when global vars are set using http api and PUT, json example: '{"value" : "0" , "invokeScenes" : "true"}'.

     

    This still means your user:pass is being sent in clear text over HTTP which is not exactly secure. Users have been "hacked" this way and shut out from their HC2's. 

     

    A solution would be to create a user with limited access to a VD or scene as global vars only seems to be able to be changed by admin or super users... It would be awesome if user restriction could be limited to a single global var.

  • Topic Author
  • Posted

    I don't understand what MAC filtering has to do with your open port? If a port is open and forwarded to port 80 on your HC2, your HC2 is exposed to the WAN no matter what MAC address the potential hacker uses.

     

     

    Yes, but you can make it safer by filtering all requests on the WAN port by MAC so the attacker would also have to know the MAC address of the device you are using or the request will be dropped. This in combination with brute force detection makes it quite safe. At least this is my view on it.

     

    All the above can be achieved from the NAT start rules in your router using IPTables.

    Posted

    IPTables makes this possible but most consumer grade routers does not offer that kind of granularity and MAC addresses can be easily spoofed. Better than no security on the other hand... Biggest problem still is clear text login info.

     

    User restriction on the global vars still would be awesome.

    • 2 months later...
    Posted

    Hi, All

     

    I would like to use GPS as well, but Fibaro doesn't work for me.

    Then I saw this chat :-)

    I followed the instruction for IFTTT and it seems to work.

    But still I'm not clear how to get the Web info into my HC2.

    Please can you help to explain more in detail or with examples

    • how the IFTTT Web link has to look like?
    • what is the command to read the IFTTT weblink in HC2 LUA?
    • do I need to edit my routers settings?

    Sorry for the stupid questions :-?

    It would be great if someone could help me out.

    Cheers

    Posted

    It has been a while but I recently gave this a bit of time again. I haven't had time to set it up properly but I think I have a pretty good and more importantly, safe way of dealing with this now. 

     

    First of all I assume we're all talking about IPv4. I am no networking expert but Momos is to my knowledge wrong in his "safe" approach. MAC address is a Layer 2 thing, everything outside your WAN is Layer 3 and the MAC adress can be pretty much anything on that side depending how the traffic is handled, which is obviously out of your control. Thus, MAC filtering will only do you good inside your own network as you simply can't trust MAC packets hitting your WAN port from the outside. 

     

    There sure is other and possibly better/easier/safer ways of dealing with this but to me this was easy enough as I have a web server running anyway and know my way around in that area.

     

    My approach is to use HTTPS from IFTTT to my own HTTPS server which then activates the HTTP API on my HC2. This way no login information has to be sent publicly. The HTTPS request from IFTTT to my own HTTPS server will include a unique ID and use an obscure port. The HTTPS server will have the HC2 login info stored in a safe way on the system and use it to make a local HTTP request to my HC2. This should make for a fairly safe setup without need to open any ports to the HC2 or giving out HC2 login info. 

     

    I would appreciate any thoughts on this approach. I don't think we'll see any IFTTT integration from fibaro in a long time so this needs to be dealt with. I am sure I am not the first person trying to get this up and running safely. 

     

    vanni177. Have a look over at Stians site as he has written a good explanation on how this can be done but please remember, opening up a port to the internet straight to your HC2 and then sending your login info as clean text over the internet is a really bad idea. Link to the post: 

    Please login or register to see this link.

    Posted (edited)

    Hi,

    thanks StarkJohan.

     

    I checked the blog. But still have some questions.

    To try it out I created a virtual device, 2 buttons; and a new user only access this device, then I wrote in the IFTTT Maker

     

    http://user:[email protected]:xx/api/DeviceID=301&pressButton=1

     

    but this seems not to work, I guess the command is wrong.

    The port for HC should be open as I use it already remotely.

     

    Do you have any suggestion for it?

     

    Actually I want to set a Variable, just use the virtual device as work around.

     

    thanks

     

    One more info; the TCP Port for the virtual device is the same as the HC, is this correct?

     

    Edited by vanni177

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

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