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

Ping local IP, trigger for scene?


Question

Posted

Is there a way to ping a local static IP and start a scene when that IP is not connected within HC2? 

 

I have a unit that tends to drop out of the network from time to time, a reboot fixes it and I want to use a wall plug to turn off/on when that happens. 

16 answers to this question

Recommended Posts

  • 0
Posted
9 minutes ago, Spindel said:

Is there a way to ping a local static IP and start a scene when that IP is not connected within HC2? 

 

I have a unit that tends to drop out of the network from time to time, a reboot fixes it and I want to use a wall plug to turn off/on when that happens. 

@Spindel

 

Assuming it's a HC2 query, the following Network Monitor I wrote may help

I hope to have a HC3 version in the next few weeks

 

  • 0
Posted (edited)

Please login or register to see this link.

if you decied write wathc dog - replace 127.0.0.1

 

simple (sample) VD attached

 

Please login or register to see this code.

Please login or register to see this image.

/monthly_2020_02/image.png.76c6aa07e7a26c186403944aec03da8e.png" />

image.png.8531055c787ee9ece2a4f1fac3219d95.png

Please login or register to see this attachment.

4 hours ago, AutoFrank said:

@Spindel

 

Assuming it's a HC2 query, the following Network Monitor I wrote may help

 

Do we end up on the occasional goose chase (for this situation)?

Edited by 10der
  • 0
Posted
6 hours ago, Spindel said:

Is there a way to ping a local static IP and start a scene when that IP is not connected within HC2?

I have a unit that tends to drop out of the network from time to time, a reboot fixes it and I want to use a wall plug to turn off/on when that happens. 

 

As I understand you want to verify with HC2 that some device doesn't lost connection, right?

Ping command is not supported by HC2 Lua, but if you can send any HTTP query to this device then you can do it.

  • 0
  • Inquirer
  • Posted
    3 hours ago, cag014 said:

     

    As I understand you want to verify with HC2 that some device doesn't lost connection, right?

    Ping command is not supported by HC2 Lua, but if you can send any HTTP query to this device then you can do it.

     

    Correct! 

     

    I don't know about th Http query, the device is a google nest hub max. 

    • 0
    Posted

     I have Google home where I do same as you requested.... don't know if nest supports same query. (depends on which port is open)

    Let me know if you want me to post mine Google Home connection test VD to try if it helps you?

    • 0
    Posted

    Google harmony guys in this post I have provided the native function from Fibaro 

    • 0
  • Inquirer
  • Posted
    11 hours ago, cag014 said:

    Let me know if you want me to post mine Google Home connection test VD to try if it helps you?

     

    It's worth a shot, yes please! 

     

    8 hours ago, 10der said:

    Google harmony guys in this post I have provided the native function from Fibaro 

     

    I'm sorry, I don't understand? 

    • 0
    Posted
    1 hour ago, Spindel said:

    It's worth a shot, yes please! 

    Here is it

     

    please change IP according to your setup and add your code in IF statement (marked red) in VD's main loop.

    Currently I check connection every minute, change according to your need.

     

    local res,googleHome,tcpSocket=0,{"off-line","on-line"},Net.FTcpSocket("10.0.0.162",8008)
    res=tcpSocket:write(string.char(0x16));tcpSocket:disconnect()
    if res==1 then
      -- add your code, device on-line
    else
      -- add your code, device off-line
    end
    fibaro:debug("[res="..res.."] Google Home is "..googleHome[res+1])
    fibaro:call(fibaro:getSelfId(), "setProperty", "ui.Label1.value", googleHome[res+1])
    fibaro:sleep(60000)

     

    By the way, I'm about to purchase Google Next Max (10" display) so could you please let me know if it works.

    or I need to find a new solution.

    Please login or register to see this attachment.

    • 0
  • Inquirer
  • Posted
    4 hours ago, cag014 said:

    By the way, I'm about to purchase Google Next Max (10" display) so could you please let me know if it works.

    or I need to find a new solution.

     

     It works! (but...)

     

    It senses my local IP as online (on-line shown in VD) when I import your VD and it also senses when I pull the plug (off-line shown in VD).

     

    However, I think it somehow blocks my Nest Hub since it can´t connect to my network when the VD is imported. I tried removing the VD and rebooting the Nest Hub and it connects directly when booted.

    • 0
    Posted
    35 minutes ago, Spindel said:

    However, I think it somehow blocks my Nest Hub since it can´t connect to my network when the VD is imported. I tried removing the VD and rebooting the Nest Hub and it connects directly when booted.

    This is very weird... while Nest not connected it cannot create communication.

    Any how, I think the solution is when it is off-line you're switching the power Off/On, right. So please add fibaro:sleep(xxx) as long as it takes to Nest to connect back to network (plus several seconds to be on safe side)

    Let's see if it works.

     

    • 0
    Posted

    Another idea, as far as I know there are two addition ports that could be used: 8009, 8443.

    Try that also

    • 0
  • Inquirer
  • Posted

     

    9 hours ago, cag014 said:

    Any how, I think the solution is when it is off-line you're switching the power Off/On, right. So please add fibaro:sleep(xxx) as long as it takes to Nest to connect back to network (plus several seconds to be on safe side)

    Let's see if it works.

     

     

    I actually tried without adding any code after if/else just to check the connection without doing anything. Do you think that could mess it up?

     

    Please login or register to see this image.

    /monthly_2020_02/image.png.284359cc3d53310ed144bc067422859c.png" />

     

    image.png.f6ad9a0d69ebc85f389f20bce751adb0.png

    • 0
  • Inquirer
  • Posted

    I tried some changes and now it seems to work nicely.

     

    New port and a little sleep did the trick. You can see my power consumption graph below.

    At first my sleep probably was to low (60s) so it couldn´t connect. 120s seems to work and is good enough for me, maybe I´ll try a lower number later on.

     

     

    Please login or register to see this image.

    /monthly_2020_02/image.png.9f6d0d847c58085c19b4e89f3be0e927.png" />

     

    image.png.851cd81ed8373222288b6b2a8ed85724.png

    • 0
    Posted

    Looks great... well done

    • 0
    Posted
    On 2/15/2020 at 8:59 PM, AutoFrank said:

    @Spindel

     

    Assuming it's a HC2 query, the following Network Monitor I wrote may help

    I hope to have a HC3 version in the next few weeks

     

    @AutoFrank did you ever invest time to create a HC3 version of Network Device Monitor?

    • 0
    Posted

    @Drewb if not, maybe look overhere:

     

    Please login or register to see this link.

     

     

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