[TIPS] Weather button with icons and temps #754
Replies: 3 comments
-
Looks sweet. How do I make the card? |
Beta Was this translation helpful? Give feedback.
-
Looks amazing! Would be great if this could be supported out of the box by selecting the "weather style card" |
Beta Was this translation helpful? Give feedback.
-
Would you mind sharing the YAML for the card itself? I think a few people would be more willing to give it a try, with the actual Bubble Card styling, too. I've used the default weather solution for this. Update: Here's my re-make: I'm sure there's a better way, but here it is. There's room for improvements regarding the CSS styling of both the icon and text-size; but the primary things does work as expected. - type: custom:bubble-card
card_type: button
button_type: state
entity: weather.openweathermap
show_name: false
show_state: true
card_layout: large-2-rows
grid_options:
columns: full
sub_button:
- name: Icon 1h
show_icon: true
show_background: false
- name: Tmp 1h
entity: sensor.weather_1h_temp
show_state: true
show_icon: false
show_background: false
- name: Icon 3h
show_icon: true
show_background: false
- name: Tmp 3h
entity: sensor.weather_3h_temp
show_state: true
show_icon: false
show_background: false
- name: Icon 5h
show_icon: true
show_background: false
- name: Tmp 5h
entity: sensor.weather_5h_temp
show_state: true
show_icon: false
show_background: false
- name: Icon 7h
show_icon: true
show_background: false
- name: Tmp 7h
entity: sensor.weather_7h_temp
show_state: true
show_icon: false
show_background: false
- name: Today
entity: climate.wa_esp_wa_esp_livingroom
show_state: false
show_attribute: true
show_background: false
attribute: current_temperature
icon: mdi:home-thermometer-outline
tap_action:
action: more-info
- name: Today
entity: weather.openweathermap
show_state: false
icon: mdi:thermometer
show_attribute: true
attribute: temperature
show_background: false
tap_action:
action: more-info
styles: |
${subButtonIcon[0].setAttribute("icon", getWeatherIcon(hass.states['sensor.weather_1h'].attributes.icon))}
${subButtonIcon[1].setAttribute("icon", getWeatherIcon(hass.states['sensor.weather_3h'].attributes.icon))}
${subButtonIcon[2].setAttribute("icon", getWeatherIcon(hass.states['sensor.weather_5h'].attributes.icon))}
${subButtonIcon[3].setAttribute("icon", getWeatherIcon(hass.states['sensor.weather_7h'].attributes.icon))} |
Beta Was this translation helpful? Give feedback.
-
I wanted a weather bar with the forecast in 1h, 3h, 5h and 7h.
you need to create an hourly forecast sensor, a temperature sensor for each of the hours you want pulled from the hourly forecast and a condition sensor with the icon.
Beta Was this translation helpful? Give feedback.
All reactions