Giter VIP home page Giter VIP logo

flex-horseshoe-card's People

Contributors

amoebelabs avatar lau-ie avatar lgtm-migrator avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flex-horseshoe-card's Issues

Incredible Lovelace card, but is it still supported?

This card is incredible and I'd love to use it extensively, however I am reluctant if it is no longer supported. @AmoebeLabs I hope you have recovered from your illness and are now in great health! If not best wishes on your recovery. Are you planning on maintaining your awesome creation?

Crashes the HA 0.117 on HASSIO

This crashes the HA 0.117 , with frontend loading for ever , only way to resolve is to delete the re install the HACS.

Any suggestions let me know.

Compatibility

Hello,
This looks amazing!
However it does not work on the latest HA.
Is it supose to work or should I wait for a updated version ?

Late edit: Works ... I just need to pay more attention :)

lineargradient ignores all but first and last defined colorstop

observed on release version: v 0.9.0

[repro]

  1. set horseshoe fill style to use: lineargradient
  2. provide a list of numerous (several more than 2) colorstops

[result]

  1. the gradient is created using only the first and last defined colorstop, none of the in-between colorstop colors are used or displayed

[expect]

  1. multiple defined colorstops should result in multiple gradients between each of the defined colorstop values

Arrange changes in every device

I´m having this issue, the same card config changes depending the device is vieweing, and even in the same mobile if it´s in portrait or landscape orientation
PC
PC
Phone Landscape
landscape
Phone Portrait
portrait

Invert color_stops value > color to color > value

To make color_stops to work with config template card variables the variable needs to be the value in the yaml list.

This does not work:

  color_stops:
    "${states['sensor.electricity_price'].attributes.min_price}": 'green'
    "${states['sensor.electricity_price'].attributes.min_price}": 'blue'

Should be:

  color_stops:
    'green': "${states['sensor.electricity_price'].attributes.min_price}"
    'blue': "${states['sensor.electricity_price'].attributes.min_price}"

Card layout issue in App Home Assistant on Android tablet

I am using the flex horseshoe card on an Android tablet. When I open Home Assistant in Chrome, Firefox or Edge, the layout is correct. When I open Home assistant on my tablest with the App, the laytout is wrong. The problem is that the icons are placed incorrectly. The size of the icon is also larger. How can this be solved?
Oke
NotOke

Convert lineal input_number slider to input_number flex-horseshoe slider

I could not make it work as a command, just as a sensor, I mean:
lovelace -> automation -> cover Not Working
cover -> automation -> lovelace Working
Is it that flex-horseshoe cars do not yet have this feature?

To control a cover it is neccessary to use horse circle (first entity) as a command.

Off-line, No internet, no web connection

i am able to see the custom:flex-horseshoe-card when i am connected to the web but in my case i run my HomeAssistance without internet

Is there a way to run it without the web?

Horshoe to support negative and positive numbers

Hi AmoebeLabs

Your component is incredibly useful for displaying Battery Details as used for Solar Storage. It is literally the best way to show it!!!

But I have a small request - please would it be possible to have the horshoe curve support drawing from the middle apex to the left depending on a negative or positive number. That would immediately transfer this into the most useful component for a battery as you could see whether it is charging or discharging.

If you can show me where in the code it draws the curve, I can try to figure it out.

image

Thanks
Wayne

doesn't work (vlines: hlines: names :)

Hello! Can someone tell me, it doesn't work (vlines: hlines: names :) when using these attributes, the card simply doesn't appear on the page, there are no errors, it just disappears. In the example below, only hlines: is specified, but this also doesn't work with others.
2020-08-25_18-14-57

entityConfig is undefined : the page is blank

Hi,
Hassio ver. 0.105.5 and flex-horseshoe-card downloaded from HACS 1 hour ago.

The simple card is blank, no messages on log, on Developers Tools page :
flex-horseshoe-card.js:1703:1 TypeError: entityConfig is undefined

Also your examples page is blank. Any help ? Thanks for your work.

id: tests
title: Test page
icon: 'mdi:battery-charging'
panel: true
path: test

