acon96 / home-llm

A Home Assistant integration & Model to control your smart home using a Local LLM
479 stars 56 forks source link

Add units to sensor state #164

Open mikenorgate opened 3 weeks ago

mikenorgate commented 3 weeks ago

Please describe what you are trying to do with the component
I have a sensor for my 3D printer that indicates time remaining on the active print in seconds, however because only the value is passed to the LLM it's incorrectly interpreting the unit, it thinks the value represents minutes

Describe the solution you'd like
When generating the device state, if the sensor includes a unit of measurement it should be included

Additional context

image

acon96 commented 2 weeks ago

This should be added in v0.3.3 but I'm not sure which unit to display since Home assistant seems to provide the raw units as well as preferred units and I can't figure out which one is which.