How would I go about detecting which network I am connected to so that I can flash a LED on the front of a panel? on_connect is generically wifi specific and is not based on the network. As SSID’s are variable over the life of a unit, id prefer that it was based on which definition is specified.
This is what is current:
wifi:
networks:
- ssid: !secret wifi_ssid1
password: !secret wifi_password1
priority: 1
- ssid: !secret wifi_ssid2
password: !secret wifi_password2
priority: 2
- ssid: !secret wifi_ssid3
password: !secret wifi_password3
priority: 3
on_connect:
then:
- light.turn_on:
id: wifi_online
effect: Spulse
brightness: 100%
red: 0%
green: 100%
blue: 0%
This is sort of what I need:
wifi:
networks:
- ssid: network1
password: !secret wifi_password1
priority: 1
on_connect:
then:
- light.turn_on:
id: wifi_online
effect: Spulse
brightness: 100%
red: 0%
green: 100%
blue: 0%
on_disconnect:
then:
- light.turn_on:
id: wifi_online
effect: Spulse
brightness: 100%
red: 100%
green: 0%
blue: 0%
- ssid: network2
password: !secret wifi_password2
priority: 2
on_connect:
then:
- light.turn_on:
id: wifi_online
effect: Spulse
brightness: 100%
red: 0%
green: 0%
blue: 100%
on_disconnect:
then:
- light.turn_on:
id: wifi_online
effect: Spulse
brightness: 100%
red: 100%
green: 0%
blue: 0%
- ssid: network3
password: !secret wifi_password3
priority: 3
The other issue would be if the wifi was provisioned via ap:
Any Ideas would be really appreciated.