captain-coredump / weatherflow-udp

WeatherFlow Personal Weather Station driver for weewx, via UDP broadcast packets
GNU General Public License v3.0
54 stars 18 forks source link

WeeWx SensorStatus (Wind Battery) and (Outside Temperature Battery) both show LOW #15

Open TonyHuk opened 3 years ago

TonyHuk commented 3 years ago

I'm not sure if it's possible to gather the battery status from the UDP stream and plug it into the WeeWx basic web page... is it?

image

Would this be something that can be controlled in the Weewx.conf file? or something that is part of the style sheet for the web page? I'm in no way a programmer, so I apologize for the ignorant question!

jjvdgeer commented 3 years ago

If you find the file weewx/skins/Seasons/sensors.inc and load it in an editor, you find these lines at the start:

#if $x == 0
<span class="status_ok">OK</span>
#else
<span class="status_low">LOW</span>
#end if
#end def

If you replace that with:

#if $x >= 2.455
<span class="status_ok">OK - $current.outTempBatteryStatus.raw</span>
#else
#if $x >= 2.41
<span class="status_low">LOW - mode 1 - $current.outTempBatteryStatus.raw</span>
#else
#if $x >= 2.39
<span class="status_low">LOW - mode 2 - $current.outTempBatteryStatus.raw</span>
#else
<span class="status_low">LOW - mode 3 - $current.outTempBatteryStatus.raw</span>
#end if
#end if
#end if
#end def

The modes are not really correct with this code, but I think it's OKish. The actual logic is a bit more complex and I don't think you can deduct that just from one voltage. Better than the original anyway... :)

I later ended up with adding a graph for the battery, which is much nicer :) To do that copy the supplied index.html.tmpl over your existing file (keep the original just in case ;-) ) index.zip

TonyHuk commented 3 years ago

Thanks for sending this...

I performed all of the edits you recommended, and when I restarted Weewx, the new index.html.tmpl does not seem to display the sensor data on the Standard page, as you described... I checked permissions on the file and directory... they are OK.

Any thoughts on this?

I really appreciate your help on this.

Tony

On Thu, Jan 14, 2021 at 3:34 PM jjvdgeer notifications@github.com wrote:

If you find the file weewx/skins/Seasons/sensors.inc and load it in an editor, you find these lines at the start:

if $x == 0

OK

else

LOW

end if

end def

If you replace that with:

if $x >= 2.455

OK - $current.outTempBatteryStatus.raw

else

if $x >= 2.41

LOW - mode 1 - $current.outTempBatteryStatus.raw

else

if $x >= 2.39

LOW - mode 2 - $current.outTempBatteryStatus.raw

else

LOW - mode 3 - $current.outTempBatteryStatus.raw

end if

end if

end if

end def

The modes are not really correct with this code, but I think it's OKish. The actual logic is a bit more complex and I don't think you can deduct that just from one voltage. Better than the original anyway... :)

I later ended up with adding a graph for the battery, which is much nicer :) To do that copy the supplied index.html.tmpl over your existing file (keep the original just in case ;-) ) index.zip https://github.com/captain-coredump/weatherflow-udp/files/5816870/index.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/captain-coredump/weatherflow-udp/issues/15#issuecomment-760460077, or unsubscribe https://github.com/notifications/unsubscribe-auth/AISQTJ3P4QNY6NX3XC2POYTSZ5IOFANCNFSM4V6SNTWQ .

-- Tony Huk

Local Weather in Palmer Township... [image: Find more about Weather in Easton, PA] http://www.wunderground.com/cgi-bin/findweather/getForecast?query=zmw:18040.1.99999&bannertypeclick=wu_clean2day Click for weather forecast http://www.wunderground.com/cgi-bin/findweather/getForecast?query=zmw:18040.1.99999&bannertypeclick=wu_clean2day

jjvdgeer commented 3 years ago

Maybe I forgot something. Not in a position to check today but could you check if the bitmaps are generated? They are called 'dayvolt.png' and similar for week, month & year. They should be in the same directory as index.html and the other bitmaps. I seem to remember they already were generated without me changing anything.

