Giter Club home page Giter Club logo

Comments (5)

andilge avatar andilge commented on August 16, 2024 1

Goedenavond Tom,

Tnx for getting back so swiftly.

OK, you could successfully safe the lovelace card, I can't. This has nothing to do with the compass card, obviously another issue somewhere in HA.

I got insecure reading
https://github.com/tomvanswam/compass-card#style-band-object
but yeah, you just proven hex color codes are working. Maybe add a he color in the an example to prevent future questions like this?

Closing this PR since there's nothing to improve in the compass card. Again, tnx for all the efforts, very much appreciated.

from compass-card.

tomvanswam avatar tomvanswam commented on August 16, 2024

Hi andildge, thanks I did, I hope you did as well.

Your config only changes the icon color. And in my test env with this config:

type: custom:compass-card
indicator_sensors:
  - sensor: input_number.wind
value_sensors:
  - sensor: input_number.wind
language: en
header:
  title:
    value: Wind
  icon:
    color: '#d4d4d4'
    dynamic_style:
      sensor: input_number.wind
      bands:
        - from_value: 1
          color: '#cdfffe'
        - from_value: 2
          color: '#99ffcd'
        - from_value: 3
          color: '#99ff99'
        - from_value: 4
          color: '#98ff66'
        - from_value: 5
          color: '#9afe00'
        - from_value: 6
          color: '#ccff00'
        - from_value: 7
          color: '#ffff01'
        - from_value: 8
          color: '#ffcc00'
        - from_value: 9
          color: '#fe9900'
        - from_value: 10'
          color: '#ff6600'
        - from_value: 11
          color: '#ff3300'
        - from_value: 12
          color: '#fe0000'

I do see a different icon color when changing the sensor value.

image

image

image

So I'm guessing something else is off. Might be your icon is invalid for the sensor. Or your sensor is not numerical perhaps, but string based.
If you want to have something else change color, you need to add the dynamic_styling to another key in the yaml.

You could post the output on the developer console in your browser when you add the debug: true config option. Maybe I can find something in there.

from compass-card.

tomvanswam avatar tomvanswam commented on August 16, 2024

Well if your yaml is the complete one, it is missing the value and indicator node, might that be the reason you can't save it?

from compass-card.

andilge avatar andilge commented on August 16, 2024

nah, it was wrong code in the lovelace card, my bad. Here the working example

type: custom:compass-card
language: de
tap_action:
  action: more-info
  entity: sensor.weatherbit_wind_speed_km_h

header:
  title:
    value: Wind
  icon:
    color: '#777777'
    dynamic_style:
      sensor: sensor.weatherbit_beaufort
      bands:
        - from_value: 1
          color: '#cdfffe'
        - from_value: 2
          color: '#99ffcd'
        - from_value: 3
          color: '#99ff99'
        - from_value: 4
          color: '#98ff66'
        - from_value: 5
          color: '#9afe00'
        - from_value: 6
          color: '#ccff00'
        - from_value: 7
          color: '#ffff01'
        - from_value: 8
          color: '#ffcc00'
        - from_value: 9
          color: '#fe9900'
        - from_value: 10'
          color: '#ff6600'
        - from_value: 11
          color: '#ff3300'
        - from_value: 12
          color: '#fe0000'

value_sensors:
  - sensor: sensor.weatherbit_wind_speed_km_h
    decimals: 0

indicator_sensors:
  - sensor: sensor.weatherbit_wind_direction
    indicator:
      type: arrow_inward
      dynamic_style:
        sensor: sensor.weatherbit_wind_direction
        show: true

compass:
  north:
    color: '#777777'
    dynamic_style:
      sensor: sensor.weatherbit_beaufort
      bands:
        - from_value: 1
          color: '#cdfffe'
        - from_value: 2
          color: '#99ffcd'
        - from_value: 3
          color: '#99ff99'
        - from_value: 4
          color: '#98ff66'
        - from_value: 5
          color: '#9afe00'
        - from_value: 6
          color: '#ccff00'
        - from_value: 7
          color: '#ffff01'
        - from_value: 8
          color: '#ffcc00'
        - from_value: 9
          color: '#fe9900'
        - from_value: 10'
          color: '#ff6600'
        - from_value: 11
          color: '#ff3300'
        - from_value: 12
          color: '#fe0000'

  circle:
    color: '#777777'
    dynamic_style:
      sensor: sensor.weatherbit_beaufort
      bands:
        - from_value: 1
          color: '#cdfffe'
        - from_value: 2
          color: '#99ffcd'
        - from_value: 3
          color: '#99ff99'
        - from_value: 4
          color: '#98ff66'
        - from_value: 5
          color: '#9afe00'
        - from_value: 6
          color: '#ccff00'
        - from_value: 7
          color: '#ffff01'
        - from_value: 8
          color: '#ffcc00'
        - from_value: 9
          color: '#fe9900'
        - from_value: 10'
          color: '#ff6600'
        - from_value: 11
          color: '#ff3300'
        - from_value: 12
          color: '#fe0000'

from compass-card.

tomvanswam avatar tomvanswam commented on August 16, 2024

No problem, happy it works ;-)

from compass-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.