Probably something simple that I just can’t figure out is how to regex/grep/cleanup this output to JUST get the temperature data out.
Have got /usr/bin/sensors from UnRAID providing the following data string to Home Assistant and just need to figure out what the value_template needs to look like to make it work properly.
Have this in HA already and that works fine but then I get the above of course.
- platform: command_line
name: CPU Temperature
command: "/usr/bin/sensors"
# If errors occur, remove degree symbol below
unit_of_measurement: "°C"
#value_template:
I just want to get the current temperature out which is “47.4”.
Bloody hell I lost my mind half way through that, but it worked perfectly first time.
The part I’m confused about is whether that variable is permanently required? Or is that purely a sandbox area for testing this kind of thing and you can remove it after you messed around as I did with the example that was there?
Doesn’t seem like you can save multiple templates or do anything permanently which is why I assume it’s just a sandbox.
Actually spoke too soon seems HA doesn’t like it based on the logs.
2018-11-26 21:01:37 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: list object has no element 1 (value: k10temp-pci-00c3
Yeah I have a strong suspicion that what I think HA is receiving isn’t actually what I’m running the substring or regex or whatever you want to call it against which is why I get blank output.
How would I see exactly what the sensor value is coming in as if HA would interpret it?
Going to try a grep now without any value_template as a start to try to clean it up.
I’ve realised my version of the /usr/bin/sensors for some reason adds a space at the beginning of the line but even accounting for that making the Template work perfectly with the string I still get a blank when adding the template.
So getting the value pre-formatted from bash seems like the most fool proof option.