Mine looks like this: https://jjvdgeer.myqnapcloud.com/weewxwf/

jjvdgeer commented 3 years ago

Another thought :how does your sensor map look? I think it needs an entry for the voltage reading...

TonyHuk commented 3 years ago

I know it's been a while... just got back from traveling.

Here's the current copy of my sensors.inc file, renamed with my name... Can you please take a look at it, and perhaps make those changes you suggested? It's not like I can't edit a file... I indeed can do that.

However, your new block to replace the original block has a lot more data after it that I wasn't sure should be deleted, or left alone, etc.

Any guidance is appreciated!

Tony

On Sun, Jan 17, 2021 at 5:31 AM jjvdgeer notifications@github.com wrote:

Another thought :how does your sensor map look? I think it needs an entry for the voltage reading...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/captain-coredump/weatherflow-udp/issues/15#issuecomment-761768009, or unsubscribe https://github.com/notifications/unsubscribe-auth/AISQTJ53R54K35JNF2IUOGLS2K4APANCNFSM4V6SNTWQ .

-- Tony Huk

Local Weather in Palmer Township... [image: Find more about Weather in Easton, PA] http://www.wunderground.com/cgi-bin/findweather/getForecast?query=zmw:18040.1.99999&bannertypeclick=wu_clean2day Click for weather forecast http://www.wunderground.com/cgi-bin/findweather/getForecast?query=zmw:18040.1.99999&bannertypeclick=wu_clean2day

jjvdgeer commented 3 years ago

I don't see the file you say you included?

TonyHuk commented 3 years ago

That’s weird, since it shows as an attachment to my last email.

I’ll try again later.

Tony Huk th18045@gmail.com


From: jjvdgeer notifications@github.com Sent: Monday, February 15, 2021 3:12:13 PM To: captain-coredump/weatherflow-udp weatherflow-udp@noreply.github.com Cc: TonyHuk th18045@gmail.com; Author author@noreply.github.com Subject: Re: [captain-coredump/weatherflow-udp] WeeWx SensorStatus (Wind Battery) and (Outside Temperature Battery) both show LOW (#15)

I don't see the file you say you included?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/captain-coredump/weatherflow-udp/issues/15#issuecomment-779427879, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AISQTJ6UBWV5YYZSEDRTXCDS7F5Z3ANCNFSM4V6SNTWQ.

jjvdgeer commented 3 years ago

Are you entering your messages on github by replying to mail? I suppose that doesn't work for attachments then :)

hikeonpast commented 2 years ago

I know this is an old thread, but I'd love to see it to conclusion.

I have battery status displaying correctly under Sensor Status, so I know that outTempBatteryStatus.raw is defined in my setup.

Using the index.html.tmpl from @jjvdgeer generates the voltage chart png files (dayvolt.png, etc) properly, but the graph is empty with seemingly undefined variables: image

weewx does a great job of abstraction, making it really hard for the uninitiated to track stuff down. Any pointers are appreciated, and I'll happily update this thread for the benefit of future Tempest users that like battery capacity graphs.

hikeonpast commented 2 years ago

I addressed it by updating [[sensor_map]] to assign the Tempest battery to both outTempBatteryStatus (default) and consBatteryVoltage (new) in weewx.conf and then commenting out the unused voltage headers in each report defined in skin.conf. Perhaps not the most elegant way to approach it, but I've got my battery trend data now.

jjvdgeer commented 2 years ago

@hikeonpast Sorry for the late reply... I mapped outTempBatteryStatus in my sensormap and in the skins.conf I defined the day/week/month/yearvolt graphs like this:

        [[[dayvolt]]]
            [[[[outTempBatteryStatus]]]]

(and the same for weekvolt and so on)

That way there's no need to map it twice.

You might also want to add, under [StdReport], under [[Defaults]], under [[[Labels]]] under [[[[Generic]]]]:

outTempBatteryStatus = Tempest Battery

That way you get a nice label on the graph.