Battery Status [solved]

Post Reply
linux150
Observer
Observer
Posts: 15
Joined: Sat May 22, 2021 12:18 pm
Station model: WMR968
Software: SDR -> Weewx -> MT
Contact:

Battery Status [solved]

Post by linux150 » Sun Jun 27, 2021 1:50 pm

Hi agn ;)

Im finally getting my end result of page for showing my visitors. But when i shutdown meteohub i´ll miss the battery status from my sensors.
Is there any possibility to show the battery status from my weewx sensor datas? I receive datas via rtl sdr and my meteotemplatelive.txt is including "WBAT" and "RBAT" Sensor data.

Code: Select all

{"U":1624801680,"SW":"weewx-4.4.0","UGP":913,"W":0,"G":0,"RR":0,"R":0,"UV":8,"TIN":24,"HIN":46,"T1":34.9,"H1":52,"WBAT":0,"RBAT":0,"UTime":1624801703,"SWTime":1624801703,"UGPTime":1624801703,"WTime":1624801703,"GTime":1624801703,"RRTime":1624801703,"RTime":1624801703,"UVTime":1624801703,"TINTime":1624801703,"HINTime":1624801703,"T1Time":1624801703,"H1Time":1624801703,"WBATTime":1624801703,"RBATTime":1624801703,"P":1010.532,"PTime":1624801703,"T":23.05,"H":56.5,"T2":20,"H2":54,"TTime":1624801650,"HTime":1624801650,"T2Time":1624801650,"H2Time":1624801650,"D":13.9,"DTime":1624801703,"A":24.3,"ATime":1624801703}
LG
Martin
Last edited by linux150 on Sun Aug 01, 2021 7:10 am, edited 1 time in total.

linux150
Observer
Observer
Posts: 15
Joined: Sat May 22, 2021 12:18 pm
Station model: WMR968
Software: SDR -> Weewx -> MT
Contact:

Re: Battery Status

Post by linux150 » Tue Jul 13, 2021 10:39 pm

Also found out, that i have more Batterystatus in my weewx packets (like UV,Indoor, Outdoor), but in meteotemplatelive only RBAT and WBAT.
How do i get this batteryinfo (batterystatus 0 = ok, 1 = low) into meteotemplatelive and my api ?

EDIT : Changed in my weewx.conf from "outBatteryStatus" and "inBatteryStatus" to outTempBatterystatus and inTempBatterystatus and now in and out Battery are also in Meteotemplatelive.txt.
Only UVBatteryStatus is missing now......

Code: Select all

{"U":1626217500,"SW":"weewx-4.4.0","T":14.2,"H":83,"P":1008.176,"UGP":908,"W":0,"G":0,"RR":0,"R":0,"UV":0,"TIN":23.5,"HIN":55,"T1":14.5,"H1":86,"T2":21,"H2":54,"WBAT":0,"RBAT":0,"TBAT":0,"TINBAT":0,"UTime":1626217523,"SWTime":1626217523,"TTime":1626217523,"HTime":1626217523,"PTime":1626217523,"UGPTime":1626217523,"WTime":1626217523,"GTime":1626217523,"RRTime":1626217523,"RTime":1626217523,"UVTime":1626217523,"TINTime":1626217523,"HINTime":1626217523,"T1Time":1626217523,"H1Time":1626217523,"T2Time":1626217523,"H2Time":1626217523,"WBATTime":1626217523,"RBATTime":1626217523,"TBATTime":1626217523,"TINBATTime":1626217523,"D":11.3,"DTime":1626217523,"A":14.6,"ATime":1626217523}
LG
Martin

davidefa
Expert
Expert
Posts: 658
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Battery Status

Post by davidefa » Wed Jul 14, 2021 11:34 am

