wecker/rgb.sh
Ratatoskr 987469140e
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.
2024-02-09 08:35:24 +01:00

40 lines
889 B
Bash

#!/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