Looking to trigger an automation to so something (inside ESP, not a HA automation) when wifi connection is lost. I’ve seen the wifi signal sensor, but what’s the value I’m looking for when signal is gone?
Thanks!
Looking to trigger an automation to so something (inside ESP, not a HA automation) when wifi connection is lost. I’ve seen the wifi signal sensor, but what’s the value I’m looking for when signal is gone?
Thanks!
Thanks; however Tasmota won’t suit my needs on this one, looking for an ESPHome solution!
This will turn off a switch if connection to HA is lost, whatever the reason
text_sensor:
- platform: homeassistant
name: "Uptime from Home Assistant"
id: watchdog
entity_id: sensor.time
on_value:
then:
- lambda: !lambda |-
auto time_now = id(homeassistant_time).utcnow();
id(last_value_from_ha) = time_now.timestamp;
interval:
- interval: 15s
then:
- if:
condition:
- lambda: !lambda |-
auto time_now = id(homeassistant_time).utcnow();
if(time_now.timestamp - id(last_value_from_ha) > 120)
return true;
return false;
then:
- switch.turn_off: ventil # lost connection, turn off
time:
- platform: homeassistant
id: homeassistant_time
globals:
- id: last_value_from_ha
type: int
initial_value: '0'
Exactly what I was looking for. Great!
Many thanks.
Sorry to resurrect an old one. How do I use the inverse of this i.e. a condition if wifi.connected is false?
Thanks!
You might use the “else” case, not just the “then”.
Now there’s a facepalm moment. Thanks!