Ping to local PC

I would like to check status of my local PC via simple script:

var p = actions.Ping.checkVitality(“”, 0, 1000);

but the script returns “false”.
If i use ping on commad line it is OK.

If I use script for my other device like TV, Raspberry it is OK as well.

Any idea, what is wrong? Firewall is deactivated, but I am still getting “false”.

Thank you.

Why not using network binding with ping device ?

I know “Network binding”, but I don’t like that it pings every for example “60 seconds” to check the status.
I can not force ping via “Network binding” to check status, can I?

You can change refresh to a higher value.

Yes I can, but if I ask about the status between two refreshes and the status has changed in the meantime, I will not get the current value. If I understand correctly?

Let’s ask this the other way around: when were you planning on running this rule which would ping your device? What would trigger it?

I am a beginner with OpenHAB, but I would like to turn off e.g. the socket that powers my notebook after locking house via Nuki, but only if the notebook is no longer active, which I wanted to verify e.g. via ping.

Maybe exists some better solution…

Just use the Network Binding, as @hmerk recommended.

Why not?

I wanted to use ping only when I really need it. But if there’s no other way, I guess I’ll have to use “Network binding”.

I was rather surprised that ping on TV and other devices works properly and on PC, it doesn’t. I guess it has to do with some settings on the PC…

Perhaps try with a port different from 0 ….