cards:

  - type: vertical-stack
    cards:

    - !include
      - ../includes/titles.yaml
      - title: 'TEST'

    - type: custom:flex-horseshoe-card
      entities:
        - entity:  display.wall_tablet
          attribute: battery_level
          units: '%'
          icon: mdi:battery
          name: 'Batteria'              
        - entity:  display.wall_tablet
          attribute: battery_charging
          icon: mdi:battery-charging
          name: 'In carica'
      show:
        horseshoe_style: lineargradient          
      layout:
        hlines:
          - id: 0
            xpos: 50
            ypos: 42
            length: 40
            styles:
              - stroke: var(--primary-text-color);
              - stroke-width: 5;
              - stroke-linecap: round;
              - opacity: 0.7;
        states:
          - id: 0
            entity_index: 0
            xpos: 50
            ypos: 34
            styles:
              - font-size: 3em;
          - id: 1
            entity_index: 1
            xpos: 40
            ypos: 57
            styles:
              - text-anchor: start;
              - font-size: 1.5em;
        icons:
          - id: 0
            entity_index: 1
            xpos: 37
            ypos: 57
            align: end
            size: 1.3
          - id: 1
            entity_index: 2
            xpos: 37
            ypos: 72
            align: end
            size: 1.3
        names:
          - id: 0
            entity_index: 0
            xpos: 50
            ypos: 95

      horseshoe_scale:
        min: -10
        max: 40

      color_stops:
        16: '#FFF6E3'
        17: '#FFE9B9'
        18: '#FFDA8A'
        19: '#FFCB5B'
        20: '#FFBF37'
        21: '#ffb414'
        22: '#FFAD12'
        23: '#FFA40E'
        24: '#FF9C0B' 
        25: '#FF8C06' 


Cannot add property tap_action, object is not extensible

Hi,
after the update to HA 0.106.6 I receive the following error: Cannot add property tap_action, object is not extensible

Screenshot 2020-03-11 at 14 18 33

Can you help me to resove this issue?

My configuration is the following:

                type: entities
                title: {{name}}
                show_header_toggle: false
                entities:
                  - type: custom:layout-card
                    layout: horizontal
                    column_num: 2
                    cards:
                      - type: 'custom:flex-horseshoe-card'
                        entities:
                          {% if room_sensor %}
                          - entity: sensor.{{ room_sensor }}_battery
                            decimals: 0
                            unit: '%'
                            icon: mdi:gauge
                          - entity: sensor.{{ room_sensor }}_temperature
                            decimals: 1
                            unit: '°C'
                          - entity: sensor.{{ room_sensor }}_humidity
                            decimals: 0
                            unit: '%'
                            icon: mdi:water-percent
                          - entity: sensor.{{ room_sensor }}_pressure
                            decimals: 0
                            unit: 'hPa'
                            icon: mdi:gauge
                          {% endif %}
                          {% if external_sensor %}
                          - entity: sensor.{{ external_sensor }}_battery_level
                            decimals: 0
                            unit: '%'
                            icon: mdi:gauge
                          - entity: sensor.{{ external_sensor }}_temperature
                            decimals: 1
                            unit: '°C'
                          {% endif %}
                        show:
                          horseshoe_style: 'lineargradient'
                        layout:
                          {% if room_sensor %}
                          hlines:
                            # A horizontal line. Not connected to an entity
                            - id: 0
                              xpos: 50
                              ypos: 42
                              length: 40
                              styles:
                                - stroke: var(--primary-text-color);
                                - stroke-width: 5;
                                - stroke-linecap: round;
                                - opacity: 0.7;
                          {% endif %}
                          states:
                          {% if room_sensor %}
                            # States 0 refers to the first entity in the list, ie index 0
                            - id: 0
                              entity_index: 1
                              xpos: 50
                              ypos: 34
                              styles:
                                - font-size: 2em;
                            # States 1 refers to the second entity in the list, ie index 1
                            - id: 1
                              entity_index: 2
                              xpos: 40
                              ypos: 57
                              styles:
                                - text-anchor: start;
                                - font-size: 1.5em;
                            # States 2 refers to the third entity in the list, ie index 2
                            - id: 2
                              entity_index: 3
                              xpos: 40
                              ypos: 72
                              styles:
                                - text-anchor: start;
                                - font-size: 1.5em;
                          icons:
                            # Icons 0 refers to the second entity in the list, ie index 1
                            - id: 0
                              entity_index: 2
                              xpos: 37
                              ypos: 57
                              align: end
                              size: 1.3
                            # Icons 1 refers to the third entity in the list, ie index 2
                            - id: 1
                              entity_index: 3
                              xpos: 37
                              ypos: 72
                              align: end
                              size: 1.3
                          {% endif %}
                          {% if external_sensor %}
                            - id: 0
                              entity_index: 1
                              xpos: 50
                              ypos: 60
                              styles:
                                - font-size: 3em;
                          {% endif %}
                        # Scale set to -10 to +40 degrees celcius
                        horseshoe_scale:
                          min: 0
                          max: 100
                        # color stop list with 10 colors defined in the theme. With the `lineargradient` fill style, only the
                        # first (16:) and last (25:) colors are used. The thresholds are ignored with this setting.
                        color_stops:
                          00: '#D60036'
                          10: '#CD1930'
                          20: '#C4322B'
                          30: '#BC4B25'
                          40: '#B36420'
                          50: '#AB7D1B'
                          60: '#A29615'
                          70: '#99AF10'
                          80: '#91C80A'
                          90: '#88E105'
                          100: '#80FA00'
                        style: |
                          ha-card {
                            box-shadow: var(--theme-card-box-shadow);
                          }

