diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 1655bf7..d70935e 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -44,7 +44,7 @@ If have used v3.3 or earlier, and then updated to v3.4, there's a chance the ent 1. The network settings was moved to under `networks` on the `wifi` section. If you are using advanced/custom settings for Wi-Fi on ESPHome, you may have to update it in order to follow the new format. 1. The sensor "Uptime" is deprecated. It was replaced by "API timestamp" and "Device timestamp" sensors, which makes it more readable to humans on Home Assistant interface and shows respectively the last time the API got connected (between the panel and Home Assistant) and the last time the device started. Thanks to @WZYProjects (#986 and #998) for the new sensors.
1. Service `esphome.xxxxx_qr_code` is deprecated. It was replaced by service `qrcode` which can be used for changing the QRcode value even when the QRcode page is not visible (useful when using dynamic Wi-Fi credentials). -1. Removed switches "Relay 1 Local Fallback" and "Relay 2 Local Fallback", together with the relay fallback inputs. Now when you assign your panel's relay to it's respective button the control will be fully local and therefore will have the same behavior as the "fallback" in previous versions. +1. Removed switches "Relay 1 Local Fallback" and "Relay 2 Local Fallback". Now when you assign your panel's relay to it's respective button the control will be fully local and therefore will have the same behavior as the "fallback" in previous versions, and you can still force a fallback in the blueprint settings when you want to have it working locally (to the respective relays) even when the buttons are assigned to other entities. 1. The "Hardware button long press hold delay" input was removed and the delay (800ms) is now hard coded in ESPHome. 1. The service `esphome.xxxxx_wake_up_display` was deprecated. Please use `esphome.xxxxx_wake_up` instead. 1. The services `esphome.xxxxx_send_command_font_color` and `esphome.xxxxx_send_command_background_color` where deprecated. Please use `esphome.xxxxx_set_component_color` instead, and you can use RGB arrays for `foreground` and `background` colors, a 1-element array with the Nextion color code or an empty array if you don't want to change that specific parameter. diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index c5dfc57..e2a1ca7 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -897,6 +897,17 @@ blueprint: default: ' ' selector: *placeholder-selector ##### PLACEHOLDER ###################################################################### + relay_1_local_fallback: + name: Activate relay 1 local fallback - TRUE/FALSE (Optional) + default: false + description: > + *SYSTEM settings* + + *activate this to use left button to toggle relay 1 if display is offline* + + *When button left is using the entity related to relay 1 the processing will always be local, even if fallback is disabled.* + selector: + boolean: left_button_entity: name: Left hardware button - ENTITY (Optional) description: > @@ -959,6 +970,17 @@ blueprint: *LABEL color which should be displayed* default: [200, 204, 200] #52857 Grey super light selector: *color-selector + relay_2_local_fallback: + name: Activate relay 2 local fallback - TRUE/FALSE (Optional) + default: false + description: > + *SYSTEM settings* + + *activate this to use right button to toggle relay 2 if display is offline* + + *When button right is using the entity related to relay 2 the processing will always be local, even if fallback is disabled.* + selector: + boolean: right_button_entity: name: Right hardware button - ENTITY (Optional) description: > @@ -6426,9 +6448,11 @@ action: relay1: icon: !input 'relay01_icon' #E3A5 icon_color_rgb: !input 'relay01_icon_color' + fallback: !input 'relay_1_local_fallback' relay2: icon: !input 'relay02_icon' #E3A8 icon_color_rgb: !input 'relay02_icon_color' + fallback: !input 'relay_2_local_fallback' - &variables-home_buttons variables: @@ -6533,6 +6557,7 @@ action: if is_number(hardware.relays.relay1.icon_color_rgb) else ((hardware.relays.relay1.icon_color_rgb[0] //(2**3)) *(2**11))+((hardware.relays.relay1.icon_color_rgb[1] //(2**2)) *(2**5))+(hardware.relays.relay1.icon_color_rgb[2] //(2**3)) }} + relay1_fallback: '{{ hardware.relays.relay1.fallback }}' relay2_local_control: '{{ hardware.buttons.right.entity == relay02_entity }}' relay2_icon: > {{ @@ -6551,6 +6576,7 @@ action: if is_number(hardware.relays.relay2.icon_color_rgb) else ((hardware.relays.relay2.icon_color_rgb[0] //(2**3)) *(2**11))+((hardware.relays.relay2.icon_color_rgb[1] //(2**2)) *(2**5))+(hardware.relays.relay2.icon_color_rgb[2] //(2**3)) }} + relay2_fallback: '{{ hardware.relays.relay2.fallback }}' date_color: > {{ display.date.color_rgb diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 5f0ec12..0626552 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -416,9 +416,11 @@ api: relay1_local_control: bool relay1_icon: string relay1_icon_color: int + relay1_fallback: bool relay2_local_control: bool relay2_icon: string relay2_icon_color: int + relay2_fallback: bool date_color: int time_format: string time_color: int @@ -434,9 +436,11 @@ api: ESP_LOGV("service.global_settings", "relay1_local_control: %i", (relay1_local_control) ? 1 : 0); ESP_LOGV("service.global_settings", "relay1_icon: %s", relay1_icon.c_str()); ESP_LOGV("service.global_settings", "relay1_icon_color: %i", relay1_icon_color); + ESP_LOGD("service.global_settings", "relay1_fallback: %i", (relay1_fallback) ? 1 : 0); ESP_LOGV("service.global_settings", "relay2_local_control: %i", (relay2_local_control) ? 1 : 0); ESP_LOGV("service.global_settings", "relay2_icon: %s", relay2_icon.c_str()); ESP_LOGV("service.global_settings", "relay2_icon_color: %i", relay2_icon_color); + ESP_LOGD("service.global_settings", "relay2_fallback: %i", (relay2_fallback) ? 1 : 0); ESP_LOGV("service.global_settings", "date_color: %i", date_color); ESP_LOGV("service.global_settings", "time_format: %s", time_format.c_str()); ESP_LOGV("service.global_settings", "time_color: %i", time_color); @@ -456,6 +460,8 @@ api: id(home_relay2_icon) = relay2_icon.c_str(); id(home_relay1_icon_color) = relay1_icon_color; id(home_relay2_icon_color) = relay2_icon_color; + id(relay_1_fallback) = relay1_fallback; + id(relay_2_fallback) = relay2_fallback; // Localization id(mui_time_format) = time_format; @@ -854,6 +860,16 @@ api: ##### START - GLOBALS CONFIGURATION ##### globals: + ###### Relay fallback even when buttons have other entities? ###### + - id: relay_1_fallback + type: bool + restore_value: true + initial_value: 'false' + - id: relay_2_fallback + type: bool + restore_value: true + initial_value: 'false' + ##### Display mode (1 = EU, 2 = US, 3 = US Landscape) - id: display_mode type: int @@ -988,7 +1004,15 @@ binary_sensor: - logger.log: "Left button - Short click" - if: condition: - - switch.is_on: relay1_local + or: + - switch.is_on: relay1_local + - and: + - lambda: !lambda return id(relay_1_fallback); + - or: + - not: + - api.connected: + - not: + - wifi.connected: then: - switch.toggle: relay_1 - script.execute: refresh_relays @@ -1019,7 +1043,15 @@ binary_sensor: - logger.log: "Right button - Short click" - if: condition: - - switch.is_on: relay2_local + or: + - switch.is_on: relay2_local + - and: + - lambda: !lambda return id(relay_2_fallback); + - or: + - not: + - api.connected: + - not: + - wifi.connected: then: - switch.toggle: relay_2 - script.execute: refresh_relays