Command line sensor warns about needing `device_class` set with temperature `unit_of_measurement` but does not support it
See original GitHub issueThe problem
It appears that command line sensors don’t support the device_class tag and is throwing a warning about needing them for temperature values. Adding the device class to the customize.yaml also doesn’t fix the warning.
What is version of Home Assistant Core has the issue?
2021.9.7
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Command Line Sensor
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sensor.command_line/
Example YAML snippet
configuration.yaml
- platform: command_line
name: cpu_0_temperature
command: cat /config/cpu0temp.txt
unit_of_measurement: "°C"
- platform: command_line
name: P8J8XDVR_Temperature
command: cat /config/P8J8XDVRtemp.txt
unit_of_measurement: "°C"
- platform: command_line
name: 200703809989_Temperature
command: cat /config/200703809989temp.txt
unit_of_measurement: "°C"
- platform: command_line
name: P8G1G7YR_Temperature
command: cat /config/P8G1G7YRtemp.txt
unit_of_measurement: "°C"
- platform: command_line
name: ST4000VN008_Temperature
command: cat /config/ST4000VN008temp.txt
unit_of_measurement: "°C"
customize.yaml
sensor.cpu_0_temperature:
friendly_name: CPU temperature
device_class: temperature
sensor.p8g1g7yr_temperature:
device_class: temperature
sensor.st4000vn008_temperature:
device_class: temperature
sensor.p8j8xdvr_temperature:
device_class: temperature
sensor.200703809989_temperature:
device_class: temperature
Anything in the logs that might be useful for us?
Entity sensor.cpu_0_temperature (<class 'homeassistant.components.command_line.sensor.CommandSensor'>) with device_class None reports a temperature in °C which will be converted to °F. Temperature conversion for entities without correct device_class is deprecated and will be removed from Home Assistant Core 2022.3. Please update your configuration if device_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+command_line%22
Entity sensor.p8g1g7yr_temperature (<class 'homeassistant.components.command_line.sensor.CommandSensor'>) with device_class None reports a temperature in °C which will be converted to °F. Temperature conversion for entities without correct device_class is deprecated and will be removed from Home Assistant Core 2022.3. Please update your configuration if device_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+command_line%22
Entity sensor.st4000vn008_temperature (<class 'homeassistant.components.command_line.sensor.CommandSensor'>) with device_class None reports a temperature in °C which will be converted to °F. Temperature conversion for entities without correct device_class is deprecated and will be removed from Home Assistant Core 2022.3. Please update your configuration if device_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+command_line%22
Entity sensor.200703809989_temperature (<class 'homeassistant.components.command_line.sensor.CommandSensor'>) with device_class None reports a temperature in °C which will be converted to °F. Temperature conversion for entities without correct device_class is deprecated and will be removed from Home Assistant Core 2022.3. Please update your configuration if device_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+command_line%22
Entity sensor.p8j8xdvr_temperature (<class 'homeassistant.components.command_line.sensor.CommandSensor'>) with device_class None reports a temperature in °C which will be converted to °F. Temperature conversion for entities without correct device_class is deprecated and will be removed from Home Assistant Core 2022.3. Please update your configuration if device_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+command_line%22
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:21 (7 by maintainers)
Top Results From Across the Web
Command Line Sensor Device Class error? - Configuration
I've been using a command line sensor to track my server temperature. It's pretty darn close to the example in the documentation.
Read more >Carbon Black Cloud: How to Collect Sensor Diagnost...
Objective. For 3.8+ sensors, there is a new command built in to RepCLI which is designed to collect a large variety of data...
Read more >NetBotz Rack Monitor 250 User Guide - eAnixter
The information presented in this manual is not warranted by APC by Schneider ... Temperature and humidity sensors (with or without digital displays)....
Read more >Templates and Custom Sensors in Home Assistant - YouTube
Templates and Custom Sensors are a more advanced feature in Home Assistant. With Templates and Custom Sensors you can format and convert ...
Read more >System Manual - SIMOCODE pro - Industry Support Siemens
The SIMOCODE basic units in the 24 V DC version do not include galvanic isolation. ... Temperature in the respective sensor measuring circuits,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still an issue in 2022.3.7. It can be easily reproduced with the following config:
which results in the following log output:
but it is not possible to do what the log entry asks because there is no
device_class
attribute for command line sensors.I changed the title so its clear its about the warning.