soloam / ha-pid-controller

PID Controller to Home Assistant
MIT License
97 stars 12 forks source link

Returned value is casted to String instead of Float #6

Closed KrzysztofHajdamowicz closed 2 years ago

KrzysztofHajdamowicz commented 2 years ago

Hello and thanks for great component!

I've just set it up to control my air purifier in living room (other automation turn it on and off, main automation adjust fan speed). By looking at PID sensor output I just discovered that returned value is a string, thus making visualisation harder. Can You make a fix to return float values so Home Assistant can make proper graph like any other numeric sensor? image

soloam commented 2 years ago

You are right, I'll check it out and push a update! Tks

soloam commented 2 years ago

@KrzysztofHajdamowicz this is actually based on the sensor unit (I'm always returning a float), some units are converted to graph (like ºC, % and rpm) other are like this. You can set any unit in the sensor. Please note that if you change the unit after some values are already in the database, you need to wait for the history to be cleared to that entity until it converts to a graph.

Tks

RubenKelevra commented 2 years ago

I think you just have to set the unit of measurement to some default like "points" for it to work as expected.

So if a user doesn't override it, it should be points to be graphed correctly :)

RubenKelevra commented 2 years ago

Please note that if you change the unit after some values are already in the database, you need to wait for the history to be cleared to that entity until it converts to a graph.

The purge recorder service hook can be limited to an entity. That's fairly new, so you might not be aware of that :)

So you can easily clear the history of one element

soloam commented 2 years ago

Please test the v1.1.0 @RubenKelevra and @KrzysztofHajdamowicz

RubenKelevra commented 2 years ago

Please test the v1.1.0 @RubenKelevra and @KrzysztofHajdamowicz

Very nice thanks :)

Screenshot_2022-02-15-04-48-22-548_io.homeassistant.companion.android.jpg