itchannel / apex-ha

Local Neptune Apex HA Integration (Aquarium Controller)
GNU General Public License v3.0
22 stars 3 forks source link

Another measurement type #23

Open brettonw opened 2 years ago

brettonw commented 2 years ago

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 commented 2 years ago

Can I buy you another coffee? :)

brettonw commented 2 years ago

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
itchannel commented 2 years ago

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 :)

brettonw commented 2 years ago

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

itchannel commented 2 years ago

Interesting will check that out

itchannel commented 2 years ago

Can I buy you another coffee? :)

Thanks for the coffee 👍