Compare commits
8 Commits
6e55c61032
...
32d969ed3e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32d969ed3e | ||
|
|
9f570eddd7 | ||
|
|
a6466b3c75 | ||
|
|
a2727e77f4 | ||
|
|
626550a082 | ||
|
|
41a4be4bb5 | ||
|
|
7baff2c54c | ||
|
|
647fe27bc0 |
@@ -18,6 +18,18 @@ button:
|
|||||||
- logger.log: "Button pressed: Exit reparse"
|
- logger.log: "Button pressed: Exit reparse"
|
||||||
- script.execute: 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:
|
captive_portal:
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ esp32:
|
|||||||
|
|
||||||
##### WIFI SETUP #####
|
##### WIFI SETUP #####
|
||||||
wifi:
|
wifi:
|
||||||
|
id: wifi_component
|
||||||
power_save_mode: NONE
|
power_save_mode: NONE
|
||||||
networks:
|
networks:
|
||||||
- id: wifi_default
|
- id: wifi_default
|
||||||
@@ -1824,30 +1825,32 @@ script:
|
|||||||
- id: refresh_wifi_icon
|
- id: refresh_wifi_icon
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
- if:
|
- lambda: |-
|
||||||
condition:
|
static const char *const TAG = "script.refresh_wifi_icon";
|
||||||
- binary_sensor.is_on: nextion_init
|
bool wifi_connected = wifi_component->is_connected();
|
||||||
then:
|
bool api_connected = api_server->is_connected();
|
||||||
# Update Wi-Fi icon
|
bool blueprint_connected = (not id(version_blueprint).empty());
|
||||||
- if:
|
uint8_t api_val = (wifi_connected and api_connected and blueprint_connected) ? 1 : 0;
|
||||||
condition:
|
ESP_LOGV(TAG, "Wifi: %s", wifi_connected ? "Connected" : "DISCONNECTED");
|
||||||
wifi.connected:
|
ESP_LOGV(TAG, "API: %s", api_connected ? "Connected" : "DISCONNECTED");
|
||||||
then:
|
ESP_LOGV(TAG, "Blueprint: %s", blueprint_connected ? id(version_blueprint).c_str() : "DISCONNECTED");
|
||||||
- if:
|
ESP_LOGV(TAG, "Init: %s", nextion_init->state ? "True" : "False");
|
||||||
condition:
|
ESP_LOGV(TAG, "Nextion api: %i", api_val);
|
||||||
api.connected:
|
|
||||||
then:
|
if (nextion_init->state) {
|
||||||
- lambda: disp1->send_command_printf("api=1");
|
// Update api value on Nextion
|
||||||
- lambda: disp1->set_component_text_printf("home.wifi_icon", "%s", "\uE5A8");
|
disp1->send_command_printf("api=%i", api_val);
|
||||||
- lambda: disp1->set_component_font_color("home.wifi_icon", 33808);
|
// Update Wi-Fi icon color
|
||||||
else:
|
disp1->set_component_font_color("home.wifi_icon", (api_val > 0) ? 33808 : 63488);
|
||||||
- lambda: disp1->send_command_printf("api=0");
|
// Update Wi-Fi icon
|
||||||
- lambda: disp1->set_component_text_printf("home.wifi_icon", "%s", "\uF256");
|
disp1->set_component_text_printf("home.wifi_icon", "%s",
|
||||||
- lambda: disp1->set_component_font_color("home.wifi_icon", 63488);
|
wifi_connected ?
|
||||||
else:
|
(api_connected ?
|
||||||
- lambda: disp1->send_command_printf("api=0");
|
(blueprint_connected ? "\uE5A8" : // mdi:wifi - All right!
|
||||||
- lambda: disp1->set_component_text_printf("home.wifi_icon", "%s", "\uE5A9");
|
"\uE7CF") : // mdi:home-assistant - Blueprint is out
|
||||||
- lambda: disp1->set_component_font_color("home.wifi_icon", 63488);
|
"\uF256") : // mdi:api-off
|
||||||
|
"\uE5A9"); // mdi:wifi-off
|
||||||
|
}
|
||||||
|
|
||||||
- id: service_call_alarm_control_panel
|
- id: service_call_alarm_control_panel
|
||||||
mode: restart
|
mode: restart
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ Table of contents:
|
|||||||
- [Bluetooth proxy](#bluetooth-proxy)
|
- [Bluetooth proxy](#bluetooth-proxy)
|
||||||
- [Logger via UART](#logger-via-uart)
|
- [Logger via UART](#logger-via-uart)
|
||||||
- [Climate custom presets](#climate-custom-presets)
|
- [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
|
```yaml
|
||||||
# Define the wake-up button. Use pin 14 for left button or pin 27 for right button
|
# Define the wake-up button. Use pin 14 for left button or pin 27 for right button
|
||||||
deep_sleep:
|
deep_sleep:
|
||||||
wakeup_pin: 14
|
wakeup_pin:
|
||||||
|
number: 14
|
||||||
|
allow_other_uses: true
|
||||||
wakeup_pin_mode: INVERT_WAKEUP
|
wakeup_pin_mode: INVERT_WAKEUP
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- id: !extend left_button
|
||||||
|
pin:
|
||||||
|
allow_other_uses: true
|
||||||
|
|
||||||
time:
|
time:
|
||||||
- id: !extend time_provider
|
- id: !extend time_provider
|
||||||
on_time:
|
on_time:
|
||||||
@@ -535,4 +543,31 @@ climate:
|
|||||||
- name: Sleep
|
- name: Sleep
|
||||||
default_target_temperature_low: 17.5 ${temp_units}
|
default_target_temperature_low: 17.5 ${temp_units}
|
||||||
mode: "heat"
|
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
|
||||||
```
|
```
|
||||||
@@ -30,7 +30,7 @@ climate:
|
|||||||
- name: Home
|
- name: Home
|
||||||
default_target_temperature_high: ${target_high} ${temp_units}
|
default_target_temperature_high: ${target_high} ${temp_units}
|
||||||
default_target_temperature_low: ${target_low} ${temp_units}
|
default_target_temperature_low: ${target_low} ${temp_units}
|
||||||
mode: "auto"
|
mode: "heat_cool"
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
|
climate_base_package: !include advanced/esphome/nspanel_esphome_addon_climate_base.yaml
|
||||||
|
|||||||
Reference in New Issue
Block a user