Hi Gary,
So I guess I'm a perdoid control freak but when run as a service it's just
to supplement data provided by my normal driver, and other services. I get
paranoid over what the service has the ability to map too. Because I only
have 4 WH31 , 1 WH 57, and the Gw 1000 itself it is way easier to tell it
what I want versus what I don't want. Owning the mapping and being able to
keep it in weewx.config is exactly what I want. However without the
modification I suggested no battery_field_map is loaded from weewx.conf or
the driver code.
So with this in weewx.conf
[GW1000]
driver = user.gw1000
[[field_map]]
inTemp = intemp
inHumidity = inhumid
pressure = absbarometer
dateTime = datetime
extraTemp2 = temp2
extraTemp3 = temp3
extraTemp4 = temp4
extraTemp5 = temp5
extraHumid2 = humid2
extraHumid3 = humid3
extraHumid4 = humid4
extraHumid5 = humid5
lightning_distance = lightningdist
lightning_last_det_time = lightningdettime
lightning_strike_count = lightning_strike_count
[[battery_field_map]]
wh31_ch2_batt = wh31_ch2_batt
wh31_ch3_batt = wh31_ch3_batt
wh31_ch4_batt = wh31_ch4_batt
wh31_ch5_batt = wh31_ch5_batt
wh57_batt = wh57_batt
[Accumulator]
[[lightning_strike_count]]
extractor = sum
[[lightning_last_det_time]]
extractor = last
[[lightning_distance]]
extractor = last
[[wh31_ch2_batt]]
extractor = last
[[wh31_ch3_batt]]
extractor = last
[[wh31_ch4_batt]]
extractor = last
[[wh31_ch5_batt]]
extractor = last
[[wh57_batt]]
extractor = last
No battery_field_map is applied at all.
The other point of concern is over blindly pasting the full [Accumulator]
stanza into weewx.conf when running as a service. Feel it's really easy for
someone not to realize the unattended consequences caused by the fact that
this will affect the Accumulator type for fields generated by the normal
driver and other services in use in addition to the GW1000 service.
On Mon, Aug 3, 2020 at 4:51 PM gjr80 <[email protected]> wrote:
> Paul,
>
> The current field_map behaviour is deliberate, it probably doesn’t help
> that I have not documented the behaviour yet. The expected behaviour is:
>
> 1. If the user specifies nothing the default field map is used. (The
> default field map can be viewed by running the driver directly with the
> —default-map command line option. The default field map happens to be
> constructed from the field map dict and battery map dict)
>
> 2. The user can specify a mapping under [field_map], in this case the user
> specified field map replaces the default field map, in other words the user
> takes full responsibility for the field map. You can run the driver
> directly using the —live-data command line option to see what data ,
> including battery state data, is available from the GW1000 for mapping. You
> can extend the [field_map] with [field_map_extensions] but why would you.
>
> 3. If the user is happy with the default field map but wants to map a few
> fields differently they can use [field_map_extensions] to modify the field
> map rathe4 than having to specify every mapping with [field_map].
> [field_map_extensions] are used to modify the field map (typically the
> default field map), basically any GW1000 ‘fields’ in the
> [field_map_extensions] are removed from the field map then the
> [field_map_extensions] entries are added to the field map.
>
> The behaviour above is fairly much standard among drivers that use
> field/sensor maps with [field_map] and [field_map_extensions].
>
> I will document this in the driver wiki shortly.
>
> Gary
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/9cfb56c1-fc22-4281-b4a5-4e0bf84efcabo%40googlegroups.com
> .
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/CAOAVAeecEVWzPDyZRkn%3D4U_xX5Xc4mO2kvQNM48yyUy5e%2BumRg%40mail.gmail.com.