I just brought a ESP32 WT-ETH01 and planned on a project that requires monitoring hosts using the PING function.
I have read that there does not seem to be a PING component for esphome.
What are my options here? I want to ping about 20 hosts, at various times with just 1 or 2 packets, when packets are lost or the host is offline, then I want to trigger a GPIO output on the ESP32.
Any ideas how I can achieve this?
I am looking at this custom integration, but the ESP will not have access to Homeassistant or even internet or anything.
Question is, once flashing it with the local resource, does it need to be able to access the resource to work or is that resource compiled and uploaded to the esp when flashed?
If you want to take actions on sensor values, see config/influxdb.yaml. In the example, on_value runs an automation (sending the value to influxdb whenever a value is available). Use on_value_range (the documentation) when the sensor value is above, below, or both
The problem is, the value is based on the percentage of packet loss.
Therefor, is changes with the amount of ping sensors. Also, when one sensor detects packet loss it goes to 100% but then when another sensor sends a command of 0& packet loss it changes to 0%
So, when one sensor is offline, it turn the relay does not even switch on (there is quite a delay) before the next relay reports 0% packet loss, as then turns the relay back off.
I honestly dont know where to go from here.
I almost feel like I might be better off with a simple arduino sketch.
If I understand correctly, you want to ping 20 hosts and if all are OK the relay will be turned off, but if 1 or more hosts are offline you want the relay to turn on.
If that’s the case, instead of automating each sensor, wouldn’t it be better to use an “interval” to check if any of the sensors have packet loss > 0 and then turn on the relay?