I’ve been working on setting up some sensors in Home Assistant, and I’m running into an issue where some sensors aren’t showing up in the developer tools. Let me walk through what I’ve done and where I might be going wrong.
First, I have two sensors defined in my configuration. The first one, tmo_nuc_temp0, works perfectly and shows up in the developer tools. Here’s how it’s configured:
yaml
command_line:
- sensor:
name: tmo_nuc_temp0
command: “ssh root@192.168.1.50 ‘cat /sys/class/thermal/thermal_zone0/temp’”
unit_of_measurement: “°C”
value_template: ‘{{ value | multiply(0.001) | round(1) }}’
scan_interval: 60
This sensor reads the temperature from a remote system using SSH and updates every 60 seconds. It works without any issues.
Now, the second sensor, tmo_nuc_temp1, is almost identical but reads from a different thermal zone:
yaml
sensor:
- platform: command_line
name: tmo_nuc_temp1
command: “ssh root@192.168.1.50 ‘cat /sys/class/thermal/thermal_zone1/temp’”
unit_of_measurement: “°C”
value_template: ‘{{ value | multiply(0.001) | round(1) }}’
scan_interval: 60
The problem is that this second sensor doesn’t appear in the developer tools at all. I’m confused because the configuration looks correct. Both sensors use the command_line platform, have the same structure, and are placed in the same configuration file.
After some research, I think the issue might be with how the command_line platform is defined. In Home Assistant, each platform should be listed under its own key in the configuration. By placing the second sensor under a separate sensor key, I might be causing Home Assistant to ignore it.
To fix this, I’ll move both sensors under the same command_line platform section. Here’s the corrected configuration:
yaml
command_line:
- sensor:
name: tmo_nuc_temp0
command: “ssh root@192.168.1.50 ‘cat /sys/class/thermal/thermal_zone0/temp’”
unit_of_measurement: “°C”
value_template: ‘{{ value | multiply(0.001) | round(1) }}’
scan_interval: 60 - sensor:
name: tmo_nuc_temp1
command: “ssh root@192.168.1.50 ‘cat /sys/class/thermal/thermal_zone1/temp’”
unit_of_measurement: “°C”
value_template: ‘{{ value | multiply(0.001) | round(1) }}’
scan_interval: 60
By grouping both sensors under the same command_line platform, I ensure that Home Assistant recognizes both of them. After making this change, I’ll restart Home Assistant to apply the new configuration.
If the issue persists, I’ll check the logs for any errors related to the sensor setup. This will help me identify if there’s a problem with the SSH command or permissions on the remote system.
In summary, the main issue was the incorrect placement of the second sensor in the configuration. By organizing the sensors properly under the command_line platform, I should be able to resolve the issue and have both sensors appear in the developer tools.