Thank you very much in advance

Layout: icons: size: 1.2 does not work on android tablet.

I want to change the size of an icon according to the example.
icons:
# Icons 0 refers to the second entity in the list, ie index 1
- id: 0
entity_index: 1
xpos: 37
ypos: 57
align: end
size: 1.3
This works fine on PC and iPhone.
This does not work on an android tablet.
What is the solution for this?

inoperation

The latest version of HA requires manual configuration. The existing reference configuration is invalid.

Decluttering templates icons on mobile

Hello,
Everything works perfect, but when I use the decluttering templates, on mobile devices, the icons dont show on the screen .
I understand this might be a decluttering-card issues, but wondering if anyone has this issue and a possible workaround !?

entity_id undefined in mobile app

Strange behaviour for me. Getting the following error with HASS 2021.9.6 and this integration (0.9.0) on click on the icon / circle.
Everything works fine in Chrome on PC and Chrome on Android mobile (no error in the log), but in the app I get the following error:

Logger: frontend.js.latest.202108300
Source: components/system_log/init.py:190
First occurred: 12:28:54 (1 occurrences)
Last logged: 12:28:54
https://aa.bb.org/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=abcdefghijklmnopqrstuvwxyz Uncaught TypeError: Cannot read properties of undefined (reading 'entity_id')

My configuration for the card is attached: card.txt

Mobile app:

mobile_app

Chrome (PC):

pc

Cannot read property 'setConfig' of undefined

I try not to open issues that skew towards support, but I've double checked that I followed the instructions before coming here.

Error

When creating a simple "getting started" card, the following error is thrown:

image

I am running the latest version of Home Assistant Home Assistant 0.105.5 on HassOS in a VM.

- type: 'custom:flex-horseshoe-card'
  entities:
    - entity: sensor.glances_ram_used
      icon: 'mdi:memory'
      name: RAM Usage

Verifying Dependencies

I have restarted the Home Assistant Server several times since this was installed.

I can confirm the sensor.glances_ram_used entity itself exists and works, here a screenshot underneath another card using the same entity:

image

I've double checked that the script source is being loaded at the top of the UI resources:

image

Finally, I double checked that the file is where it is supposed to be:

image

Add capability to set size or ratio of card

is there a way to set the size or ratio horizontal vs. vertical dimensions so, when put in a horizontal stack with others you can control how tall/wide it is to match the others ?

HACS install don't work.

I tried the install via HACS, but after a restart there is no horseshoe card.
A manual card with the code from this side gives the error "No card type found".

Is this project dead?

No call service with browser mod is calling

As the new version of Hassio 2021.1.3 and browser_mod are released, is not possible to use Tap_action with the call service for the browser_mod popup service. I know that other custom cards has the same problems but new released was done in order to use the fire-dom-event option instead of classic call service. Is it in program to do the same upgrade for this fantastic card that I use everywhere?
Thanks you

