New backup 2025-05-06 10:45:02
This commit is contained in:
parent
53e371fe6d
commit
59e33875cd
1 changed files with 8 additions and 15 deletions
|
@ -3,21 +3,14 @@
|
||||||
hass_weather_cache="${HOME}/.cache/hass_weather.json"
|
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})"
|
weather_summary="$( hass-cli -a states -i sensor.weather_summary | jq -r '.attributes' )"
|
||||||
condition="$(hass-cli -a states -i sensor.openweathermap_weather | jq -r '.state')"
|
condition="$( jq '.condition' <<< ""${weather_summary}"" )"
|
||||||
# condition_code="$(jq -r '.current_condition[0].weatherCode' ${hass_weather_cache})"
|
condition_code="$( jq '.condition_code' <<< ""${weather_summary}"" )"
|
||||||
condition_code="$(hass-cli -a states -i sensor.openweathermap_weather_code | jq -r '.state')"
|
current_temp="$( jq '.current_temp' <<< ""${weather_summary}"" )"
|
||||||
# current_temp="$(jq -r '.current_condition[0].temp_F' ${hass_weather_cache})"
|
feels_temp="$( jq '.feels_temp' <<< ""${weather_summary}"" )"
|
||||||
current_temp="$(hass-cli -a states -i sensor.openweathermap_temperature | jq -r '.state')"
|
min_temp="$( jq '.min_temp' <<< ""${weather_summary}"" )"
|
||||||
# feels_temp="$(jq -r '.current_condition[0].FeelsLikeF' ${hass_weather_cache})"
|
max_temp="$( jq '.max_temp' <<< ""${weather_summary}"" )"
|
||||||
feels_temp="$(hass-cli -a states -i sensor.openweathermap_feels_like_temperature | jq -r '.state')"
|
humidity="$( jq '.humidity' <<< ""${weather_summary}"" )"
|
||||||
# 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')"
|
|
||||||
updated="$(date '+%Y-%m-%d, %H:%M')"
|
updated="$(date '+%Y-%m-%d, %H:%M')"
|
||||||
|
|
||||||
case "${condition_code}" in
|
case "${condition_code}" in
|
||||||
|
|
Loading…
Add table
Reference in a new issue