#is it possible to have any animated

1 messages ยท Page 1 of 1 (latest)

sour condor
#

This is just a mock-up and I hard-coded the weather variable to be cloudy. Just remove that line and ensure you have animated icons that match states and you should be good.
This is a custom:button-card with some styling added to it. Adjust it as needed. yaml type: custom:button-card name: | [[[ return states['climate.hvac'].attributes.temperature + "ยฐF" ]]] custom_fields: icon: | [[[ var weather = states['weather.home'].state; var weather = 'cloudy' return '<img src = "/local/icon/amcharts_weather_icons_1.0.0/animated/' + weather + '.svg" width="50" height="50" />' ]]] styles: grid: - grid-template-areas: '"icon n"' card: - overflow: visible - background: none - border: none - width: 100px - padding: 0px name: - justify-self: right - font-size: 1em - padding-right: 15px - padding-left: 0px custom_fields: icon: - padding-right: 0px(The icon in this case is animated, I just did not take a screen recording to grab it.)

deep geode
#

i got this 1

#

its a card you can download

#

and the rain etc is all animated

empty scaffold
empty scaffold
# deep geode i got this 1

animated weather card i found a few, the problem for me is to configure them without background, boarder and everything except cloud-symbol and temperature

deep geode
empty scaffold
#
            entity: weather.openweathermap
            number_of_forecasts: '1'
            hourly_forecast: false
            forecast: false
            details: false
            current: true
            style:
              left: 10.0%
              top: 5.0%
              width: 20%
              font-size: 70%```
sour condor
#

I'm not familiar with the picture elements card, but looking over the doc, in theory, you should be able to add what I provided as a custom element.

type string Required

Card name with custom: prefix (e.g., custom:my-custom-card

empty scaffold
#

thats how its looking now

#

i dont really know how to change your code to something what is fitting to me ๐Ÿ˜ฆ

sour condor
#

Looking at the code for the custom:weather-card, I can see where it "translates" the weather condition into an icon and I figured out where those icons are stored (https://cdn.jsdelivr.net/gh/bramkragten/weather-card/dist/icons/).
I think I can easily adapt my card to use that information and make something a bit more customizable and then the custom:weather-card wouldn't be needed.

empty scaffold
sour condor
#

In the mean time, see if you can figure out that custom element thing that I mentioned. See if you want add a plain stock HA card to your picture-element and get a better understanding of how that works.

empty scaffold
#

i hope i understood correctly... what i know is that a custom button card is working in the picture elemets card since i am using that for buttons. Like this: yaml - type: custom:button-card entity: light.2er icon: mdi:lightbulb show_icon: false show_name: false show_state: false show_entity_picture: true size: 60% entity_picture: /local/floorplan/button_fail.png state: - value: 'on' entity_picture: /local/floorplan/button_on.png - value: 'off' entity_picture: /local/floorplan/button_off.png style: left: 40.3% top: 37.7% width: 4% styles: card: - background-color: transparent - border: transparent tap_action: action: toggle

sour condor
#

Okay. Cool. Can you show a screenshot of what that looks like on the picture-elements card? (You don't have to show the whole thing; just a portion around it.)

empty scaffold
#

with this weather card i had also additional problem that with different screen size its not getting smaller when the custom button cards are

#

so i would be happy if the result would be a custom button card without that black background

sour condor
#

Yup. Will be the custom:button-card that I posted at the beginning but it will be completely functional. I have most of the code in place. Just have to remember how to call the icon correctly.

#

Just got that working. Now, just need to incorporate figuring out icons between day and night.

empty scaffold
#

maybe i can learn so much from that, that i can build something for the other problem which i also still want to figure out ๐Ÿ˜‰ a clock which is messing around with my screen sizes ...

empty scaffold
#

below and above horizon

sour condor
empty scaffold
#

i would not be able to build that on my own, but i think i understand what is happening somehow in that picture

empty scaffold
# sour condor

Is there any more information which i need to provide or can provide?

sour condor
#

I think that's about it. I just need to finish up with the code. I'm getting the hang of making it work. I just added a variable to make changing to a different weather entity easier should you need to. (I'm testing with openweathermap and all is going well.) Just need to incorporate the sun below horizon part. (Tested to ensure it "sees" the night icons which it did.)

empty scaffold
#

Sounds great, i am starving to try it

sour condor
#

Did you like how the screenshot looked at the very beginning of this thread? Is there anything that I need to do/test first?

#

I think I just about have everything done.

#

The only thing I haven't accounted for is some sort of icon if the weather sensor isn't working but I can figure that out later.

empty scaffold
#

the screenshot from the beginning looks fine only it should be completly transparent background

#

the weathersensor from openweathermap was until now always working ๐Ÿ˜‰ one of the most reliable sensors ๐Ÿ˜‰

sour condor
#

Yeah. Mine disappears every once in a while where I have to reload the integration. Happened during this testing.

empty scaffold
#

happened because of the testing or also fro time to time?

#

never happened for me, maybe an internet connection problem?

sour condor
#

Just from time to time. Probably lost communication and I just happened to be working at the exact time that it did. Maybe went to update and response did not come quick enough.

#

About to paste the code. Line 37 has a hard-coded weather condition. Use this for testing purposes; change the condition from the list above it and then when you're done remove Line 37. var condition = "snowy"

It will also automatically apply your temperature unit too since you're C and I'm F.

empty scaffold
#

okay understood

sour condor
#
type: custom:button-card
variables:
  weather_sensor: weather.openweathermap
name: |
  [[[ return states[variables.weather_sensor].attributes.temperature + " " + states[variables.weather_sensor].attributes.temperature_unit ]]]
custom_fields:
  icon: |
    [[[
      const weatherIconsDay = {
        clear: "day",
        "clear-night": "night",
        cloudy: "cloudy",
        fog: "cloudy",
        hail: "rainy-7",
        lightning: "thunder",
        "lightning-rainy": "thunder",
        partlycloudy: "cloudy-day-3",
        pouring: "rainy-6",
        rainy: "rainy-5",
        snowy: "snowy-6",
        "snowy-rainy": "rainy-7",
        sunny: "day",
        windy: "cloudy",
        "windy-variant": "cloudy-day-3",
        exceptional: "!!",
      };
      
      const weatherIconsNight = {
        ...weatherIconsDay,
        clear: "night",
        sunny: "night",
        partlycloudy: "cloudy-night-3",
        "windy-variant": "cloudy-night-3",
      };
      
      var condition = states[variables.weather_sensor].state;
      var condition = "snowy"
      if (states['sun.sun'] === 'above_horizon') {
        var weather_icon = weatherIconsDay[condition]; 
      } else {
        var weather_icon = weatherIconsNight[condition]; 
      }
      
      return '<img src = "https://cdn.jsdelivr.net/gh/bramkragten/weather-card/dist/icons/' + weather_icon + '.svg" width="50" height="50" />'
    ]]]
styles:
  grid:
    - grid-template-areas: '"icon n"'
  card:
    - overflow: visible
    - background: transparent
    - border: none
    - width: 100px
    - padding: 0px
  name:
    - justify-self: right
    - font-size: 1em
    - padding-right: 15px
    - padding-left: 0px
  custom_fields:
    icon:
      - padding-right: 0px```