Lovelace refresh on iPhone

Hi

I have used and adapted the “Flexible Horseshoe Card for Lovelace” from Hacs. On my pc this works perfectly. When i use it on my iPhone i have a problem.
The intention is if you click eg the icon “silent”, that the color changes from orange to red or vice versa.
On my iPhone that only happens when I refresh my image by pulling the image down.

What could be the problem?
is the card too extensive or are there other causes?

My card:
Flexible Horseshoe Card for Lovelace
flex-horsesshoe-card.yaml.txt

Icon color by state

Hello, thanks for this great card! I've been trying to build a card that shows the state of a few switches by icon color. Based on examples 11 and 12, it looks like icon color should change by state within the animations section, but I have tried repeatedly and can't get it to work.

I took the sample code for #12 and used it as is, except to replace the entities with my own, and the card shows up with white icons only. The state changes when you click on the icon, and the circle changes per the animations, but the icon stays white.

In the example file, the icon color in the automation section is set to switch from white to primary text color. In the icon section (under layout) the icon color is set to primary text color.

I have changed all of the colors in both the animation and layout/icon sections to red, blue, black and yellow. Only the colors applied in the layout/icon section change anything, but still no change with state.

If I remove the style/color from layout/icons section, the color of the icons reverts to white again, and still no change with state.

Am I doing something wrong, has this functionality been deprecated, or is this a bug? The code is rather long and is literally the Two Bulbs code from the sample file, changed to my entities, and with 'white' changed to 'black' in the icon section of animations. Let me know if you want me to post it anyway.

Thanks in advance!

Not able to hide unit of measurement

Currently I couldn't find any option to disable the card to show the unit of measurement for an entity. I one card I'd like to show my download speeds, which is in combination with the mesaurement unit quite large for one line:
350 Mbit/s

I was not able to manually set the attribute unit to empty (e.g. unit: '') or just leave the whole attribute out of code. In both cases the default measurement unit was chosen. I think following lines must be adapted to allow at least unit: '':

_buildUom(entityState, entityConfig) {
return (
entityConfig.unit
|| entityState.attributes.unit_of_measurement
|| ''
);
}

Expected solution:

  1. Either the card should automatically wrap the unit to a next line
  2. Offer a manual CSS option to wrap the unit to a next line
  3. Deactivate the card to show the unit of measurement

TypeError: inColor is undefined

Hassio 0.101.0
Flex-horseshoe: 0.8.3

