Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] operators for icon/color overrides #426

Closed
jrspowers opened this issue Aug 31, 2022 · 8 comments
Closed

[Feature Request] operators for icon/color overrides #426

jrspowers opened this issue Aug 31, 2022 · 8 comments
Assignees
Milestone

Comments

@jrspowers
Copy link

FEATURE DESCRIPTION

hello my question is whether it is possible with the following so if the state is between 21 degrees & 27 degrees then it should be orange is it more when it turns red see my config below I thought so the temperature and there behind <= to indicate between this state or can it also do others what do you think ?

ADDITIONAL CONTEXT

versie 1
weatherOverrideForecast1:
entity: sensor.openweathermap_forecast_temperature
color: 
   "-25<=": [255, 0, 255]
   "-18<=": [138, 0, 138]
   "-12<=": [128, 0, 128]
   "-7<=": [0,0,255]
   "-1<=": [135,206,236]
   "4<=": [0, 128, 0]
   "10<=": [144, 238, 144]
   "16<=": [255, 2, 255]
   "21<=": [255, 165, 0]
   "27<=": [255, 69, 0]
   "32<=": [255, 0, 0]
   "38<=": [139, 0, 0]
Versie 2
weatherOverrideForecast1:
entity: sensor.openweathermap_forecast_temperature
state:  
   operator: <=
color: 
   "-25": [255, 0, 255]
   operator: <=
   "-18": [138, 0, 138]
   operator: <=
   "-12": [128, 0, 128]
   operator: <=
   "-7": [0,0,255]
   operator: <=
   "-1": [135,206,236]
   operator: <=
   "4": [0, 128, 0]
   operator: <=
   "10": [144, 238, 144]
   operator: <=
   "16": [255, 2, 255]
   operator: <=
   "21": [255, 165, 0]
   operator: <=
   "27": [255, 69, 0]
   operator: <=
   "32": [255, 0, 0]
   operator: <=
   "38": [139, 0, 0]
   operator: <=

### PANEL / FIRMWARE VERION
Please add the Panel/Firmware Version you are using (EU)
@blubbel42
Copy link

This would be extremly useful. I am using the Panel besides other things to display my incoming solar power and battery feed. Battery feed can take positive and negative values, but the gridcard can only display 4 digits. The least significant one is cut away.
Result is I do not know if my system get's 120 Watts to Battery or 1200 to 1209.
So i would like to make any negative values red and any positive ones green, while scrapping the "-" in front, so i can see the total number.

@joBr99
Copy link
Owner

joBr99 commented Sep 6, 2022

Do you have an example for this done in the offical HomeAssistant UI? Would like to see how they are doing the config.

@jrspowers
Copy link
Author

i will share this with you i use it in my dashboard

@jrspowers
Copy link
Author

hello here is as promised the config of what it looks like in my dashboard that's how I would also like to use it with nspanel see photo of the card

type: custom:button-card
entity: sensor.multi_sensor_tarras_temperature
show_name: false
show_state: true
icon: hue:room-terrace
state:
  - value: -25
    operator: <=
    color: rgb(255,0,255)
  - value: -18
    operator: <=
    color: rgb(138,0,138)
  - value: -12
    operator: <=
    color: rgb(128,0,128)
  - value: -7
    operator: <=
    color: rgb(0,0,255)
  - value: -1
    operator: <=
    color: rgb(135,206,236)
  - value: 4
    operator: <=
    color: rgb(0,128,0)
  - value: 10
    operator: <=
    color: rgb(144,238,144)
  - value: 16
    operator: <=
    color: rgb(255,2,255)
  - value: 21
    operator: <=
    color: rgb(255,165,0)
  - value: 27
    color: rgb(255,69,0)
    operator: <=
  - value: 32
    color: rgb(255,0,0)
    operator: <=
  - value: 38
    color: rgb(139,0,0)
    operator: <=
styles:
  card:
    - height: 60px
    - width: 60px

302739351_814500573039453_152619470687144371_n
304089843_543653587535527_7159625493164453494_n

@jrspowers
Copy link
Author

jrspowers commented Sep 8, 2022

@joBr99 would this be how i see it? & this would also work nicely if that in cardgrid ?

@joBr99 joBr99 changed the title [Feature Request] Temperature color displays [Feature Request] operators for icon/color overrides Sep 11, 2022
@joBr99 joBr99 self-assigned this Sep 12, 2022
@jrspowers
Copy link
Author

jrspowers commented Sep 15, 2022

hello @joBr99 are you going to get this sorted because see that it didn't go with this update so hope it will be okay?

@jrspowers
Copy link
Author

hey is it possible to process this in the next update or is this more work ?

@joBr99
Copy link
Owner

joBr99 commented Dec 25, 2022

with 3.7.3 you can now do something like this:

        color: >
          {% if int(states("sensor.carbon_monoxide")) < 40  %}
          [255,0,0]
          {% elif int(states("sensor.carbon_monoxide")) < 50 %}
          [0,255,0]
          {% elif int(states("sensor.carbon_monoxide")) < 60 %}
          [0,0,255]
          {% endif %}

@joBr99 joBr99 closed this as completed Dec 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants