Comments (4)
Yes one up for this!
Since HA 2023.3, decimals are configured in the UI, and some are messed up. (such as my battery %)
from tesla-style-solar-power-card.
That would be nice. It would save having duplicate template sensors.
from tesla-style-solar-power-card.
I figured out something that works for me - rounding the APF xxxx Entities to the nearest 100 Watts. In the card, the entity is then shown as an integer when it is watts, and to 1 decimal place when it is kilowatts (and maintains the trimming of the trailing zero, like the grid entity shown below). You could similarly round to 10 Watts or 1000 Watts for different levels of decimal precision.
e.g. For the APF House Entity:
state: "{{ (states('sensor.load')|float / 100)|round(0) * 100 }}"
Would still be handy to do it via the config, but this also works.
from tesla-style-solar-power-card.
I figured out something that works for me - rounding the APF xxxx Entities to the nearest 100 Watts. In the card, the entity is then shown as an integer when it is watts, and to 1 decimal place when it is kilowatts (and maintains the trimming of the trailing zero, like the grid entity shown below). You could similarly round to 10 Watts or 1000 Watts for different levels of decimal precision. e.g. For the APF House Entity:
state: "{{ (states('sensor.load')|float / 100)|round(0) * 100 }}"
@melvanderwal I hope you're still watching this thread. Could you please do me a huge favor and copy and paste all your template sensors related to tesla-style-solar-power-card as
tesla-style-solar-power-card lovelace code?
I think something must have changed in Home Assistant or the Integration to make your example not correct anymore. When I use your example above, all my AFP values show as 0. It looks like your suggested code is presuming that my tesla powerwall Entities are in Watts. They are actually in Kilowatts for me.
Below are my template sensors:
- name: APF Grid Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ ((0 - states('sensor.powerwall_site_power')|float * 1000) / 100)|round(0) * 100 }}"
- name: APF House Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ (states('sensor.powerwall_load_power')|float * 1000 / 100)|round(0) * 100 }}"
- name: APF Generation Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ (states('sensor.powerwall_solar_power')|float * 1000 / 100)|round(0) * 100 }}"
- name: APF Battery Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ ((0 - states('sensor.powerwall_battery_power')|float * 1000) / 100)|round(0) * 100 }}"
- name: APF Grid Import
device_class: power
state_class: measurement
unit_of_measurement: W
state: >
{% if states('sensor.apf_grid_entity')|int(default=0) < 0 %}
{{ states('sensor.apf_grid_entity')|int(default=0)|abs }}
{% else %}
0
{% endif %}
from tesla-style-solar-power-card.
Related Issues (20)
- Ekstra solar pannel option HOT 4
- Why do the Recommended APF Sensors Show Impossible Transfers Compared to the Older "Tesla Card Sensors" ? HOT 2
- Card overlaying top navigation bar HOT 4
- HA log file - SyntaxError: The string did not match the expected pattern.
- Add second PV HOT 7
- Wrong bubble if solar loading battery
- Centre bubbles showing over lovelace header HOT 1
- Replicate Tesla Solar Dashboard View
- Graphic looks strange HOT 6
- Make circles a little bigger in respect to icon and font HOT 1
- indicate grid import/export in icon HOT 1
- Feature Request: House bubble - more than 1 color/source
- Documentation for Powerwall integration usage has wrong entity names
- Display width leads to strange behavior
- Help with Growatt Sensors HOT 1
- feature request: appliance1 call action switch-toggle
- Error with new unit_of_measurement
- Stopped working on core 2024.6.0 HOT 1
- 2024.6.0 appears to have broken visual alignment HOT 12
- 2024.6.1 scaling after update HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tesla-style-solar-power-card.