Wake-up panel when sleep mode is disabled (#698)
The panel will wake-up to Home page if it is on screen saver page (sleeping) when sleep mode is disabled. This solves #696
This commit is contained in:
@@ -3347,6 +3347,7 @@ trigger_variables:
|
|||||||
nspaneltemp: 'sensor.{{ nspanel_name }}_temperature'
|
nspaneltemp: 'sensor.{{ nspanel_name }}_temperature'
|
||||||
settings_entity: 'sensor.{{ nspanel_name }}_settings_entity'
|
settings_entity: 'sensor.{{ nspanel_name }}_settings_entity'
|
||||||
reboot_button: 'button.{{ nspanel_name }}_restart'
|
reboot_button: 'button.{{ nspanel_name }}_restart'
|
||||||
|
switch_sleep_mode: 'switch.{{ nspanel_name }}_sleep_modus'
|
||||||
|
|
||||||
##### notification Trigger #####
|
##### notification Trigger #####
|
||||||
notification_unread: 'switch.{{ nspanel_name }}_notification_unread'
|
notification_unread: 'switch.{{ nspanel_name }}_notification_unread'
|
||||||
@@ -4634,6 +4635,13 @@ trigger:
|
|||||||
path: !input 'tft_path'
|
path: !input 'tft_path'
|
||||||
id: tft_upload
|
id: tft_upload
|
||||||
|
|
||||||
|
##### Trigger - Sleep mode ###########################################################################################################
|
||||||
|
- platform: event
|
||||||
|
event_type: state_changed
|
||||||
|
event_data:
|
||||||
|
entity_id: "{{ switch_sleep_mode }}"
|
||||||
|
id: sleep_mode_state
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
##### CLOSE - Trigger #####
|
##### CLOSE - Trigger #####
|
||||||
#############################################################
|
#############################################################
|
||||||
@@ -4722,7 +4730,7 @@ action:
|
|||||||
milliseconds: '{{ delay_value }}'
|
milliseconds: '{{ delay_value }}'
|
||||||
- service: '{{ nextion.commands.printf }}'
|
- service: '{{ nextion.commands.printf }}'
|
||||||
data:
|
data:
|
||||||
cmd: page home
|
cmd: "page {{ nextion.pages.home }}"
|
||||||
continue_on_error: true
|
continue_on_error: true
|
||||||
|
|
||||||
##### NSPanel event #####
|
##### NSPanel event #####
|
||||||
@@ -7336,6 +7344,21 @@ action:
|
|||||||
data: {}
|
data: {}
|
||||||
continue_on_error: true
|
continue_on_error: true
|
||||||
|
|
||||||
|
##### Wake-up when slee mode is disabled #####
|
||||||
|
- alias: Sleep mode changed
|
||||||
|
conditions:
|
||||||
|
- condition: trigger
|
||||||
|
id: sleep_mode_state
|
||||||
|
- "{{ nspanel_event.page == nextion.pages.screensaver }}"
|
||||||
|
- "{{ trigger.event.data.old_state.state == 'on' }}"
|
||||||
|
- "{{ trigger.event.data.new_state.state == 'off' }}"
|
||||||
|
sequence:
|
||||||
|
- *delay-default
|
||||||
|
- service: "{{ nextion.commands.printf }}"
|
||||||
|
data:
|
||||||
|
cmd: "page {{ nextion.pages.home }}"
|
||||||
|
continue_on_error: true
|
||||||
|
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
##### CLOSE - Action #####
|
##### CLOSE - Action #####
|
||||||
|
|||||||
Reference in New Issue
Block a user