Comments (4)
- platform: template
sensors:
storage_capacity_d:
friendly_name: "Storage Capacity Drive D"
unit_of_measurement: "GB"
value_template: "{{ state_attr('sensor.avenompc_avenompc_storage_d', 'AvailableSpaceMB') | float / 1000}}"
In case you're not aware, you can do math in HA templates.
Note: I made the changes off the top of my head, if it don't work, there's probably a typo somewhere.
Also note, since your example is in MB (not MiB), you divide by 1000 to get GB.
If the source data is actually in binary units (i.e. MiB), divide by 1024 to get GiB instead.
from hass.agent.
- platform: template sensors: storage_capacity_d: friendly_name: "Storage Capacity Drive D" unit_of_measurement: "GB" value_template: "{{ state_attr('sensor.avenompc_avenompc_storage_d', 'AvailableSpaceMB') | float / 1000}}"
In case you're not aware, you can do math in HA templates. Note: I made the changes off the top of my head, if it don't work, there's probably a typo somewhere.
Also note, since your example is in MB (not MiB), you divide by 1000 to get GB. If the source data is actually in binary units (i.e. MiB), divide by 1024 to get GiB instead.
Result: 181,953 GB
from hass.agent.
maybe you need parentheses for that. Try plugging the template into the HA devtools template tester and play around with it until you get the output you want.
from hass.agent.
- I generated a UUID for the sensor (https://www.uuidgenerator.net/version4) and can now round up in the sensor properties in HA
- Converted bytes to the binary system of gibibytes (GiB).
Not perfect, but it works.
Sample:
- platform: template
sensors:
storage_capacity_d:
friendly_name: "Storage Capacity Drive D"
unique_id: 30a103c2-3147-4de3-be98-3a9a80ed7fc3
unit_of_measurement: "GB"
value_template: "{{ state_attr('sensor.avenompc_avenompc_storage_d', 'AvailableSpaceMB') | float / 1073.741824 }}"
from hass.agent.
Related Issues (20)
- Misc: How to see battery on laptop when lid is closed
- Misc: MQTT running but all sensors showing as "Unknown" HOT 6
- Compatible with windows 7?
- Feature: /api/image_proxy/image.entity notifications HOT 3
- Bug: Paid Syncfusion components.
- Agent working BEFORE login? HOT 5
- Mediaplayer isnt working after name change HOT 1
- Bug: Hass Agent does not open
- Bug: Signature of installer is outdated
- Monitorwake does not release up button HOT 2
- Bug: Windows 11 notifications not popping up HOT 2
- Misc: LAB02-Research vs hass-agent.io HOT 3
- Greek Translation
- Feature:
- Feature: Reale 'sleep' command and complete dashboard
- Notify service missing in HA HOT 7
- Bug: Detected that custom integration 'hass_agent' calls async_create_task from a thread HOT 11
- Bug: Warning about "you must install Desktop Runtime" (7.0.11)
- Bug: RuntimeError HOT 1
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 hass.agent.