Every once in a while, i have this error on logs:
https://XX.XX.XX.XX:8123/community_plugin/flex-horseshoe-card/flex-horseshoe-card.js:1914:12 TypeError: inColor is undefined
and when this error is caught, only the first flex-horseshoe below disappears. I have to restart HA a couple of times to make it appear again:

      - cards:
          - color_stops:
              '200': '#FFF6E3'
              '400': '#FFE9B9'
              '600': '#FFDA8A'
              '800': '#FFCB5B'
              '1000': '#FFBF37'
              '1200': '#ffb414'
              '1400': '#FFAD12'
              '1600': '#FFA40E'
              '1800': '#FF9C0B'
              '1900': '#FF8C06'
            entities:
              - attribute: power
                decimals: 0
                entity: sensor.termosifon_power
                name: Termosifon
                unit: W
              - attribute: energy
                decimals: 1
                entity: sensor.monthly_termosifon_energy
                icon: 'mdi:power-plug'
                unit: kWh
              - attribute: current
                decimals: 2
                entity: sensor.termosifon_current
                icon: 'mdi:gauge'
                unit: A
            horseshoe_scale:
              max: 2000
              min: 0
            layout:
              hlines:
                - id: 0
                  length: 40
                  styles:
                    - stroke: var(--primary-text-color);
                    - stroke-width: 5;
                    - stroke-linecap: round;
                    - opacity: 0.7;
                  xpos: 50
                  ypos: 42
              icons:
                - align: end
                  entity_index: 1
                  id: 0
                  size: 1.3
                  xpos: 37
                  ypos: 57
                - align: end
                  entity_index: 2
                  id: 1
                  size: 1.3
                  xpos: 37
                  ypos: 72
              names:
                - entity_index: 0
                  id: 0
                  xpos: 50
                  ypos: 95
              states:
                - entity_index: 0
                  id: 0
                  styles:
                    - font-size: 3em;
                  xpos: 50
                  ypos: 34
                - entity_index: 1
                  id: 1
                  styles:
                    - text-anchor: start;
                    - font-size: 1.5em;
                  xpos: 40
                  ypos: 57
                - entity_index: 2
                  id: 2
                  styles:
                    - text-anchor: start;
                    - font-size: 1.5em;
                  xpos: 40
                  ypos: 72
            show:
              horseshoe_style: colorstopgradient
            type: 'custom:flex-horseshoe-card'
          - color_stops:
              '0': '#FFF6E3'
              '800': '#FFE9B9'
              '1600': '#FFDA8A'
              '2400': '#FFCB5B'
              '3200': '#FFBF37'
              '4000': '#ffb414'
              '4800': '#FFAD12'
              '5600': '#FFA40E'
              '6400': '#FF9C0B'
              '7200': '#FF8C06'
            entities:
              - attribute: power
                decimals: 0
                entity: sensor.aeon_hem_power
                name: Home Total
                unit: W
              - attribute: energy
                decimals: 1
                entity: sensor.monthly_home_energy
                icon: 'mdi:power-plug'
                unit: kWh
              - attribute: current
                decimals: 0
                entity: sensor.aeon_hem_current
                icon: 'mdi:gauge'
                unit: A
            horseshoe_scale:
              max: 8000
              min: 0
            layout:
              hlines:
                - id: 0
                  length: 40
                  styles:
                    - stroke: var(--primary-text-color);
                    - stroke-width: 5;
                    - stroke-linecap: round;
                    - opacity: 0.7;
                  xpos: 50
                  ypos: 42
              icons:
                - align: end
                  entity_index: 1
                  id: 0
                  size: 1.3
                  xpos: 37
                  ypos: 57
                - align: end
                  entity_index: 2
                  id: 1
                  size: 1.3
                  xpos: 37
                  ypos: 72
              names:
                - entity_index: 0
                  id: 0
                  xpos: 50
                  ypos: 95
              states:
                - entity_index: 0
                  id: 0
                  styles:
                    - font-size: 3em;
                  xpos: 50
                  ypos: 34
                - entity_index: 1
                  id: 1
                  styles:
                    - text-anchor: start;
                    - font-size: 1.5em;
                  xpos: 40
                  ypos: 57
                - entity_index: 2
                  id: 2
                  styles:
                    - text-anchor: start;
                    - font-size: 1.5em;
                  xpos: 40
                  ypos: 72
            show:
              horseshoe_style: colorstopgradient
            type: 'custom:flex-horseshoe-card'
        type: horizontal-stack

HACS support

This is awesome, id love to see this in hacs so it’s easier for folks to discover and for others to track updates

Add configurable per item drop shadows (2/2)

Second part of #4

Add per item drop shadows. It should replace and/or complement the CSS filter which is applied to the full SVG.

  • Texts should be ok
  • The horseshoe also
  • Icons too
  • Lines require special treatment: horizontal lines don't have a height, where vertical line don't have a width. In those cases, nothing is rendered...

An example with hard-coded svg filters shows this, without per item filters:

image

And with filters, but the line doesn't show any drop shadow...
image

No layout defined error

I am getting an error when trying to use this:

EAAD6010-9C69-4039-B342-3EAD5AA57763

I am running 0.99.2 and I have restarted since installing. Any idea what this error means?

Cards won't show after HA update

Hi,

After HA update to 0.106 the cards don't show anymore. It seems that it's something related with hlines/vlines configuration because if I remove those lines it starts working. Any suggestion?

Regards.

Use sensor value as min/max horseshoe_scale

Hi,
I would find it useful to be able to use a sensor or a template as min and max values for horseshoe_scale.
Something like:

horseshoe_scale:
  min: 0
  max: sensor.target_time

or:

horseshoe_scale:
  min: 0
  max: {{states('sensor.target_time')}}

It's possible?

By(t)e

version 0.9.1

