Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select screensaver_stop_navigation_path depending on state of switch #232

Open
DJKalz opened this issue May 16, 2024 · 0 comments
Open

Select screensaver_stop_navigation_path depending on state of switch #232

DJKalz opened this issue May 16, 2024 · 0 comments

Comments

@DJKalz
Copy link

DJKalz commented May 16, 2024

Hi

I have a switch in my setup called switch.bedroom_addressable_led_relay_switch and the state can be either on or off.

I also have the wall panel mod to set the dashboard (called called lovelace-test1) in kiosk mode and so show a screensaver after 15 seconds of inactivity.

After the screensaver stops I am trying to set the screensaver_stop_navigation_path: to a lovelace dashboard depending on the state of the switch.bedroom_addressable_led_relay_switch.

If the state of the switch is off I would like the screensaver_stop_navigation_path: to be /lovelace-test1/lighting, and if the state of the switch is on, to be /lovelace-test1/lighting-on.

I am hoping I could do this without using templates and just via the YAML for the dashboard where the screensaver_stop_navigation_path: is set for the wall panel mod.

Here is the code I am using, but it isn't working.

title: Test1
wallpanel:
  enabled: true
  hide_toolbar: true
  hide_sidebar: true
  fullscreen: true
  idle_time: 15
  fade_in_time: 5
  display_time: 0
  screensaver_stop_navigation_path: |
      [[[
        if (states['switch.bedroom_addressable_led_relay_switch'].state == 'off')  return '/lovelace-test1/lighting';  return '/lovelace-test1/lighting-on';
      ]]]

What the code above does is set the screensaver_stop_navigation_path: to:

/lovelace-test1/[[[%20%20if%20(states[%22switch.bedroom_addressable_led_relay_switch%22].state%20==%20%22off%22)%20%20return%20%22/lovelace-test1/lighting%22;%20%20return%20%22/lovelace-test1/[[[%20%20if%20(states[%22switch.bedroom_addressable_led_re...

and hence fails to set the dashboard depending on the state of the switch.

Thanks in advance for any help, Kal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant