Page 1 of 1
Battery Status [solved]
Posted: Sun Jun 27, 2021 1:50 pm
by linux150
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
Re: Battery Status
Posted: Tue Jul 13, 2021 10:39 pm
by linux150
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
Re: Battery Status
Posted: Wed Jul 14, 2021 11:34 am
by davidefa
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
Re: Battery Status
Posted: Sun Jul 18, 2021 6:06 am
by linux150
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
Re: Battery Status
Posted: Sun Jul 18, 2021 10:52 am
by davidefa
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 )
Re: Battery Status
Posted: Mon Jul 19, 2021 9:06 am
by linux150
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
Re: Battery Status
Posted: Fri Jul 30, 2021 10:13 am
by linux150
Did it!
Tnx
Martin
Re: Battery Status [solved]
Posted: Sun Aug 01, 2021 7:17 am
by linux150
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