Closed mjmeli closed 3 years ago
I thought about adding the operating modes but did not think anyone would want it. I did the battery percentage PR specifically for the way that Home Assistant treats integrations via MQTT and it is easier to understand (i.e. more intuitive) than voltage.
I can work on a PR for the modes but I will need @briis to add the sensor for the MQTT portion. Any naming ideas for this sensor? I was initially thinking operating_mode or op_mode or mode or power_mode.
Then maybe a descriptive sensor for the mode that states what the mode does. (Probably won't do this as a sensor but I will make a canvas gauge background for use that has the descriptive text on the background of the gauge) Mode 0 (Voltage >= 2.455) Full power all sensors enabled
Mode 1 (Voltage <= 2.415 or >= 2.41 from Mode 2) Rapid sample interval set to six seconds
Mode 2 (Voltage <= 2.39 or >= 2.375 from Mode 3) Rapid sample interval set to one minute
Mode 3 (Voltage <= 2.355) Rapid sample interval set to five minutes Sensor sample interval set to five minutes Lightning sensor disabled Haptic sensor disabled
Just verified my Tempest and I'm at 100% (2.81V). I wonder if you have a different model battery. I did lower my initial 100% based on readings the @briis had on his Tempest. Would you mind sharing a 24 hour graph of your voltage (preferable with a sunny day)? I realize this may take awhile. I also realize images can be a pain with GitHub so if you post on the WeatherFlow or HomeAssistant forums I should get it.
To be clear, I don't think there is any issue with the battery percentage readings. I agree with the max/min ranges and calculation. Mine does charge to 100%. I was just thinking that based on this from Weatherflow which indicates that the Tempest will stop charging until it hits around 75%, that it might also be useful to see the operating mode. I think having both sensors would be useful.
The battery charge controller will halt charging around 2.6-2.8v (absolute max capacity) and then discharge the battery, decreasing voltage to a safe operating range around 2.55v.
I'd perhaps propose battery_operating_mode
as a name. Also this would only apply to the Tempest as I don't believe the Air and Sky do anything like this.
@GlennGoddard If you want, make the function in helpers.py
and I will do the rest, to create the sensor. This does only make sense for Tempest devices, so we should make a note of that in the README file.
Thanks @mjmeli for finding this. New information for me. I live in Denmark, which is not that far North, but until now, no WeatherFlow Solar Powered device has worked for me during winter. They all die around february. Next winter will be my first with a Tempest device, so I hope this one will stay powered on.
The official link to the information https://help.weatherflow.com/hc/en-us/articles/360048877194-Solar-Power-Rechargeable-Battery What makes more sense for output: 'Mode 0' or '0' I am thinking just the integer but I can see how the string could be useful; I think with a good name the integer should be sufficient. Thoughts?
I will suggest that the function just returns the integer as you also write. Then we need the link to the document so that people can see what it means. The name of the sensor will say the rest.
In order to prevent having another variable to compare against, I decided to simplify the range of modes. The upper and lower boundaries of when you are in a specific mode depend if the voltage is dropping down into that range or charging up passed it. Since the difference is not significant (in most cases) I went with the following:
if battery > 2.455:
# Mode 0
batt_mode = int(0)
elif battery > 2.40:
# Mode 1
# Simplification of voltage range
batt_mode = int(1)
elif battery > 2.355:
# Mode 2
# Simplification of voltage range
batt_mode = int(2)
else:
# Mode 3
batt_mode = int(3)
The ranges from 2 to 3 and vise versa have the biggest difference. I did think about making the assumption if solar radiation (SR) is >100 then assume charging (this would make the assumption there is no battery issues). 100 to 200 W/m^2 SR is considered the minimum to utilize a solar panel. Hum...after typing this I may have changed my own mind...I think I will have it assume charging (raising voltage) if >100 SR.
Instead of trying to have a voltage trend sensor to figure out charging or discharging I make the assumption the if >100 solar radiation then it it charging. The start and stop charging voltage points for the battery are irrelevant since both are inside the mode 0 range.
The sensor is now added, and can be found in the dev
build of the Docker Container. Please test it out and let me know if this works. I decided to only create the sensor if there is a Tempest device, so therefore it also got renamed to battery_mode
as it will not show up when AIR and SKY units are present.
It works for displaying mode 0 at least. I'm debating if I want to cover the solar panels and see what happens or if I should just wait for winter (ie the rainy season)
Yes, I have not tried that either. This will be my first winter with a Tempest device, so it will be interesting to see if the Solar Panels can charge with the little light we get here in the Northern part of Europe. My SKY unit with the Solar panel could not survive a full winter season - I had to move to batteries at some time during the winter. This is not an option with the tempest, so hopefully battery and solar charging is better on this device.
@mjmeli Is this what you had in mind? This is just in the dev tag and not the latest yet. But I think we have what you wanted.
I don't know about a charging state since the only way to truly know is to compare voltage over time. Right now I just make the assumption of charging if >100 Solar Radiation.
@briis What do you think about a trend sensor for voltage to determine charging/discharging?
I just pulled the dev image and it works as I expect. I also won't drop out of Mode 0 anytime soon to test other modes. I've also pulled it into my weather dashboard.
Seems like this is fixed now. Will be part of the 2.0.18 release.
This is relating to the new battery percentage that was added in #63. I understand the battery calculation for Tempest is set with a maximum of 2.8V. However per Weatherflow, the ideal operating range of the battery is actually 2.55V which is 75% of max capacity (https://help.weatherflow.com/hc/en-us/articles/360048877194-Solar-Power-Rechargeable-Battery).
I had a lot of confusion wondering why my device wouldn't charge above ~75% until I read this.
I just wanted to open a discussion about an option to help avoid this confusion. Maybe a separate sensor that reports the operating mode would be an easy solution. Tempest gives the operating ranges on that page where the top mode ("Mode 0") is Voltage>=2.455. I think this could be more useful information than a percentage.