Compare commits

..

No commits in common. "6b20f31fc22a9009eb35d68b56c2ce1a1c0d0907" and "a61f9f2d2d2101b9cdb564cbe74b7e239086f0a9" have entirely different histories.

5 changed files with 25 additions and 54 deletions

View File

@ -26,7 +26,8 @@ mp3_dir="/sdcard/.mp3"
# remove old files
rm -f "$txt_dir"/*complete.txt
# open handout.html file
# open handout.md file
#am start --user 0 -a android.intent.action.VIEW -d content://pl.solidexplorer2.files/storage/emulated/0/.text/handout.html -t text/html
am start --user 0 -n org.bromite.chromium/org.chromium.chrome.browser.ChromeTabbedActivity -d content://pl.solidexplorer2.files/storage/emulated/0/.text/handout.html -t text/html
# Function to create MP3 files

View File

@ -14,7 +14,7 @@ html_file="$text_dir/handout.html"
all=("date" "time" "weather") # Add more elements as needed
# remove files in text_dir
rm -rf $text_dir/*
rm -f $text_dir/*
# Function to get the IP address of Lisa's iPhone
check_ip() {

View File

@ -21,10 +21,6 @@ for ((volume = 20; volume <= 100; volume += 10)); do
# Wait for the completion of the current mpv process before starting the next one
wait
while [[ volume == 100 ]]; do
/data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg &
done
done
# End of the script

39
rgb.sh
View File

@ -1,39 +0,0 @@
#!/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

View File

@ -34,6 +34,11 @@ done
# Adjust brightness and color temperature in ioBroker
# Colors
red="ff0000"
green="00ff00"
blue="0000ff"
iobroker state set zigbee.0.04cd15fffee03198.state false
iobroker state set zigbee.0.04cd15fffee03198.brightness 1
iobroker state set zigbee.0.04cd15fffee03198.colortemp 1600
@ -53,6 +58,12 @@ set_colortemp() {
echo "Current Colortemp: $colortemp_value"
}
set_color() {
local color_value=$1
# Replace 'zigbee.0.04cd15fffee03198.color' with the actual ioBroker address for color
iobroker state set zigbee.0.04cd15fffee03198.color "$color_value"
}
# Get the IP address of Lisa's iPhone (without ping test)
check_ip() {
mac_address="e4:cd:d1" # Replace this with the MAC address
@ -125,9 +136,8 @@ check_notification() {
# Alarm turned off
date && echo "Alarm turned off."
echo "$output"
pkill rgb.sh # Kill the rgb.sh script
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv'
iobroker state set zigbee.0.04cd15fffee03198.state false
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv' &
/root/iobroker_scripts/general/generate_text.sh # Call generate_text.sh script
exit # Exit the script when the alarm is turned off
else
@ -139,7 +149,7 @@ check_notification() {
fi
done
# Phone could not be reached.
# Phone could not be reached.
echo "Phone could not be reached after $max_attempts attempts."
date && echo "Alarm turned off."
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv'
@ -219,8 +229,6 @@ current_colortemp="$end_colortemp"
set_brightness "$end_brightness"
set_colortemp "$end_colortemp"
/root/iobroker_scripts/schlafzimmer/rgb.sh >/dev/null & # Call the rgb.sh script
# Execute the check_ip function.
check_ip
echo "$A72_ip"
@ -264,12 +272,17 @@ if [ $current_brightness -eq $end_brightness ] && [ $current_colortemp -eq $end_
fi
else
check_external_light_status
set_color "$green"
sleep 5
set_color "$red"
sleep 5
set_color "$blue"
check_notification #&
fi
if [ "$alarm_dismissed" = true ]; then
echo "Alarm dismissed"
exit # Exit the script when the alarm is dismissed
fi
if [ "$alarm_dismissed" = true ]; then
echo "Alarm dismissed"
exit # Exit the script when the alarm is dismissed
fi
done
fi