empty scaffold
#

mhmmm its not showing up in my floorplan

sour condor
#

Do you need to add something like this? yaml style: left: 40.3% top: 37.7% width: 4%This is from your yaml posted above for the lightbulb.

empty scaffold
#

๐Ÿ˜‰ makes sense

#

and works

#

how to make it bigger?

sour condor
#

Take a look at the styles: then card: section. I had the width set to 100px.

empty scaffold
#

this i tried but its making that longer but not bigger

#

and hight: 300px has no effect

sour condor
#

Well, it does but not in the sense that we're looking for. Line 45 (beginning return '< img) has hard-coded icon size of 50x50.

#

I changed to 100x100 and font-size (near the bottom) to 2em.

empty scaffold
#

looks very good now

sour condor
#

I'm not sure how this is going to play with scalability though.

empty scaffold
#

font size 2em, icon 150x150

#

and width 300px

sour condor
#

Do you want the decimal showing in the temperature or would you rather a whole number instead? (I forgot C likes to use decimals spaces.)

empty scaffold
#

decimal is fine

#

making the browser smaller

sour condor
#

Yeah. I was afraid it was going to do that.

empty scaffold
#

means when i open the plan on the phone it would also not scale down

#

same problem i have with an "clock" what i was showing before

#

what i dont understand is that its working at all other button cards

sour condor
#

Try changing the icon 150x150 to 100% without quotes: width=100% height=100%. I think that will fix the icon. Kind of. The font size should scale.

#

We hard-coded some dimensions that I think need to be addresses.

empty scaffold
sour condor
#

Remove the width from the card section (where you put 300px). Let's let it fit itself automatically and see what it does.

empty scaffold
#

sort of dissapering

sour condor
#

okay. wasn't expecting that.

#

Remember when you added this part:yaml style: left: 40.3% top: 37.7% width: 4%What happens if you change the width here. I think this is part of the picture-element card. Also, your previous example also has size: 60% which I don't think is part of the custom:button-card.

empty scaffold
#

changed width to 30

#

size: 60% is not changing anything

#
            style:
              color: '#ff3e23'
              filter: opacity(60%)
              font-family: Days One
              font-size: 1000%
              left: 92%
              top: 18%
              pointer-events: none
              z-index: 1
              width: 20%
            type: state-label```
#

same problem i have also with this entity

#

its also not scaling

#

even if everything is in %

sour condor
#

Can a font-size be set with a percentage? I think it has to be a value in px or em.

#

From what I understand, em is basically a percentage of a given area.

empty scaffold
#

Good question, i dont really know. But so far i am already Happy with the result and thank you soooo much! If you like we can continue tomorrow. I might be in a different time zone;)

#

1:49 ๐Ÿ˜‰

sour condor
#

I'm in the US (EST). 19:49 here.

#

Feel free to message me or add to the thread here.

empty scaffold
#

Maybe over night anybody else has an idea or had that problem before

sour condor
#

I've seen a bunch of questions regarding picture-elements card asked but I've never been able to help since I don't have experience with it.

empty scaffold
#

Workaround would be seperate Dashboards but that should be the last option

#

Its a quite nice thing with that floorplans

sour condor
#

I live in a rather small apartment. My floorplan would be boring. ๐Ÿ˜†

empty scaffold
#

But since my programming skills are like watching YouTube and following instructions or geht some code and try to implement that, its much Work to understand

#

I have also only appartment

#

And i must day its not boring at all

sour condor
#

I pick up stuff here and there. Doing "projects" like this help me learn because it is something that I wouldn't have thought of doing but will be useful to understand.

empty scaffold
#

I will DM you tomorrow some Screenshots ๐Ÿ˜‰

sour condor
#

Cool. I'll let you get to bed. Talk to you later.

empty scaffold
#

Maybe i get you interested ๐Ÿคช