I’ve got this simple sensor, getting data from a command-line script :
- platform: command_line
name: Printer Pages Count
command: /config/shell_scripts/printer_pages.sh
value_template: '{{ value | int }}'
unit_of_measurement: pages
but it’s showing the number as a string, what could be wrong ?
tom_l
July 15, 2020, 11:07am
2
What does this return (exactly, including any unit) in the template editor:
{{ states('sensor.printer_pages_count') }}
tom_l
July 15, 2020, 12:37pm
4
Hmm. Very odd.
Have you tried refreshing your web browser cache (Ctrl+F5)?
petro
(Petro)
July 15, 2020, 12:41pm
5
Did you create it with the unit_of_measurement first or without it? If you created it without it first, then added it later. Give it some time and it will correct itself.
yes I tried without success
That’s correct, but it’s been over 2 days already.
For reference I’m using purge_keep_days: 3, so maybe I have to wait 3 days…
It’s now showing as a number. Thanks!
1 Like