Closed McGiverGim closed 3 years ago
I've created a PR which is already merged by @Draggon. You might check the README as you can now configure the attribute you want to use to get the attributes from.
As the the new flag performance_check
is disabled by default, there should be no performance check at startup. Atleast for me that fixed the home-assistant restart.
Regarding your unknown_attribute
, you might want to give the attributes_property
a shot. The output_file
is now a JSON file. You might want to search for the property which contains the data you expect to be passed to your sensor.
Not sure if the attributes are being squashed by smartctl --json
aswell.
Hi @boesing !! Sorry for this late response, but Github didn't notice me about your answer to my issue.
Reboot problem fixed disabling the performance_check
, thanks!
I have updated to the latest version, and configured for the data produced by it I think correctly, but I don't know if I have understood your explanation.
My problem is that Home Assistant only shows me ONE unknown attribute:
but the problem is that the original smart information, that I published in this thread contains several of them, and I want to access some. For example, I want to see the content of the attribute with ID 169, that I think is the remaining life of the SSD, but this info is not provided by the sensor. I suspect all the unknown attributes are added with the same "name" to the list, ending with one overwriting the earlier.
Looking at the code:
Here it seems he uses the name
attribute. What I propose is to use name
+_
+id
when the name
is Unknown_Attribute
, but my .sh
skills are very limited... Someone has an idea of what to change to accomplish that?
I've found the way... I don't know if it is the best solution, but replacing by this:
ATTRIBUTES=$(echo $ATTRIBUTES | jq 'map({(if .name == "Unknown_Attribute" then "Unknown_Attribute_" + (.id | tostring) else .name end): .raw.string | capture("^(?<value>[[:digit:]]+)").value | tonumber}) | add | with_entries(.key |= ascii_downcase)')
it works. I will try to push a PR.
Thanks for your addon!!! Two things about it:
This is what I get: