24 lines
757 B
YAML
24 lines
757 B
YAML
alias: Kiosk Auto-Scroll
|
|
description: Auto-scroll dashboard cards every 5 seconds
|
|
trigger:
|
|
- platform: state
|
|
entity_id: browser_mod.browser_kiosk
|
|
to: 'on'
|
|
action:
|
|
- delay: '00:00:03'
|
|
- service: browser_mod.execute_script
|
|
target:
|
|
entity_id: browser_mod.browser_kiosk
|
|
data:
|
|
command: |
|
|
(function() {
|
|
const cards = Array.from(document.querySelectorAll('ha-card'));
|
|
cards.forEach(card => card.style.minHeight = window.innerHeight + 'px');
|
|
let i = 0;
|
|
setInterval(() => {
|
|
i = (i + 1) % cards.length;
|
|
cards[i].scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
}, 5000);
|
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
})();
|