You have to configure weewx to pass the required field.
All the fields passed to api.php will be in your meteotemplateLive.txt
To show the fields passed to api.php take a look at your cache/apiLog.txt the first part contains this info ( if it's not there it won't be in meteotemplateLive.txt )
Here my sensors
Authorized access.
Current date/time: 2021-07-14 13:18:41
api called by http
update U: 1626261521
update T: 30.11
update H: 36
update P: 1008.38
update W: 2.16
update G: 7.19
update B: 0
update R: 0
update RR: 0
update S: 654.13
update UV: 6
update TIN: 28
update HIN: 47
update T1: 26.3
update SM1: 61
update SM2: 100
update L: 7
update LD: 24
update LT: 1626253402
update WH25BAT: 0
update LBAT: 5
update WH65BAT: 0
update SM1BAT: 1.3
update SM2BAT: 1.2
update T1BAT: 0
update Station: WH2650A
update FW: V1.6.3
update T6: 26.3
To check this, simply call your api.php passing at least 3 parameters:
PASS=your_update_password
U=utc_timestamp ( see for example https://www.unixtimestamp.com/ )
NEWFIELD=xxxx
In my case I would call: http://www.fanometeo.it/template/api.ph ... FIELD=1234
Now I can see NEWFIELD added to meteotemplateLive.txt


NOTE please add a link to your site
Image

linux150
Observer
Observer
Posts: 15
Joined: Sat May 22, 2021 12:18 pm
Station model: WMR968
Software: SDR -> Weewx -> MT
Contact:

Re: Battery Status

Post by linux150 » Sun Jul 18, 2021 6:06 am

Hi!
Tnx for reply
Battery status is already in meteotemplatelive.txt but not shown in the api. Mybe because there are only send "0" when battery is ok?! Weewx should send "1" when battery is not ok ...


Found out to handle "Sticker" Plugin, so theres a link to my site. Should be also shown in my profile...
https://wetter.hildner.at/plugins/apiViewer/index.php
Last edited by linux150 on Mon Jul 19, 2021 10:21 am, edited 1 time in total.

davidefa
Expert
Expert
Posts: 658
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Battery Status

Post by davidefa » Sun Jul 18, 2021 10:52 am

Ok, by saying "not shown in the api" you mean is not shown in the plugin apiviewer.
The plugin apiviewer does not show every field received by api.php ( it decodes the content of meteotemplateLive.txt ), but shows only 'well known' fields, which are the following:
U,SW,BAT,T,H,P,W,G,B,R,D,A,S,TIN,HIN,UV,SS,CC,L,SN,SD,NL,T#,H#,TS#,LT#,SM#,LW#,CO2_#,NO2_#,SO2_#,O3_#,PP#

This only to say that sensors' battery and 'additional sensors' won't be shown in apiviewer plugin.
But as long as the batteries information is in meteotemplateLive.txt ( as in your case ) you should be good to go.
I mean if you have a block or a plugin that reads/shows this information you are already ok.
( for example I use the ecowitt block that shows battery status information of every sensor, but not sure if a similar block exists for your oregon station, but it can be done )
Image

linux150
Observer
Observer
Posts: 15
Joined: Sat May 22, 2021 12:18 pm
Station model: WMR968
Software: SDR -> Weewx -> MT
Contact:

Re: Battery Status

Post by linux150 » Mon Jul 19, 2021 9:06 am

ok tnx again.
I did read already view things about the ecowitt and i will try to modify, maybe i´ll get a result that works ;)
Also i did read about modification of the api.php. I´ll also look for that, and i hope i can post a result here.

LG
Martin

linux150
Observer
Observer
Posts: 15
Joined: Sat May 22, 2021 12:18 pm
Station model: WMR968
Software: SDR -> Weewx -> MT
Contact:

Re: Battery Status

Post by linux150 » Fri Jul 30, 2021 10:13 am

Did it!

Tnx
Martin
Attachments
1.png
1.png (24.49 KiB) Viewed 1318 times

linux150
Observer
Observer
Posts: 15
Joined: Sat May 22, 2021 12:18 pm
Station model: WMR968
Software: SDR -> Weewx -> MT
Contact:

Re: Battery Status [solved]

Post by linux150 » Sun Aug 01, 2021 7:17 am

Update 0.2
Battery Symbols from the fa font.
Credits goes to all blocks where i got input to copy/paste. I´m a newbie in php ;)

Greetings
Martin
Attachments
battery.zip
(1.7 KiB) Downloaded 35 times
battery.jpg
battery.jpg (7.45 KiB) Viewed 1291 times

Post Reply