Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request. Ping command #7176

Closed
Aint-Nobody opened this issue Dec 10, 2019 · 17 comments · Fixed by #8119
Closed

Feature Request. Ping command #7176

Aint-Nobody opened this issue Dec 10, 2019 · 17 comments · Fixed by #8119
Labels
duplicated Result - Duplicated Issue feature request (devs?) Action - awaiting response from developers

Comments

@Aint-Nobody
Copy link

  1. it will be great to have a command/rule like "if ping [1.2.3.4 and/or 4.5.6.7] true/false do ...".
    Example: So it will be possible, when you leave your home with your smartphone, to detect if you at home or not. So you can automate turn off all you have to turn off. Or turn on/off your homealarm or some other stuff.

2.expand the command websend in this way, that i can define what will be send.
(Like as unix wget)
So it will be possible for example: to control my ipcam turn on or off ftp upload ect. Or turn around PTZ to different positions. Or some other stuff.

Have you looked for this feature in other issues and in the wiki?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

(Please, remember to close the issue when the problem has been addressed)

@ascillato
Copy link
Contributor

Ping was already requested (see old issues) but noone got enough interested on spending time programming a driver for that due with a home automation software, all those functions are already implemented and working fine with much more features that can be added to Tasmota. That is why, those types of automations are recommended to be configured in your Home Automation Software.

@meingraham
Copy link
Collaborator

Perhaps the Ping capability can be implemented with a dedicated slave (via TasmotaSlave) but Tasmota isn't built to do this itself in its normal processing loop. You would have to think of this as a "sensor" that is sending telemetry to Tasmota and what the sensor is doing is pinging a set of resources to determine presence. Then you can use Tasmota with a Rule that triggers when the "sensor" meets the rule trigger condition.

However, by the time you do this, you are in essence offloading this presence detection to another entity... and that might as well be a script running on a server, your PC, etc. For example, in a HAB (openHAB, Home Assistant, etc.). Then the HAB can send this presence status to Tasmota (any and all devices you want included) without taxing each Tasmota device with this extra task... and load.

As for your second feature, what do you mean "in this way"? Send to multiple IPs? You can do this with a Backlog and multiple WebSend. But perhaps I don;t understand what you are suggesting.

Net-net, I think this really ends up being a Level 2 HAB function.

@Aint-Nobody
Copy link
Author

@meingraham

the second feature means, websend has it own structure. i can not change what will be send.
what behind the slash is "http:///cm?cmnd=POWER1 ON" i cant define.
so i would send a string like this for example:
http://10.1.1.11/decoder_control.cgi?command=94&user=admin&pwd=1234

Sure, in a homeautomation software you can do all u want.
But if i have only 3-8 tasmota devices, only for this i dont want to run a server all time to do this.

@meingraham
Copy link
Collaborator

So, you are proposing that WebSend become more of a curl command? I would suggest WebSend is retained to send Tasmota commands. Then you can add a new curl command that allows sending "custom" commands via HTTP.

As for the "presence" request and, the other part of this is what methods of detecting presence would users want supported: detecting an IP address for a Wi-Fi connected mobile device? Or Bluetooth? Or ...? What share of the user community would use this weighed against the "demand" this would place on Tasmota execution.

For a small deployment 3-8 devices, you can run MQTT and NodeRed on a Pi0 ($10). Or openHAB on 1 Pi4 ($35).

@ascillato2 ascillato2 changed the title Ideas for new functions Feature Request. Ping command Dec 10, 2019
@ascillato2 ascillato2 added the feature request (devs?) Action - awaiting response from developers label Dec 10, 2019
@ascillato2
Copy link
Collaborator

Added the label Feature Request to see if there is someone interested on writing a PR for a new PING command for Tasmota with a rule trigger.

@ascillato2
Copy link
Collaborator

ascillato2 commented Dec 10, 2019

About websend, please, re read the command description (the first sentence). That link is already supported.

00:23:57 CMD: websend [10.1.1.11:80] /decoder_control.cgi?command=94&user=admin&pwd=1234
00:23:57 CMD: Grupo 0, Índice 1, Comando "WEBSEND", Datos "[10.1.1.11:80] /decoder_control.cgi?command=94&user=admin&pwd=1234"

