8 Commits

Author SHA1 Message Date
Edward Firmo
32d969ed3e Renamed wifi component
To distinct from `wifi_default`
2023-12-19 02:57:27 +01:00
Edward Firmo
9f570eddd7 push-button--momentary-switch 2023-12-19 02:40:17 +01:00
Edward Firmo
a6466b3c75 Push button / Momentary switch 2023-12-19 02:38:43 +01:00
Edward Firmo
a2727e77f4 Update deep_sleep instructions
Based on changes introduced by esphome/esphome#5666
2023-12-19 02:28:02 +01:00
Edward Firmo
626550a082 Add upload blank tft button to advanced package 2023-12-19 02:23:43 +01:00
Edward Firmo
41a4be4bb5 Removing trailing spaces 2023-12-19 02:05:35 +01:00
Edward Firmo
7baff2c54c Add blueprint not detected icon on home page
Helps with #1436
2023-12-19 02:01:36 +01:00
Edward Firmo
647fe27bc0 Change mode on preset home 2023-12-18 23:25:12 +01:00
4 changed files with 76 additions and 26 deletions

View File

@@ -18,6 +18,18 @@ button:
- logger.log: "Button pressed: Exit reparse"
- script.execute: exit_reparse
##### UPDATE TFT BLANK DISPLAY #####
- name: ${device_name} Update TFT display (blank)
platform: template
icon: mdi:file-sync
id: tft_update_blank
entity_category: config
on_press:
- lambda: |-
static const char *const TAG = "button.tft_update_blank";
ESP_LOGD(TAG, "Button pressed: Update TFT display (blank)");
upload_tft->execute("${nextion_blank_url}");
captive_portal:
sensor:

View File

@@ -80,6 +80,7 @@ esp32:
##### WIFI SETUP #####
wifi:
id: wifi_component
power_save_mode: NONE
networks:
- id: wifi_default
@@ -1824,30 +1825,32 @@ script:
- id: refresh_wifi_icon
mode: restart
then:
- if:
condition:
- binary_sensor.is_on: nextion_init
then:
# Update Wi-Fi icon
- if:
condition:
wifi.connected:
then:
- if:
condition:
api.connected:
then:
- lambda: disp1->send_command_printf("api=1");
- lambda: disp1->set_component_text_printf("home.wifi_icon", "%s", "\uE5A8");
- lambda: disp1->set_component_font_color("home.wifi_icon", 33808);
else:
- lambda: disp1->send_command_printf("api=0");
- lambda: disp1->set_component_text_printf("home.wifi_icon", "%s", "\uF256");
- lambda: disp1->set_component_font_color("home.wifi_icon", 63488);
else:
- lambda: disp1->send_command_printf("api=0");
- lambda: disp1->set_component_text_printf("home.wifi_icon", "%s", "\uE5A9");
- lambda: disp1->set_component_font_color("home.wifi_icon", 63488);
- lambda: |-
static const char *const TAG = "script.refresh_wifi_icon";
bool wifi_connected = wifi_component->is_connected();
bool api_connected = api_server->is_connected();
bool blueprint_connected = (not id(version_blueprint).empty());
uint8_t api_val = (wifi_connected and api_connected and blueprint_connected) ? 1 : 0;
ESP_LOGV(TAG, "Wifi: %s", wifi_connected ? "Connected" : "DISCONNECTED");
ESP_LOGV(TAG, "API: %s", api_connected ? "Connected" : "DISCONNECTED");
ESP_LOGV(TAG, "Blueprint: %s", blueprint_connected ? id(version_blueprint).c_str() : "DISCONNECTED");
ESP_LOGV(TAG, "Init: %s", nextion_init->state ? "True" : "False");
ESP_LOGV(TAG, "Nextion api: %i", api_val);
if (nextion_init->state) {
// Update api value on Nextion
disp1->send_command_printf("api=%i", api_val);
// Update Wi-Fi icon color
disp1->set_component_font_color("home.wifi_icon", (api_val > 0) ? 33808 : 63488);
// Update Wi-Fi icon
disp1->set_component_text_printf("home.wifi_icon", "%s",
wifi_connected ?
(api_connected ?
(blueprint_connected ? "\uE5A8" : // mdi:wifi - All right!
"\uE7CF") : // mdi:home-assistant - Blueprint is out
"\uF256") : // mdi:api-off
"\uE5A9"); // mdi:wifi-off
}
- id: service_call_alarm_control_panel
mode: restart

View File

@@ -27,6 +27,7 @@ Table of contents:
- [Bluetooth proxy](#bluetooth-proxy)
- [Logger via UART](#logger-via-uart)
- [Climate custom presets](#climate-custom-presets)
- [Push button / Momentary switch](#push-button--momentary-switch)
 
 
@@ -267,9 +268,16 @@ During this time, nothing will be shown, the screen will be off and therefore no
```yaml
# Define the wake-up button. Use pin 14 for left button or pin 27 for right button
deep_sleep:
wakeup_pin: 14
wakeup_pin:
number: 14
allow_other_uses: true
wakeup_pin_mode: INVERT_WAKEUP
binary_sensor:
- id: !extend left_button
pin:
allow_other_uses: true
time:
- id: !extend time_provider
on_time:
@@ -535,4 +543,31 @@ climate:
- name: Sleep
default_target_temperature_low: 17.5 ${temp_units}
mode: "heat"
```
 
### Push button / Momentary switch
You can set the physical relays to be `on` only while the hardware buttons are pressed, and then back to `off` when the buttons are released:
```yaml
binary_sensor:
# Left button custom action: Push button / Momentary switch - Relay 1
- id: !extend left_button
on_click:
then:
on_press:
then:
switch.turn_on: relay_1
on_release:
switch.turn_off: relay_1
# Right button custom action: Push button / Momentary switch - Relay 2
- id: !extend right_button
on_click:
then:
on_press:
then:
switch.turn_on: relay_2
on_release:
switch.turn_off: relay_2
```

View File

@@ -30,7 +30,7 @@ climate:
- name: Home
default_target_temperature_high: ${target_high} ${temp_units}
default_target_temperature_low: ${target_low} ${temp_units}
mode: "auto"
mode: "heat_cool"
packages:
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml