Optimizing Roller Shutter Button Control with a Simple Script

I recently embarked on electrifying my roller shutters, aiming to provide guests with an intuitive button control system. After experimenting with traditional roller shutter switches, I found them cumbersome and non-intuitive. Here’s how I transformed the experience using a simple script.

The Challenge

Initially, I used a setup involving cheap JAROLIFT motors, Shelly Plus2PM, and Jung switches. While functional, the control mechanism required guests to press the same button again to stop the shutter, which was confusing and led to frequent misuse.

The Solution

I developed a script to streamline the process. The goal was to ensure any button press would stop the shutter movement immediately, making it user-friendly for everyone.

javascript
let s = “stopped”;
Shelly.addStatusHandler(function(e) {
if (e.component === “input:0” && e.delta.state) {
Shelly.call(s === “opening” || s === “closing” ? “Cover.stop” : “Cover.open”, { id: 0 });
} else if (e.component === “input:1” && e.delta.state) {
Shelly.call(s === “opening” || s === “closing” ? “Cover.stop” : “Cover.close”, { id: 0 });
} else if (e.component === “cover:0” && e.delta.state !== undefined) {
s = e.delta.state;
}
});

The Outcome

This script revolutionized the user experience. Guests no longer need to remember complex sequences; any button press now intuitively stops or reverses the shutter movement. I hope Shelly considers integrating this feature in future updates!

If you’ve faced similar challenges, feel free to adapt this script to your setup. Let’s continue innovating and enhancing our smart homes together! :rocket: