Can someone help me please by conversion (7923563229184) - to tb
.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.115.104.97.114.101.102.114.101.101.10 = STRING: downloads: 7923563229184
Can someone help me please by conversion (7923563229184) - to tb
.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.115.104.97.114.101.102.114.101.101.10 = STRING: downloads: 7923563229184
{{ ((((7923563229184 / 1024)/1024)/1024)/1024) | round(2) }}
Thanks, that number is changing.
- platform: snmp
name: 'UnRAID Backup Folder'
host: !secret unraid
port: 161
community: public
baseoid: 1.3.6.1.4.1.8072.1.3.2.4.1.2.9.115.104.97.114.101.102.114.101.101.1
accept_errors: true
value_template: '{{ (states.sensor.unraid_backup_folder /1000000000000)|round(1) }}'
unit_of_measurement: 'TB'
I tried like that I did not make it
It might be because states.sensor.unraid_backup_folder is a string, not a value.
try:
value_template: '{{ (states.sensor.unraid_backup_folder | float /1000000000000)|round(1) }}'
Try another float before the round.
Ah ! Tera Bytes (TB)
No, not another disease tracker
All states are stored as strings, so they need to be converted to a number (float or int) before doing maths.
Can you give an example of what I posted?
What do you mean?
I think the issue this that with that template
value_template: '{{ (states.sensor.unraid_backup_folder | float / 1000000000000)|round(1) }}'
the template is actually based on the previous value of that sensor, rather than the new value, that can be useful (if, for example, you want the old value to be retained if the sensor returns a value of āunknownā or null) but isnāt what you want here. What you need is actually:
value_template: '{{ (value | float / 1000000000000) | round(1) }}'
Take a look at the examples section for an example showing this.
I was going to mention the general āslideā of quoting binary numbers in decimal format, but couldnāt be bothered explaining it afterward. Well done for taking that one on the chin
Assuming Iāve got you right there, they did ask for it in TB (terabytes) and not TiB (tebibytes)
Where are the āPeopleās Popular Liberation Frontā ?
Oh ! Heās over there !