@meingraham
Copy link
Collaborator

Yeah, didn't bother to re-read assuming the OP had already tested. Yes, I assumed - my bad! 😉

@Aint-Nobody
Copy link
Author

@ascillato2
websend [10.1.1.10:80] /decoder_control.cgi?command=33&user=adminclaus&pwd=Ksjw4gbp
that is exactly what i searched for, and it works perfect.
Thank you for this advice.

@Aint-Nobody
Copy link
Author

@meingraham
Yes thats it, to detect if a mobiledevice is connected to local wifi.
May you can also detect if your smart TV is on or off.
Or many more other situations.

But i think, the consumtion will ingrease inmens if the device need to send a ping every second?

I solved this with my old gatewayrouter (AVM FRITZBOX!) this old one you can connect by telnet.
There is running a small bashscript in loop that checked by ping some ip addresses and react if need. That works fine and the router run 24/7 anyway. With this method i can also swich on/off /activate rules/.... tasmota devices by http command.

@meingraham
Copy link
Collaborator

Bingo... Delegate presence detection to a higher level device in your automation architecture.

@ascillato
Copy link
Contributor

I solved this with my old gatewayrouter

great to know that you have found a solution for your use-case. So, that means that this feature request is no longer required? In that case, please close it. Thanks.

@MarkCiliaVincenti
Copy link

I'd like this feature to be honest. I plan on using MQTT to publish sensor data to the cloud, but I'd also like to ping specific IP addresses (configurable). That's something that needs to run on-premise (on the network Tasmota is on).

@ascillato
Copy link
Contributor

@MarkCiliaVincenti Please see #7176 (comment)

@ascillato2 ascillato2 added the duplicated Result - Duplicated Issue label Mar 21, 2020
@MarkCiliaVincenti
Copy link

@MarkCiliaVincenti Please see #7176 (comment)

I read the whole thread. The OP found a workaround. I'm still looking for this because I will only have a Sonoff on site and need to ping clients.

@MarkCiliaVincenti
Copy link

MarkCiliaVincenti commented Apr 10, 2020

Ping was already requested (see old issues) but noone got enough interested on spending time programming a driver for that due with a home automation software, all those functions are already implemented and working fine with much more features that can be added to Tasmota. That is why, those types of automations are recommended to be configured in your Home Automation Software.

That works if the home automation software is on premise. The issue is that I'm building a cloud service (SaaS) and therefore need the ping to work from the IoT device.

Please re-open this issue :)

@s-hadinger
Copy link
Collaborator

The use case makes sense, I will look at it.

s-hadinger added a commit to s-hadinger/Tasmota that referenced this issue Apr 10, 2020
@s-hadinger
Copy link
Collaborator

s-hadinger commented Apr 10, 2020

It was not very difficult. As mentioned it adds 3KB of Flash so it probably won't be included in the standard distribution. Self-compile and activate #define USE_PING (after Theo merges in development).

Example:

Ping4 192.168.1.203
20:43:59 CMD: Ping4 192.168.1.203
20:43:59 RSL: stat/tasmota_xxx/RESULT = {"Ping":"Done"}
20:44:04 RSL: tele/tasmota_xxx/RESULT = {"Ping":{"192.168.1.203":{"Reachable":true,"Success":4,"Timeout":0,"MinTime":59,"MaxTime":167,"AvgTime":116}}}

Ping4 templates.blakadder.com
20:45:36 CMD: Ping4 templates.blakadder.com
20:45:36 RSL: stat/tasmota_xxx/RESULT = {"Ping":"Done"}
20:45:40 RSL: tele/tasmota_xxx/RESULT = {"Ping":{"185.199.110.153":{"Reachable":true,"Success":4,"Timeout":0,"MinTime":15,"MaxTime":591,"AvgTime":182}}}

arendst added a commit that referenced this issue Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicated Result - Duplicated Issue feature request (devs?) Action - awaiting response from developers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants