From 987469140e57754ad1b3719e08551055a1b2d245 Mon Sep 17 00:00:00 2001 From: Ratatoskr Date: Fri, 9 Feb 2024 08:35:24 +0100 Subject: [PATCH] Initial commit for RGB Cycling Script This commit introduces the RGB Cycling Script for the ioBroker Zigbee Adapter. The script is designed to cycle through RGB colors on an ioBroker device using a zigbee adapter. Author: Michael Haider Description: - The script defines RGB colors: red, green, and blue. - A function 'set_color' is created to set the color on the ioBroker device. - The main loop continuously cycles through the colors: green, red, and blue. - Instructions are provided in the script header to replace the ioBroker address for controlling the color. Usage: 1. Ensure the script has execution permissions (chmod +x rgb.sh). 2. Replace 'zigbee.0.04cd15fffee03198.color' with the actual ioBroker address for color control. 3. Run the script to start cycling through RGB colors. Note: Adjust the sleep intervals or uncomment the sleep commands based on your preferences. --- rgb.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 rgb.sh diff --git a/rgb.sh b/rgb.sh new file mode 100644 index 0000000..d93d715 --- /dev/null +++ b/rgb.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# RGB Cycling Script for ioBroker Zigbee Adapter +# Author: Michael Haider +# Description: This script cycles through RGB colors on an ioBroker device +# using a zigbee adapter. +# Instructions: Replace 'zigbee.0.04cd15fffee03198.color' with the actual +# ioBroker address for controlling the color. +# + +# Colors +red="ff0000" +green="00ff00" +blue="0000ff" + +# Function to set the color on the ioBroker device +set_color() { + local color_value=$1 + iobroker state set zigbee.0.04cd15fffee03198.color "$color_value" +} + +# Main loop to cycle through colors +while true; do + # Set the color to green + set_color "$green" + echo "Color set to green" + #sleep 1 + + # Set the color to red + set_color "$red" + echo "Color set to red" + #sleep 1 + + # Set the color to blue + set_color "$blue" + echo "Color set to blue" + #sleep 1 +done +