New backup 2025-05-06 10:45:02

This commit is contained in:
Penelope Gwen 2025-05-06 10:45:02 -07:00
parent 53e371fe6d
commit 59e33875cd

View file

@ -3,21 +3,14 @@
hass_weather_cache="${HOME}/.cache/hass_weather.json"
update_cache_json(){
# condition="$(jq -r '.current_condition[0].weatherDesc[0].value' ${hass_weather_cache})"
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="$(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="$(hass-cli -a states -i sensor.openweathermap_temperature | jq -r '.state')"
# feels_temp="$(jq -r '.current_condition[0].FeelsLikeF' ${hass_weather_cache})"
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="$(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="$(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="$(hass-cli -a states -i sensor.openweathermap_humidity | jq -r '.state')"
# updated="$(date -r ${hass_weather_cache} '+%Y-%m-%d, %H:%M')"
weather_summary="$( hass-cli -a states -i sensor.weather_summary | jq -r '.attributes' )"
condition="$( jq '.condition' <<< ""${weather_summary}"" )"
condition_code="$( jq '.condition_code' <<< ""${weather_summary}"" )"
current_temp="$( jq '.current_temp' <<< ""${weather_summary}"" )"
feels_temp="$( jq '.feels_temp' <<< ""${weather_summary}"" )"
min_temp="$( jq '.min_temp' <<< ""${weather_summary}"" )"
max_temp="$( jq '.max_temp' <<< ""${weather_summary}"" )"
humidity="$( jq '.humidity' <<< ""${weather_summary}"" )"
updated="$(date '+%Y-%m-%d, %H:%M')"
case "${condition_code}" in