Wifi icon to indicate when API offline
This changes the behavior of Wifi icon: How it was before: - Wifi icon was visible only when the wifi was connected, nothing was shown when wifi was not connected. How it is now: - Wifi icon will have 3 states: - Wifi & API connected: Gray wifi icon - Wifi disconnected: Red wifi-off icon - Wifi connected, but API disconnected (HA is out?): Red api-off icon
This commit is contained in:
@@ -598,6 +598,25 @@ binary_sensor:
|
|||||||
##### API connection status
|
##### API connection status
|
||||||
- platform: status
|
- platform: status
|
||||||
name: ${device_name} Status
|
name: ${device_name} Status
|
||||||
|
on_state:
|
||||||
|
then:
|
||||||
|
- &update_wifi_icon
|
||||||
|
if:
|
||||||
|
condition:
|
||||||
|
wifi.connected:
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
api.connected:
|
||||||
|
then:
|
||||||
|
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000E5A8");
|
||||||
|
- lambda: id(disp1).set_component_font_color("home.wifi_icon", 33808);
|
||||||
|
else:
|
||||||
|
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000F256");
|
||||||
|
- lambda: id(disp1).set_component_font_color("home.wifi_icon", 63488);
|
||||||
|
else:
|
||||||
|
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000E5A9");
|
||||||
|
- lambda: id(disp1).set_component_font_color("home.wifi_icon", 63488);
|
||||||
|
|
||||||
##### START - SENSOR CONFIGURATION #####
|
##### START - SENSOR CONFIGURATION #####
|
||||||
sensor:
|
sensor:
|
||||||
@@ -612,13 +631,7 @@ sensor:
|
|||||||
platform: wifi_signal
|
platform: wifi_signal
|
||||||
update_interval: 60s
|
update_interval: 60s
|
||||||
on_value:
|
on_value:
|
||||||
- if:
|
- *update_wifi_icon
|
||||||
condition:
|
|
||||||
wifi.connected:
|
|
||||||
then:
|
|
||||||
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000E5A8");
|
|
||||||
else:
|
|
||||||
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000FFFF");
|
|
||||||
|
|
||||||
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
|
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
|
||||||
- id: ntc_source
|
- id: ntc_source
|
||||||
|
|||||||
Reference in New Issue
Block a user