New backup 2025-04-24 16:00:02
This commit is contained in:
parent
4f4a6201ff
commit
8e651f2d7d
3 changed files with 10 additions and 9 deletions
|
@ -14,7 +14,7 @@
|
||||||
(button
|
(button
|
||||||
:width 60
|
:width 60
|
||||||
:height 60
|
:height 60
|
||||||
:onclick "hass-cli -a services -e light.penny_room_all_lights -d light -s toggle"
|
:onclick "hass-cli -a services -I area_id -i left_bedroom -d light -s toggle"
|
||||||
(image
|
(image
|
||||||
:image-width 20
|
:image-width 20
|
||||||
:path "icons/home/shortcuts/personal/ceiling-light-multiple.svg"
|
:path "icons/home/shortcuts/personal/ceiling-light-multiple.svg"
|
||||||
|
|
|
@ -4,19 +4,19 @@ hass_weather_cache="${HOME}/.cache/hass_weather.json"
|
||||||
|
|
||||||
update_cache_json(){
|
update_cache_json(){
|
||||||
# condition="$(jq -r '.current_condition[0].weatherDesc[0].value' ${hass_weather_cache})"
|
# condition="$(jq -r '.current_condition[0].weatherDesc[0].value' ${hass_weather_cache})"
|
||||||
condition="$(hass-cli -a states -e sensor.openweathermap_weather | jq -r '.state')"
|
condition="$(hass-cli -a states -i sensor.openweathermap_weather | jq -r '.state')"
|
||||||
# condition_code="$(jq -r '.current_condition[0].weatherCode' ${hass_weather_cache})"
|
# condition_code="$(jq -r '.current_condition[0].weatherCode' ${hass_weather_cache})"
|
||||||
condition_code="$(hass-cli -a states -e sensor.openweathermap_weather_code | jq -r '.state')"
|
condition_code="$(hass-cli -a states -i sensor.openweathermap_weather_code | jq -r '.state')"
|
||||||
# current_temp="$(jq -r '.current_condition[0].temp_F' ${hass_weather_cache})"
|
# current_temp="$(jq -r '.current_condition[0].temp_F' ${hass_weather_cache})"
|
||||||
current_temp="$(hass-cli -a states -e sensor.openweathermap_temperature | jq -r '.state')"
|
current_temp="$(hass-cli -a states -i sensor.openweathermap_temperature | jq -r '.state')"
|
||||||
# feels_temp="$(jq -r '.current_condition[0].FeelsLikeF' ${hass_weather_cache})"
|
# feels_temp="$(jq -r '.current_condition[0].FeelsLikeF' ${hass_weather_cache})"
|
||||||
feels_temp="$(hass-cli -a states -e sensor.openweathermap_feels_like_temperature | jq -r '.state')"
|
feels_temp="$(hass-cli -a states -i sensor.openweathermap_feels_like_temperature | jq -r '.state')"
|
||||||
# min_temp="$(jq -r '.weather[0].mintempF' ${hass_weather_cache})"
|
# min_temp="$(jq -r '.weather[0].mintempF' ${hass_weather_cache})"
|
||||||
min_temp="$(hass-cli -a states -e sensor.eugene_weather_realfeel_temperature_min_day_0 | jq -r '.state')"
|
min_temp="$(hass-cli -a states -i sensor.eugene_weather_realfeel_temperature_min_day_0 | jq -r '.state')"
|
||||||
# max_temp="$(jq -r '.weather[0].maxtempF' ${hass_weather_cache})"
|
# max_temp="$(jq -r '.weather[0].maxtempF' ${hass_weather_cache})"
|
||||||
max_temp="$(hass-cli -a states -e sensor.eugene_weather_realfeel_temperature_max_day_0 | jq -r '.state')"
|
max_temp="$(hass-cli -a states -i sensor.eugene_weather_realfeel_temperature_max_day_0 | jq -r '.state')"
|
||||||
# humidity="$(jq -r '.current_condition[0].humidity' ${hass_weather_cache})"
|
# humidity="$(jq -r '.current_condition[0].humidity' ${hass_weather_cache})"
|
||||||
humidity="$(hass-cli -a states -e sensor.openweathermap_humidity | jq -r '.state')"
|
humidity="$(hass-cli -a states -i sensor.openweathermap_humidity | jq -r '.state')"
|
||||||
# updated="$(date -r ${hass_weather_cache} '+%Y-%m-%d, %H:%M')"
|
# updated="$(date -r ${hass_weather_cache} '+%Y-%m-%d, %H:%M')"
|
||||||
updated="$(date '+%Y-%m-%d, %H:%M')"
|
updated="$(date '+%Y-%m-%d, %H:%M')"
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ while getopts "a:I:i:d:s:" flag; do
|
||||||
;;
|
;;
|
||||||
I)
|
I)
|
||||||
identify_by="${OPTARG}"
|
identify_by="${OPTARG}"
|
||||||
|
;;
|
||||||
i)
|
i)
|
||||||
identifier="${OPTARG}"
|
identifier="${OPTARG}"
|
||||||
;;
|
;;
|
||||||
|
@ -34,7 +35,7 @@ case "${action}" in
|
||||||
curl -s \
|
curl -s \
|
||||||
-H "Authorization: Bearer ${HA_TOKEN}" \
|
-H "Authorization: Bearer ${HA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"${HA_URL}/api/${action}/${entity_id}" | jq '.'
|
"${HA_URL}/api/${action}/${identifier}" | jq '.'
|
||||||
;;
|
;;
|
||||||
"services")
|
"services")
|
||||||
# echo '{"entity_id": "'"${entity_id}"'"}'
|
# echo '{"entity_id": "'"${entity_id}"'"}'
|
||||||
|
|
Loading…
Add table
Reference in a new issue