sburke781 / ecowitt

Hubitat Ecowitt Gateway Integration
Apache License 2.0
16 stars 4 forks source link

Wittboy Battery Readings #15

Closed sburke781 closed 1 year ago

sburke781 commented 1 year ago

@xcguy on the Hubitat Community found that the battery readings for his Wittboy weather station were not being handled correctly by the RF Sensor driver. He made some adjustments to get it working in his setup (see notes below). Will need to look at this in more detail and see if these changes need to be included in the driver.

Post from Hubitat Community: Decided to debug the RF Sensor driver (@sburke781)... My WittBoy is a WS90b and console is HP2560, and it reports two battery attributes:

wh90batt - voltage of the AA batteries ws90cap_volt - voltage of the capacitor battery (solar charged) Seems like there are two issues with the RF Sensor driver:

wh90batt is being treated as type 0 (boolean) instead of type 1 (voltage). It should be handled the same case as wh80batt, right? ws90cat_volt overwrites the battery. This attribute should probably be ignored, logged only, or driver needs a second battery reading (and second set of voltage min/max)? When I moved the wh90batt case to group with the wh80batt case (in attributeUpdate), and comment out the ws90cat_volt case, then the battery reporting appears to work correctly.

xcguy commented 1 year ago

Debug log with changes in place: dev:14112023-09-15 06:14:17.012 PM debug Unrecognized attribute: interval = 60 dev:14112023-09-15 06:14:17.000 PM debug Unrecognized attribute: gain50_piezo = 1.00 dev:14112023-09-15 06:14:16.998 PM debug Unrecognized attribute: gain40_piezo = 1.00 dev:14112023-09-15 06:14:16.996 PM debug Unrecognized attribute: gain30_piezo = 1.00 dev:14112023-09-15 06:14:16.993 PM debug Unrecognized attribute: gain20_piezo = 1.00 dev:14112023-09-15 06:14:16.991 PM debug Unrecognized attribute: gain10_piezo = 1.00 dev:14112023-09-15 06:14:16.989 PM debug Unrecognized attribute: ws90_ver = 132 dev:14132023-09-15 06:14:16.986 PM debug Unrecognized attribute: ws90cap_volt = 5.1 dev:14112023-09-15 06:14:16.675 PM debug Unrecognized attribute: dateutc = 2023-09-15+23:14:13 dev:14112023-09-15 06:14:16.673 PM debug Unrecognized attribute: runtime = 0 dev:14112023-09-15 06:14:16.666 PM debug parse()

This change will get the WittBoy ws90 battery status for the AA batteries reported correctly (assuming the user updates the sensor empty and full values to reflect 3 volts instead of 1.5). Would be nice to have the capacitor battery state reported, as it reflects the status of the solar charging.

sburke781 commented 1 year ago

I have merged the changes made, plus others relating to firmware and actually recording the solar battery reading.