apex-ha icon indicating copy to clipboard operation
apex-ha copied to clipboard

Another measurement type

Open brettonw opened this issue 2 years ago • 6 comments

The new Liquid Level Sensor reports units:

{
did: "1_P3",
type: "in",
name: "LLS",
value: 5.8
},

From the "config":

mconf: [
{
abaddr: 1,
name: "module_1",
hwtype: "FMM",
update: false,
updateStat: 0,
extra: {
swapAddr: 0,
auto: [
true,
true,
false,
false
],
mode: [
"wof",
"wof",
"LLS-15",
"LLS-15"
],
flowMode: "gph",
levelMode: "in"
}
},

Without a unit on the sensor, a history graph just shows a color bar representing different values.

Mine is configured for "inches". I'm not sure if a non-US configuration will report "cm".

brettonw avatar Aug 28 '22 15:08 brettonw

Can I buy you another coffee? :)

brettonw avatar Aug 28 '22 15:08 brettonw

FWIW, I used the customize feature to work around this.

  customize:
    sensor.apex_salt:
      unit_of_measurement: ppt
    sensor.apex_lls:
      unit_of_measurement: in

brettonw avatar Aug 28 '22 17:08 brettonw

Thanks. I can easily add these types in so any you find let me know and I'll add them to the next release.

If only I had every Apex module but keeping reef tanks get very expensive :)

itchannel avatar Aug 28 '22 20:08 itchannel

Another approach would be to set the state_class of all the sensor types to 'measurement':

        self._attr_state_class = SensorStateClass.MEASUREMENT

in ApexSensor.init

brettonw avatar Aug 28 '22 20:08 brettonw

Interesting will check that out

itchannel avatar Aug 28 '22 20:08 itchannel

Can I buy you another coffee? :)

Thanks for the coffee 👍

itchannel avatar Aug 28 '22 21:08 itchannel