Hello,
I have a nodemcu8266 which in the arduino code gets a static ip-adres.
Via a binary_sensor ping I get the online or offline state.
I also use mqtt for switch with the nodemcu. I read about the availability_topic.
Which of the two is best to use in an autoomation where the condition should be “if the nodemcu8266 is online”? Are both usefull?
The ping (with interval of 30 seconds) is not very accurate but the measuring is done from the HA side. I could set the interval lower to be accurate.
The availability_topic is triggered from the nodemcu8266, but with a powerfailure the “payload_not_available” is not triggered sent to the broker.