Compare commits
6 Commits
a61f9f2d2d
...
6b20f31fc2
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b20f31fc2 | |||
| fd6dd6f9bf | |||
| b67b4a657b | |||
| e8599fda30 | |||
| 5224de0d20 | |||
| 987469140e |
@ -26,8 +26,7 @@ mp3_dir="/sdcard/.mp3"
|
|||||||
# remove old files
|
# remove old files
|
||||||
rm -f "$txt_dir"/*complete.txt
|
rm -f "$txt_dir"/*complete.txt
|
||||||
|
|
||||||
# open handout.md file
|
# open handout.html 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
|
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
|
# Function to create MP3 files
|
||||||
|
|||||||
@ -14,7 +14,7 @@ html_file="$text_dir/handout.html"
|
|||||||
all=("date" "time" "weather") # Add more elements as needed
|
all=("date" "time" "weather") # Add more elements as needed
|
||||||
|
|
||||||
# remove files in text_dir
|
# remove files in text_dir
|
||||||
rm -f $text_dir/*
|
rm -rf $text_dir/*
|
||||||
|
|
||||||
# Function to get the IP address of Lisa's iPhone
|
# Function to get the IP address of Lisa's iPhone
|
||||||
check_ip() {
|
check_ip() {
|
||||||
|
|||||||
4
play.sh
4
play.sh
@ -21,6 +21,10 @@ for ((volume = 20; volume <= 100; volume += 10)); do
|
|||||||
|
|
||||||
# Wait for the completion of the current mpv process before starting the next one
|
# Wait for the completion of the current mpv process before starting the next one
|
||||||
wait
|
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
|
done
|
||||||
|
|
||||||
# End of the script
|
# End of the script
|
||||||
|
|||||||
39
rgb.sh
Normal file
39
rgb.sh
Normal file
@ -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
|
||||||
|
|
||||||
31
wecker.sh
31
wecker.sh
@ -34,11 +34,6 @@ done
|
|||||||
|
|
||||||
# Adjust brightness and color temperature in ioBroker
|
# 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.state false
|
||||||
iobroker state set zigbee.0.04cd15fffee03198.brightness 1
|
iobroker state set zigbee.0.04cd15fffee03198.brightness 1
|
||||||
iobroker state set zigbee.0.04cd15fffee03198.colortemp 1600
|
iobroker state set zigbee.0.04cd15fffee03198.colortemp 1600
|
||||||
@ -58,12 +53,6 @@ set_colortemp() {
|
|||||||
echo "Current Colortemp: $colortemp_value"
|
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)
|
# Get the IP address of Lisa's iPhone (without ping test)
|
||||||
check_ip() {
|
check_ip() {
|
||||||
mac_address="e4:cd:d1" # Replace this with the MAC address
|
mac_address="e4:cd:d1" # Replace this with the MAC address
|
||||||
@ -136,8 +125,9 @@ check_notification() {
|
|||||||
# Alarm turned off
|
# Alarm turned off
|
||||||
date && echo "Alarm turned off."
|
date && echo "Alarm turned off."
|
||||||
echo "$output"
|
echo "$output"
|
||||||
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv'
|
pkill rgb.sh # Kill the rgb.sh script
|
||||||
iobroker state set zigbee.0.04cd15fffee03198.state false
|
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
|
/root/iobroker_scripts/general/generate_text.sh # Call generate_text.sh script
|
||||||
exit # Exit the script when the alarm is turned off
|
exit # Exit the script when the alarm is turned off
|
||||||
else
|
else
|
||||||
@ -149,7 +139,7 @@ check_notification() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Phone could not be reached.
|
# Phone could not be reached.
|
||||||
echo "Phone could not be reached after $max_attempts attempts."
|
echo "Phone could not be reached after $max_attempts attempts."
|
||||||
date && echo "Alarm turned off."
|
date && echo "Alarm turned off."
|
||||||
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv'
|
ssh -i /root/.ssh/A72 root@$A72_ip 'killall mpv'
|
||||||
@ -229,6 +219,8 @@ current_colortemp="$end_colortemp"
|
|||||||
set_brightness "$end_brightness"
|
set_brightness "$end_brightness"
|
||||||
set_colortemp "$end_colortemp"
|
set_colortemp "$end_colortemp"
|
||||||
|
|
||||||
|
/root/iobroker_scripts/schlafzimmer/rgb.sh >/dev/null & # Call the rgb.sh script
|
||||||
|
|
||||||
# Execute the check_ip function.
|
# Execute the check_ip function.
|
||||||
check_ip
|
check_ip
|
||||||
echo "$A72_ip"
|
echo "$A72_ip"
|
||||||
@ -272,17 +264,12 @@ if [ $current_brightness -eq $end_brightness ] && [ $current_colortemp -eq $end_
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
check_external_light_status
|
check_external_light_status
|
||||||
set_color "$green"
|
|
||||||
sleep 5
|
|
||||||
set_color "$red"
|
|
||||||
sleep 5
|
|
||||||
set_color "$blue"
|
|
||||||
check_notification #&
|
check_notification #&
|
||||||
fi
|
fi
|
||||||
if [ "$alarm_dismissed" = true ]; then
|
if [ "$alarm_dismissed" = true ]; then
|
||||||
echo "Alarm dismissed"
|
echo "Alarm dismissed"
|
||||||
exit # Exit the script when the alarm is dismissed
|
exit # Exit the script when the alarm is dismissed
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user