@AmoebeLabs
Not really an issue: I've modified the code with the follows:

  • release : 0.9.1 (candidate)
  • by : Fabio Salvicchi
  • date : 17 March 2021
  • log : - no uppercase translation for card's name, is up to you choose the case
  •           - added a new horseshoe_style named 'colorstoplineargradient'; it display a gradient
    
  •             from the first color_stop to the value's corrispondent color_stop
    

Is there a way to send you the code for your approbation?

Thank you for your great job!

⚠️ Information: Future card configuration changes.

Hi.

A change in how lovelace cards are set up in Home Assistant 0.105 increases performance, but enables cards to accidentally modify their own configuration in the loaded lovelace configuration.

I'm going through the cards in the HACS default repository, and noticed that your card may be susceptible to this. Looking through your code it seems you may modify parts of the config object passed to your card in setConfig.

The result could be that your card does not work well with the GUI editors or that parts of the configuration start showing up multiple times.

At some point in the future, it is likely that the configuration will be frozen before being passed to setConfig. At this point, your card will fail entirely when it tries to modify the configuration object.

There are several ways to fix/protect agains this problem.

The best is to restructure setConfig such that the configuration is never modified.
Other alternatives are to make a copy of the configuration and work on that instead.

setConfig(config) {
  config = { ...config }; // This works for simple configurations not containing arrays or objects
...
import { deepClone } from "deep-clone-simple";
// https://github.com/balloob/deep-clone-simple

setConfig(config) {
  config = deepClone(config); // This is a safe and fast method
...

or

setConfig(config) {
  config = JSON.parse(JSON.stringify(config)); // This uses built-in functions, but may be slower than deepClone
  ...

Please note that I have not tested your card agains Home Assistant 0.105 or later, but just quickly looked through the code. If I'm mistaken in my assessment, I appologize for taking your time.

See thomasloven/hass-config#6 for more info.

Lowercase letters

Would love the ability to use lowercase letters in names! Thanks for the hard work so far!

No horseshoe scale defined

I installed the card via HACS, added the URL to the lovelace resources and copied your basic example. All I see is "No horseshoe scale defined". After removing various elements to see if other messages show up, I ended with this:

      - type: 'custom:flex-horseshoe-card'
        entities:
          - entity: weather.dark_sky
            attribute: temperature
            decimals: 1
            unit: °C
            area: De Maan
        layout:
          horseshoe_scale:
            min: -10
            max: 40

image

I am using HA V0.102.2 and the build in lovelace editor. I'm not using the decluttering card...

Icon position wrong on Android tablet

Hi,

I hope your recovery is going well.

I'm using your Horseshoe card and on a browser or the companion app on IOS the postion of the icons is shown correct.
How ever on my (Android) wall tablet the icons are in the wrong position.
IOS:
iOS

Android
Android

Any ideas or suggestions how to fix this?

it does not work (vlines: hlines: names :)

Hello! Can someone tell me, it doesn't work (vlines: hlines: names :) when using these attributes, the card simply doesn't appear on the page, there are no errors, it just disappears. In the example below, only hlines: is specified, but this also doesn't work with others.
2020-08-25_18-14-57

FR: Make value changes smoothly

It would be nice if the value of the horseshoe changes smoothly and don't jump to the next value.
Like in the custom gauge card.
If you have sensors that change frequently fast, like from a solar system.

Thanks for this great card and your time.

Template sensors don't render. Nothing is shown in that case

As shown in this post: https://community.home-assistant.io/t/lovelace-flexible-horseshoe-card-donut-graph-flexible-layout-multiple-entities-actions-animations-including-next-gen-experimental-examples/137850/47, template sensors using a value_template don't render.

Sensor is defined as:

      esxi_vm0_datastore1_total_capacity:
        friendly_name: 'VM0 Used Disk Space - Datastore 1'
        value_template: "{{ states['sensor.esxi_datastore_datastore1'].attributes.total_space_gb + states['sensor.esxi_datastore_vms_datastore'].attributes.total_space_gb | round () }}"
        unit_of_measurement: 'GBs'

Issue with mobile app since latest update

I have a problem since the mobile app update to 2022.6.0. It's working fine with browser version and worked in mobile app before.
Pushing the now "invisible" fan button in mobile app gives me the following error:

Logger: frontend.js.latest.202206010
Source: components/system_log/__init__.py:190
First occurred: 08:54:06 (1 occurrences)
Last logged: 08:54:06

https://xxxxxxxxxxx.duckdns.org:8123/hacsfiles/flex-horseshoe-card/flex-horseshoe-card.js?hacstag=1111111111:222:333 Uncaught TypeError: Cannot read properties of undefined (reading 'action')

Mobile app:
mobile

Browser:
browser

Lovelace-Configuration:

type: custom:mod-card
card_mod:
  style: |
    restriction-card {
      --lock-margin-left: 88%;
    }
card:
  type: custom:restriction-card
  restrictions:
    block: true
  condition:
    entity: sensor.i3s_120_remaining_battery_percent
    value: 30
    operator: <
  card:
    type: custom:flex-horseshoe-card
    entities:
      - entity: sensor.i3s_location_temp
        decimals: 1
        name: ' '
        tap_action:
          action: more-info
      - entity: input_boolean.virtual_i3s_climate
        icon: mdi:fan
        tap_action:
          action: call-service
          service: input_boolean.toggle
          service_data:
            entity_id: input_boolean.virtual_i3s_climate
      - entity: switch.virtual_i3s_climate
      - entity: sensor.i3s_loc
        tap_action:
          action: more-info
    animations:
      entity.1:
        - state: 'on'
          icons:
            - animation_id: 0
              styles:
                - color: var(--paper-item-icon-active-color);
        - state: 'off'
          icons:
            - animation_id: 0
              styles:
                - color: var(--primary-text-color);
      entity.2:
        - state: 'on'
          icons:
            - animation_id: 0
              styles:
                - color: var(--text-primary-color);
          circles:
            - animation_id: 1
              styles:
                - fill: var(--cool-blue);
        - state: 'off'
          circles:
            - animation_id: 1
              styles:
                - fill: var(--primary-background-color);
    show:
      horseshoe_style: colorstopgradient
    layout:
      states:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 42
          styles:
            - font-size: 3.5em;
            - text-transform: none;
            - font-weight: 500;
        - id: 1
          entity_index: 3
          xpos: 50
          ypos: 95
          styles:
            - text-transform: lowercase;
            - font-size: 1.6em;
            - font-weight: 500;
            - letter-spacing: inherit;
      hlines:
        - id: 0
          xpos: 50
          ypos: 51
          length: 50
          styles:
            - stroke: var(--primary-text-color);
            - stroke-width: 5;
            - stroke-linecap: round;
            - opacity: 0.7;
      names:
        - id: 0
          entity_index: 0
          xpos: 50
          ypos: 95
          styles:
            - text-transform: lowercase;
            - font-size: 1.6em;
            - font-weight: 500;
            - letter-spacing: inherit;
      icons:
        - id: 0
          entity_index: 1
          animation_id: 0
          xpos: 50
          ypos: 74
          icon_size: 3.8
      circles:
        - id: 0
          entity_index: 2
          animation_id: 1
          xpos: 50
          ypos: 68.5
          radius: 25
    horseshoe_scale:
      min: -20
      max: 60
      width: 10
    horseshoe_state:
      width: 14
    color_stops:
      '10': orange
      '18': var(--cool-blue)
      '25': orange
      '35': red
      '-20': red
    card_mod:
      style: |
        ha-card {
          padding: 12px !important;
        }

color stops not working

My current code is as follows:

type: custom:flex-horseshoe-card
entities:
  - entity: sensor.air_quality_index
    name: Air Quality
    attribute: state
    decimals: 1
show:
  horseshoestyle: colorstopgradient
layout:
  states:
    - id: 0
      entity_index: 0
      xpos: 50
      ypos: 60
  //  areas: null
  //    - id: 0
  //      entity_index: 0
  //      xpos: 50
  //      ypos: 35
  names:
    - id: 0
      entity_index: 0
      xpos: 50
      ypos: 35
horseshoe_scale:
  min: 0
  max: 300
color_stops:
  '0': '#24E79F'
  '20': '#FEC428'
  '50': '#FD702F'
  '100': '#F42254'
  '150': '#C522A7'
  '200': '#9717FB'

but the color stays light blue. When I try to remove the single-quotes in the editor, HA keeps adding them back in. That may be the issue, but not sure how to resolve.

Thank you

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.