Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread michael.k...@gmx.at
Noted that. I might drop off one bottle, when I'm in Hood River next time. 

Tom Keffer schrieb am Montag, 17. Juli 2023 um 00:50:40 UTC+2:

> Glad it's working for you.
>
> Single-malt Scotch works best for me.
>
> On Sun, Jul 16, 2023 at 2:23 PM Messy Potamia  wrote:
>
>> I followed that guidance, removed my hack to units.py, placed the
>> entries in user/lakedata.py, and it's great.
>> to wit:
>> LakeElev 594.74 ftMSL
>>
>> Yeah.
>> Thank you again. This is probably what I should've done way back in
>> the 3.9 days.
>> Phil
>>
>> On Sun, Jul 16, 2023 at 11:00 PM Messy Potamia  
>> wrote:
>> >
>> > Before I read your reply I edited units.py and added LakeElev to
>> > group_altitude at the bottom of the ...Dicts whatever-that-is, gave it
>> > some time, had a bourbon, and lo and behold it is now printing out
>> > lake elevation as ""LakeElev 594.75 feet" instead of 594.75
>> > But I'm going to read your section Assigning a unit group  to see what
>> > I did wrong. Don't know how I missed that.
>> > Thanks
>> > Phil
>> >
>> > On Sun, Jul 16, 2023 at 10:44 PM Tom Keffer  wrote:
>> > >
>> > > The answer is that you're confusing units (such as "inHg") with 
>> observation types (such as "LakeElev").
>> > >
>> > > The StringFormats section uses units as keys, not observation 
>> types. If LakeElev is measured in meters, it will use whatever formatting 
>> has been specified for meters.
>> > >
>> > > I suspect that you have not specified which unit group LakeElev is 
>> in, so WeeWX is just printing out the raw, unformatted value. See the 
>> section Assigning a unit group for how to do this. Once it's a member of a 
>> unit group (say "group_altitude") it will use whatever unit that group is 
>> measured in (usually meters or feet) and follow the formatting conventions 
>> for that unit.
>> > >
>> > > Or, maybe you have already done that and something else is wrong, in 
>> which case, come back and give us more details.
>> > >
>> > > -tk
>> > >
>> > > On Sun, Jul 16, 2023 at 11:45 AM Messy Potamia  
>> wrote:
>> > >>
>> > >> re: "3. I'm not following your question about "LakeElev". I don't 
>> know
>> > >> what that is."
>> > >> I have a ultrasonic range sensor (MaxBotix) which uses ttyS0 on the 
>> pi
>> > >> which some python code (which has been working very well for several
>> > >> years and still is) which writes a single line of text containing two
>> > >> values to a file. My /home/weewx/bin/user/lakedata.py reads the first
>> > >> value, converts it to a float, and stores it in the new parameter I
>> > >> added to the weewx.sdb using the utility to add a column. Using a
>> > >> sqlitebrowser i verified that column is populating every 5 minutes.
>> > >> The name of the column is LakeElev; weewx is successfully displaying
>> > >> that data since I've added it to the proper skins/configs.
>> > >> The only problem is, even after reading & rereading the guides, I
>> > >> don't get how I tell weewx to treat that as a fully organized
>> > >> measurement. For instance, added "StringFormats
>> > >> inHg = %.2f" to weewx.conf and it indeed gives the desired
>> > >> format to barometer. However, my attempts to provide a format to
>> > >> LakeElev has met with acute disaster. Here's a segment from my
>> > >> weewx.conf with comments:
>> > >>
>> > >>   StringFormats
>> > >>
>> > >> count = %d
>> > >> foot = %.2f
>> > >> inch2 = %.1f
>> > >> inHg = %.2f
>> > >> #LakeElev = %.2f  #DOES NOTHING
>> > >> #$current.LakeElev.format(format_string="%.2f")
>> > >> #CRASHES STDREPORT THREAD
>> > >> #current.LakeElev.format(format_string="%.2f")
>> > >> #CRASHES ENGINE
>> > >>
>> > >> As you can see I still don't know what I'm doing. Here's the contents
>> > >> of my lakedata.py, which is working fine, but notice the #Note I 
>> wrote
>> > >> to myself in it:
>> > >>
>> > >> #!/usr/bin/env python
>> > >>
>> > >> #file user/lakedata.py
>> > >> import weewx
>> > >> import weewx.units
>> > >> from weewx.engine import StdService
>> > >>
>> > >> class AddLakedata(StdService):
>> > >>
>> > >> def __init__(self, engine, config_dict):
>> > >>   # Initialize my superclass first:
>> > >> super(AddLakedata, self).__init__(engine, 
>> config_dict)
>> > >>   # Bind to any new archive record events:
>> > >> self.bind(weewx.NEW_ARCHIVE_RECORD, 
>> self.new_archive_packet)
>> > >>
>> > >> def new_archive_packet(self, event):
>> > >>
>> > >> #(code that reads two measurements from a file)
>> > >> with open("/home/pi/wxdata/weewxmbdata.dat") as f:
>> > >> for line in f:
>> > >> numbers_str = line.split()
>> > >> numbers_float = [float(x) for x in 
>> numbers_str]
>> > >> value1 = 

Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Tom Keffer
Glad it's working for you.

Single-malt Scotch works best for me.

On Sun, Jul 16, 2023 at 2:23 PM Messy Potamia 
wrote:

> I followed that guidance, removed my hack to units.py, placed the
> entries in user/lakedata.py, and it's great.
> to wit:
> LakeElev 594.74 ftMSL
>
> Yeah.
> Thank you again. This is probably what I should've done way back in
> the 3.9 days.
> Phil
>
> On Sun, Jul 16, 2023 at 11:00 PM Messy Potamia 
> wrote:
> >
> > Before I read your reply I edited units.py and added LakeElev to
> > group_altitude at the bottom of the ...Dicts whatever-that-is, gave it
> > some time, had a bourbon, and lo and behold it is now printing out
> > lake elevation as ""LakeElev 594.75 feet" instead of 594.75
> > But I'm going to read your section Assigning a unit group  to see what
> > I did wrong. Don't know how I missed that.
> > Thanks
> > Phil
> >
> > On Sun, Jul 16, 2023 at 10:44 PM Tom Keffer  wrote:
> > >
> > > The answer is that you're confusing units (such as "inHg") with
> observation types (such as "LakeElev").
> > >
> > > The StringFormats section uses units as keys, not observation
> types. If LakeElev is measured in meters, it will use whatever formatting
> has been specified for meters.
> > >
> > > I suspect that you have not specified which unit group LakeElev is in,
> so WeeWX is just printing out the raw, unformatted value. See the section
> Assigning a unit group for how to do this. Once it's a member of a unit
> group (say "group_altitude") it will use whatever unit that group is
> measured in (usually meters or feet) and follow the formatting conventions
> for that unit.
> > >
> > > Or, maybe you have already done that and something else is wrong, in
> which case, come back and give us more details.
> > >
> > > -tk
> > >
> > > On Sun, Jul 16, 2023 at 11:45 AM Messy Potamia 
> wrote:
> > >>
> > >> re: "3. I'm not following your question about "LakeElev". I don't know
> > >> what that is."
> > >> I have a ultrasonic range sensor (MaxBotix) which uses ttyS0 on the pi
> > >> which some python code (which has been working very well for several
> > >> years and still is) which writes a single line of text containing two
> > >> values to a file. My /home/weewx/bin/user/lakedata.py reads the first
> > >> value, converts it to a float, and stores it in the new parameter I
> > >> added to the weewx.sdb using the utility to add a column. Using a
> > >> sqlitebrowser i verified that column is populating every 5 minutes.
> > >> The name of the column is LakeElev; weewx is successfully displaying
> > >> that data since I've added it to the proper skins/configs.
> > >> The only problem is, even after reading & rereading the guides, I
> > >> don't get how I tell weewx to treat that as a fully organized
> > >> measurement. For instance, added "StringFormats
> > >> inHg = %.2f" to weewx.conf and it indeed gives the desired
> > >> format to barometer. However, my attempts to provide a format to
> > >> LakeElev has met with acute disaster. Here's a segment from my
> > >> weewx.conf with comments:
> > >>
> > >>   StringFormats
> > >>
> > >> count = %d
> > >> foot = %.2f
> > >> inch2 = %.1f
> > >> inHg = %.2f
> > >> #LakeElev = %.2f  #DOES NOTHING
> > >> #$current.LakeElev.format(format_string="%.2f")
> > >> #CRASHES STDREPORT THREAD
> > >> #current.LakeElev.format(format_string="%.2f")
> > >> #CRASHES ENGINE
> > >>
> > >> As you can see I still don't know what I'm doing. Here's the contents
> > >> of my lakedata.py, which is working fine, but notice the #Note I wrote
> > >> to myself in it:
> > >>
> > >> #!/usr/bin/env python
> > >>
> > >> #file user/lakedata.py
> > >> import weewx
> > >> import weewx.units
> > >> from weewx.engine import StdService
> > >>
> > >> class AddLakedata(StdService):
> > >>
> > >> def __init__(self, engine, config_dict):
> > >>   # Initialize my superclass first:
> > >> super(AddLakedata, self).__init__(engine, config_dict)
> > >>   # Bind to any new archive record events:
> > >> self.bind(weewx.NEW_ARCHIVE_RECORD,
> self.new_archive_packet)
> > >>
> > >> def new_archive_packet(self, event):
> > >>
> > >> #(code that reads two measurements from a file)
> > >> with open("/home/pi/wxdata/weewxmbdata.dat") as f:
> > >> for line in f:
> > >> numbers_str = line.split()
> > >> numbers_float = [float(x) for x in
> numbers_str]
> > >> value1 = numbers_float[0]
> > >> value2 = numbers_float[1]
> > >>
> > >> event.record['LakeElev'] = value1
> > >> #event.record['lakeWaveheight'] = value2
> > >>
> > >> #
> > >> #Am I supposed to assign this to a units group? Which is best? 

Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Messy Potamia
I followed that guidance, removed my hack to units.py, placed the
entries in user/lakedata.py, and it's great.
to wit:
LakeElev 594.74 ftMSL

Yeah.
Thank you again. This is probably what I should've done way back in
the 3.9 days.
Phil

On Sun, Jul 16, 2023 at 11:00 PM Messy Potamia  wrote:
>
> Before I read your reply I edited units.py and added LakeElev to
> group_altitude at the bottom of the ...Dicts whatever-that-is, gave it
> some time, had a bourbon, and lo and behold it is now printing out
> lake elevation as ""LakeElev 594.75 feet" instead of 594.75
> But I'm going to read your section Assigning a unit group  to see what
> I did wrong. Don't know how I missed that.
> Thanks
> Phil
>
> On Sun, Jul 16, 2023 at 10:44 PM Tom Keffer  wrote:
> >
> > The answer is that you're confusing units (such as "inHg") with observation 
> > types (such as "LakeElev").
> >
> > The StringFormats section uses units as keys, not observation 
> > types. If LakeElev is measured in meters, it will use whatever formatting 
> > has been specified for meters.
> >
> > I suspect that you have not specified which unit group LakeElev is in, so 
> > WeeWX is just printing out the raw, unformatted value. See the section 
> > Assigning a unit group for how to do this. Once it's a member of a unit 
> > group (say "group_altitude") it will use whatever unit that group is 
> > measured in (usually meters or feet) and follow the formatting conventions 
> > for that unit.
> >
> > Or, maybe you have already done that and something else is wrong, in which 
> > case, come back and give us more details.
> >
> > -tk
> >
> > On Sun, Jul 16, 2023 at 11:45 AM Messy Potamia  
> > wrote:
> >>
> >> re: "3. I'm not following your question about "LakeElev". I don't know
> >> what that is."
> >> I have a ultrasonic range sensor (MaxBotix) which uses ttyS0 on the pi
> >> which some python code (which has been working very well for several
> >> years and still is) which writes a single line of text containing two
> >> values to a file. My /home/weewx/bin/user/lakedata.py reads the first
> >> value, converts it to a float, and stores it in the new parameter I
> >> added to the weewx.sdb using the utility to add a column. Using a
> >> sqlitebrowser i verified that column is populating every 5 minutes.
> >> The name of the column is LakeElev; weewx is successfully displaying
> >> that data since I've added it to the proper skins/configs.
> >> The only problem is, even after reading & rereading the guides, I
> >> don't get how I tell weewx to treat that as a fully organized
> >> measurement. For instance, added "StringFormats
> >> inHg = %.2f" to weewx.conf and it indeed gives the desired
> >> format to barometer. However, my attempts to provide a format to
> >> LakeElev has met with acute disaster. Here's a segment from my
> >> weewx.conf with comments:
> >>
> >>   StringFormats
> >>
> >> count = %d
> >> foot = %.2f
> >> inch2 = %.1f
> >> inHg = %.2f
> >> #LakeElev = %.2f  #DOES NOTHING
> >> #$current.LakeElev.format(format_string="%.2f")
> >> #CRASHES STDREPORT THREAD
> >> #current.LakeElev.format(format_string="%.2f")
> >> #CRASHES ENGINE
> >>
> >> As you can see I still don't know what I'm doing. Here's the contents
> >> of my lakedata.py, which is working fine, but notice the #Note I wrote
> >> to myself in it:
> >>
> >> #!/usr/bin/env python
> >>
> >> #file user/lakedata.py
> >> import weewx
> >> import weewx.units
> >> from weewx.engine import StdService
> >>
> >> class AddLakedata(StdService):
> >>
> >> def __init__(self, engine, config_dict):
> >>   # Initialize my superclass first:
> >> super(AddLakedata, self).__init__(engine, config_dict)
> >>   # Bind to any new archive record events:
> >> self.bind(weewx.NEW_ARCHIVE_RECORD, 
> >> self.new_archive_packet)
> >>
> >> def new_archive_packet(self, event):
> >>
> >> #(code that reads two measurements from a file)
> >> with open("/home/pi/wxdata/weewxmbdata.dat") as f:
> >> for line in f:
> >> numbers_str = line.split()
> >> numbers_float = [float(x) for x in 
> >> numbers_str]
> >> value1 = numbers_float[0]
> >> value2 = numbers_float[1]
> >>
> >> event.record['LakeElev'] = value1
> >> #event.record['lakeWaveheight'] = value2
> >>
> >> #
> >> #Am I supposed to assign this to a units group? Which is best? What if I 
> >> don't?
> >>
> >>
> >>
> >> Okay something tells me there's a few things i'm leaving out in adding
> >> this parameter. Like I said, back in the 3.9. days I modified some
> >> file (units.py?) but was told that wasn't the best way to add my
> >> lakedata parameters (which 

Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Messy Potamia
Before I read your reply I edited units.py and added LakeElev to
group_altitude at the bottom of the ...Dicts whatever-that-is, gave it
some time, had a bourbon, and lo and behold it is now printing out
lake elevation as ""LakeElev 594.75 feet" instead of 594.75
But I'm going to read your section Assigning a unit group  to see what
I did wrong. Don't know how I missed that.
Thanks
Phil

On Sun, Jul 16, 2023 at 10:44 PM Tom Keffer  wrote:
>
> The answer is that you're confusing units (such as "inHg") with observation 
> types (such as "LakeElev").
>
> The StringFormats section uses units as keys, not observation types. 
> If LakeElev is measured in meters, it will use whatever formatting has been 
> specified for meters.
>
> I suspect that you have not specified which unit group LakeElev is in, so 
> WeeWX is just printing out the raw, unformatted value. See the section 
> Assigning a unit group for how to do this. Once it's a member of a unit group 
> (say "group_altitude") it will use whatever unit that group is measured in 
> (usually meters or feet) and follow the formatting conventions for that unit.
>
> Or, maybe you have already done that and something else is wrong, in which 
> case, come back and give us more details.
>
> -tk
>
> On Sun, Jul 16, 2023 at 11:45 AM Messy Potamia  wrote:
>>
>> re: "3. I'm not following your question about "LakeElev". I don't know
>> what that is."
>> I have a ultrasonic range sensor (MaxBotix) which uses ttyS0 on the pi
>> which some python code (which has been working very well for several
>> years and still is) which writes a single line of text containing two
>> values to a file. My /home/weewx/bin/user/lakedata.py reads the first
>> value, converts it to a float, and stores it in the new parameter I
>> added to the weewx.sdb using the utility to add a column. Using a
>> sqlitebrowser i verified that column is populating every 5 minutes.
>> The name of the column is LakeElev; weewx is successfully displaying
>> that data since I've added it to the proper skins/configs.
>> The only problem is, even after reading & rereading the guides, I
>> don't get how I tell weewx to treat that as a fully organized
>> measurement. For instance, added "StringFormats
>> inHg = %.2f" to weewx.conf and it indeed gives the desired
>> format to barometer. However, my attempts to provide a format to
>> LakeElev has met with acute disaster. Here's a segment from my
>> weewx.conf with comments:
>>
>>   StringFormats
>>
>> count = %d
>> foot = %.2f
>> inch2 = %.1f
>> inHg = %.2f
>> #LakeElev = %.2f  #DOES NOTHING
>> #$current.LakeElev.format(format_string="%.2f")
>> #CRASHES STDREPORT THREAD
>> #current.LakeElev.format(format_string="%.2f")
>> #CRASHES ENGINE
>>
>> As you can see I still don't know what I'm doing. Here's the contents
>> of my lakedata.py, which is working fine, but notice the #Note I wrote
>> to myself in it:
>>
>> #!/usr/bin/env python
>>
>> #file user/lakedata.py
>> import weewx
>> import weewx.units
>> from weewx.engine import StdService
>>
>> class AddLakedata(StdService):
>>
>> def __init__(self, engine, config_dict):
>>   # Initialize my superclass first:
>> super(AddLakedata, self).__init__(engine, config_dict)
>>   # Bind to any new archive record events:
>> self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_packet)
>>
>> def new_archive_packet(self, event):
>>
>> #(code that reads two measurements from a file)
>> with open("/home/pi/wxdata/weewxmbdata.dat") as f:
>> for line in f:
>> numbers_str = line.split()
>> numbers_float = [float(x) for x in 
>> numbers_str]
>> value1 = numbers_float[0]
>> value2 = numbers_float[1]
>>
>> event.record['LakeElev'] = value1
>> #event.record['lakeWaveheight'] = value2
>>
>> #
>> #Am I supposed to assign this to a units group? Which is best? What if I 
>> don't?
>>
>>
>>
>> Okay something tells me there's a few things i'm leaving out in adding
>> this parameter. Like I said, back in the 3.9. days I modified some
>> file (units.py?) but was told that wasn't the best way to add my
>> lakedata parameters (which back then included LakeElevation and
>> WaveHeight).
>> I'd like to do this the preferred way.
>>
>> Thanks again, so much - - -
>> Phil
>>
>> On Sun, Jul 16, 2023 at 4:22 PM Tom Keffer  wrote:
>> >
>> > Sorry. I had assumed you were still using your v3.9.1 Seasons skin. If 
>> > that's the case, the tag $current.barometer is in the file 
>> > Seasons/current.inc.
>> >
>> > Incidentally, there's no reason not to continue using your old skin.
>> >
>> > But, if you are actually using a V4 skin, then to answer your 

Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Tom Keffer
The answer is that you're confusing units (such as "inHg") with observation
types (such as "LakeElev").

The StringFormats section uses *units* as keys, not observation
types. If LakeElev is measured in meters, it will use whatever formatting
has been specified for meters.

I suspect that you have not specified which unit group LakeElev is in, so
WeeWX is just printing out the raw, unformatted value. See the section
*Assigning
a unit group
* for
how to do this. Once it's a member of a unit group (say "group_altitude")
it will use whatever unit that group is measured in (usually meters or
feet) and follow the formatting conventions for that unit.

Or, maybe you have already done that and something else is wrong, in which
case, come back and give us more details.

-tk

On Sun, Jul 16, 2023 at 11:45 AM Messy Potamia 
wrote:

> re: "3. I'm not following your question about "LakeElev". I don't know
> what that is."
> I have a ultrasonic range sensor (MaxBotix) which uses ttyS0 on the pi
> which some python code (which has been working very well for several
> years and still is) which writes a single line of text containing two
> values to a file. My /home/weewx/bin/user/lakedata.py reads the first
> value, converts it to a float, and stores it in the new parameter I
> added to the weewx.sdb using the utility to add a column. Using a
> sqlitebrowser i verified that column is populating every 5 minutes.
> The name of the column is LakeElev; weewx is successfully displaying
> that data since I've added it to the proper skins/configs.
> The only problem is, even after reading & rereading the guides, I
> don't get how I tell weewx to treat that as a fully organized
> measurement. For instance, added "StringFormats
> inHg = %.2f" to weewx.conf and it indeed gives the desired
> format to barometer. However, my attempts to provide a format to
> LakeElev has met with acute disaster. Here's a segment from my
> weewx.conf with comments:
>
>   StringFormats
>
> count = %d
> foot = %.2f
> inch2 = %.1f
> inHg = %.2f
> #LakeElev = %.2f  #DOES NOTHING
> #$current.LakeElev.format(format_string="%.2f")
> #CRASHES STDREPORT THREAD
> #current.LakeElev.format(format_string="%.2f")
> #CRASHES ENGINE
>
> As you can see I still don't know what I'm doing. Here's the contents
> of my lakedata.py, which is working fine, but notice the #Note I wrote
> to myself in it:
>
> #!/usr/bin/env python
>
> #file user/lakedata.py
> import weewx
> import weewx.units
> from weewx.engine import StdService
>
> class AddLakedata(StdService):
>
> def __init__(self, engine, config_dict):
>   # Initialize my superclass first:
> super(AddLakedata, self).__init__(engine, config_dict)
>   # Bind to any new archive record events:
> self.bind(weewx.NEW_ARCHIVE_RECORD,
> self.new_archive_packet)
>
> def new_archive_packet(self, event):
>
> #(code that reads two measurements from a file)
> with open("/home/pi/wxdata/weewxmbdata.dat") as f:
> for line in f:
> numbers_str = line.split()
> numbers_float = [float(x) for x in
> numbers_str]
> value1 = numbers_float[0]
> value2 = numbers_float[1]
>
> event.record['LakeElev'] = value1
> #event.record['lakeWaveheight'] = value2
>
> #
> #Am I supposed to assign this to a units group? Which is best? What if I
> don't?
>
>
>
> Okay something tells me there's a few things i'm leaving out in adding
> this parameter. Like I said, back in the 3.9. days I modified some
> file (units.py?) but was told that wasn't the best way to add my
> lakedata parameters (which back then included LakeElevation and
> WaveHeight).
> I'd like to do this the preferred way.
>
> Thanks again, so much - - -
> Phil
>
> On Sun, Jul 16, 2023 at 4:22 PM Tom Keffer  wrote:
> >
> > Sorry. I had assumed you were still using your v3.9.1 Seasons skin. If
> that's the case, the tag $current.barometer is in the file
> Seasons/current.inc.
> >
> > Incidentally, there's no reason not to continue using your old skin.
> >
> > But, if you are actually using a V4 skin, then to answer your questions:
> >
> > 1. The line "#set observations = ..." is actually saying get the set of
> observations from $DisplayOptions. If DisplayOptions does not have an
> entry, then the fallback is to use just outTemp and barometer. See the
> configuration file skin.conf for what's in DisplayOptions.
> >
> > 2. You can specify an override for the barometer formatting for the unit
> "inHg" in weewx.conf:
> >
> > [StdReport]
> >   ...
> >   [[Defaults]]
> > ...
> > [[[Units]]]
> >   ...
> >   

Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Messy Potamia
re: "3. I'm not following your question about "LakeElev". I don't know
what that is."
I have a ultrasonic range sensor (MaxBotix) which uses ttyS0 on the pi
which some python code (which has been working very well for several
years and still is) which writes a single line of text containing two
values to a file. My /home/weewx/bin/user/lakedata.py reads the first
value, converts it to a float, and stores it in the new parameter I
added to the weewx.sdb using the utility to add a column. Using a
sqlitebrowser i verified that column is populating every 5 minutes.
The name of the column is LakeElev; weewx is successfully displaying
that data since I've added it to the proper skins/configs.
The only problem is, even after reading & rereading the guides, I
don't get how I tell weewx to treat that as a fully organized
measurement. For instance, added "StringFormats
inHg = %.2f" to weewx.conf and it indeed gives the desired
format to barometer. However, my attempts to provide a format to
LakeElev has met with acute disaster. Here's a segment from my
weewx.conf with comments:

  StringFormats

count = %d
foot = %.2f
inch2 = %.1f
inHg = %.2f
#LakeElev = %.2f  #DOES NOTHING
#$current.LakeElev.format(format_string="%.2f")
#CRASHES STDREPORT THREAD
#current.LakeElev.format(format_string="%.2f")
#CRASHES ENGINE

As you can see I still don't know what I'm doing. Here's the contents
of my lakedata.py, which is working fine, but notice the #Note I wrote
to myself in it:

#!/usr/bin/env python

#file user/lakedata.py
import weewx
import weewx.units
from weewx.engine import StdService

class AddLakedata(StdService):

def __init__(self, engine, config_dict):
  # Initialize my superclass first:
super(AddLakedata, self).__init__(engine, config_dict)
  # Bind to any new archive record events:
self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_packet)

def new_archive_packet(self, event):

#(code that reads two measurements from a file)
with open("/home/pi/wxdata/weewxmbdata.dat") as f:
for line in f:
numbers_str = line.split()
numbers_float = [float(x) for x in numbers_str]
value1 = numbers_float[0]
value2 = numbers_float[1]

event.record['LakeElev'] = value1
#event.record['lakeWaveheight'] = value2

#
#Am I supposed to assign this to a units group? Which is best? What if I don't?



Okay something tells me there's a few things i'm leaving out in adding
this parameter. Like I said, back in the 3.9. days I modified some
file (units.py?) but was told that wasn't the best way to add my
lakedata parameters (which back then included LakeElevation and
WaveHeight).
I'd like to do this the preferred way.

Thanks again, so much - - -
Phil

On Sun, Jul 16, 2023 at 4:22 PM Tom Keffer  wrote:
>
> Sorry. I had assumed you were still using your v3.9.1 Seasons skin. If that's 
> the case, the tag $current.barometer is in the file Seasons/current.inc.
>
> Incidentally, there's no reason not to continue using your old skin.
>
> But, if you are actually using a V4 skin, then to answer your questions:
>
> 1. The line "#set observations = ..." is actually saying get the set of 
> observations from $DisplayOptions. If DisplayOptions does not have an entry, 
> then the fallback is to use just outTemp and barometer. See the configuration 
> file skin.conf for what's in DisplayOptions.
>
> 2. You can specify an override for the barometer formatting for the unit 
> "inHg" in weewx.conf:
>
> [StdReport]
>   ...
>   [[Defaults]]
> ...
> [[[Units]]]
>   ...
>   StringFormats
> inHg = %.2f
>
> 3. I'm not following your question about "LakeElev". I don't know what that 
> is.
>
>
> On Sun, Jul 16, 2023 at 12:33 AM Messy Potamia  wrote:
>>
>> Where do those 2 formatting statements go?
>> Also, why, in current.inc, is the line
>> #set $observations =
>> $to_list($DisplayOptions.get('observations_current', ['outTemp',
>> 'barometer']))
>> containing only outTemp and barometer? Where are the rest of the items
>> displayed in Current Conditions? Sorry I'm just not getting the
>> formatting layout big picture. Yes I'm reading the customization guide
>> but I'm having questions as I read it.
>> Thanks!
>>
>> On Sun, Jul 16, 2023 at 12:22 AM Tom Keffer  wrote:
>> >
>> > For altitude, format it like any other tag. See the section Formatting 
>> > options in the Customizing Guide. For example, if you do not want anything 
>> > beyond the decimal point:
>> >
>> > $station.altitude.format("%.0f")
>> >
>> > Same with barometer. To show 2 digits:
>> >
>> > $current.barometer.format("%.2f")
>> >
>> > Whether it is in bold is a function 

Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread DR

Thank you for those answers.  I will continue to experiment. Dale


On 7/16/2023 12:13 PM, vince wrote:

You're probably overthinking.

WeeWX doesn't care what version of a skin you use, be it older, newer, 
or totally custom written by you or a third party.



--
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/06093383-8dbb-4b98-b44a-8204814c6889n%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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/175819af-8789-395f-8018-ad8330a5c3e1%40gmail.com.


Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread gjr80
You do need to be careful with the parameterised Seasons skin introduced in 
v4.6.0, there are a couple of features that require WeeWX v4.6.0 or later. 
But in the main the shipped skins don't care about WeeWX version, the 
shipped skins tend to use WeeWX features/tags that have existed since very 
early on. I would tread carefully with third party skins, new tags have 
been introduced in quite a few WeeWX versions so any skins relying on these 
new tags may not work with earlier WeeWX versions. Really depends on the 
skin.

Gary 

On Sunday, 16 July 2023 at 18:13:52 UTC+1 vince wrote:

You're probably overthinking.

WeeWX doesn't care what version of a skin you use, be it older, newer, or 
totally custom written by you or a third party.


-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/3772bd53-9996-47f4-91f5-03483bda12b0n%40googlegroups.com.


[weewx-user] Re: how to add new data from MQTT and include it into db

2023-07-16 Thread vince
On Sunday, July 16, 2023 at 12:17:47 AM UTC-7 IceNov wrote:

I can see the mqtt data when running weewxd from the command line - it is 
one of the fields showing up in the terminal output - but it's not being 
added to the database.

I've also tried importing a csv file with timestamp and value - which 
reported success - but still no new column in the db.
How do I get a new measurement into the standard database?


Fields don't magically appear in the database.  You have to create them 
yourself somehow.

Simplest way is to map the incoming MQTT topic to an existing field in the 
database. See the example at 
https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/individual-example 
for help.  Notice how topic/temp1 is mapped to extraTemp1 in the db ?


-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/4a4a7cb6-112b-435f-af3e-61c25507191dn%40googlegroups.com.


Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread vince
You're probably overthinking.

WeeWX doesn't care what version of a skin you use, be it older, newer, or 
totally custom written by you or a third party.


-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/06093383-8dbb-4b98-b44a-8204814c6889n%40googlegroups.com.


Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread DR

I'm confused (again).

You mention that you CAN use an older version of a skin even in a newer 
version of WeeWx.



I have a WeeWx 4.5.1 running with a Seasons skin that I like. Somewhere 
along the evolution the way that the newer versions handle the plots and 
the summaries was changed, and I assumed that to run the newer versions 
of WeeWx that those old skins were not compatible with the current release.



I haven't gotten things figured out yet, but perhaps should just hold 
tight and wait for 5 to come out and then tackle learning the finer points.



I was just taken aback by Tom's comment that older skins were OK to use.


Dale



On 7/16/2023 9:22 AM, Tom Keffer wrote:
Sorry. I had assumed you were still using your v3.9.1 Seasons skin. If 
that's the case, the tag $current.barometer is in the file 
Seasons/current.inc.


Incidentally, there's no reason not to continue using your old skin.

But, if you are actually using a V4 skin, then to answer your questions:

1. The line "#set observations = ..." is actually saying get the set 
of observations from $DisplayOptions. If DisplayOptions does not have 
an entry, then the fallback is to use just outTemp and barometer. See 
the configuration file skin.conf for what's in DisplayOptions.


2. You can specify an override for the barometer formatting for the 
unit "inHg" in weewx.conf:


[StdReport]
  ...
[[Defaults]]
    ...
[[[Units]]]
...
StringFormats
inHg = %.2f

3. I'm not following your question about "LakeElev". I don't know what 
that is.



On Sun, Jul 16, 2023 at 12:33 AM Messy Potamia 
 wrote:


Where do those 2 formatting statements go?
Also, why, in current.inc, is the line
#set $observations =
$to_list($DisplayOptions.get('observations_current', ['outTemp',
'barometer']))
containing only outTemp and barometer? Where are the rest of the items
displayed in Current Conditions? Sorry I'm just not getting the
formatting layout big picture. Yes I'm reading the customization guide
but I'm having questions as I read it.
Thanks!

On Sun, Jul 16, 2023 at 12:22 AM Tom Keffer  wrote:
>
> For altitude, format it like any other tag. See the section
Formatting options in the Customizing Guide. For example, if you
do not want anything beyond the decimal point:
>
> $station.altitude.format("%.0f")
>
> Same with barometer. To show 2 digits:
>
> $current.barometer.format("%.2f")
>
> Whether it is in bold is a function of whatever CSS styling you
are using.
>
> -tk
>
>
> On Sat, Jul 15, 2023 at 2:55 PM messyp...@gmail.com
 wrote:
>>
>> I got the added  measurement added to the database, and into
the skins, however I don't need Lake Elevation to be show in so
many digits.  I previously (3.9.1) had it showing 2 digits to the
right of the decimal.
>> Also, I don't know what happened but now the Barometer has
changed its formatting to bold and more decimal places.
>> Where do I fix this?
>> Thanks - - -
>> Current Conditions
>>
>> Outside Temperature
>> 86.1°F
>> Dew Point
>> 73.8°F
>> Outside Humidity
>> 67%
>> Barometer
>> 29.799 inHg (-0.033)
>> Wind
>> 0 mph N/A ( N/A)
>> Rain Today
>> 0.02 in
>> Rain Rate
>> 0.00 in/h
>> Inside Temperature
>> 92.6°F
>> LakeElev
>> 594.77
>> Inside Humidity
>> 64%
>>
>> --
>> 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 weewx-user+unsubscr...@googlegroups.com
.
>> To view this discussion on the web visit

https://groups.google.com/d/msgid/weewx-user/c2c9ce27-f091-4ddb-afad-616d6c287bfdn%40googlegroups.com.
>
> --
> You received this message because you are subscribed to a topic
in the Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
https://groups.google.com/d/topic/weewx-user/9hY3_PBqY5E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email
to weewx-user+unsubscr...@googlegroups.com
.
> To view this discussion on the web visit

https://groups.google.com/d/msgid/weewx-user/CAPq0zEAaMotCOwYy6y0sqiPK-n8Jzz1F2ZzRB0t5ofQtfJefBQ%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/weewx-user/CAB7-S75_iZULqbfyqN7s8bMqYfG9q%2B17k7pOjJrvsLj2qU1Q2w%40mail.gmail.com.

--
You 

[weewx-user] Re: how to add new data from MQTT and include it into db

2023-07-16 Thread gjr80
Hmm, '*the data must be present in a field in a WeeWX generated archive 
record (lines starting with REC: when running WeeWX directly)*', that 
includes any calculated/derived/added fields by any WeeWX service last time 
I checked. I stand by my previous post.

Gary

On Sunday, 16 July 2023 at 13:55:41 UTC+1 Peter Fletcher wrote:

Your condition 2) is, of course, an absolute requirement. Your condition 1) 
isn't, strictly speaking. It is perfectly possible (and fairly common) for 
a Service triggered by the Archive record event to add (e.g.) a calculated 
value to the archive record being processed, which is then inserted in the 
database.

On Sunday, July 16, 2023 at 4:23:30 AM UTC-4 gjr80 wrote:

For WeeWX to save data to the database two conditions must be met (1) the 
data must be present in a field in a WeeWX generated archive record (lines 
starting with REC: when running WeeWX directly) and (2) the same field must 
exist in the database. If these conditions are not met then data for that 
field will not be saved to database, whether the data is from a 
service/driver or an import. Getting data from new fields into the database 
is typically achieved by either re-purposing an existing, unused database 
field (ie you rename the archive record field to match the repurposed 
database field) or you add a new type to the database with the same name as 
the field in your archive record. 

I suggest you have a read of the Customising the database 
 section of 
the Customization Guide , in 
particular the Modifying an existing database 
 
section.

Gary
On Sunday, 16 July 2023 at 08:17:47 UTC+1 IceNov wrote:

Just started experimenting with weewx - and using the simulator with 
lighttpd serving up the data to a great looking web page on my rPi.

While I don't have a weather station yet, I've been trying to incorporate 
data from an mqtt service and have had partial success. I am using the 
MQTTSubscribeService.

I can see the mqtt data when running weewxd from the command line - it is 
one of the fields showing up in the terminal output - but it's not being 
added to the database.

I've also tried importing a csv file with timestamp and value - which 
reported success - but still no new column in the db.
How do I get a new measurement into the standard database?
Thanks
Tony
 

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/90bd7e0d-0de1-446f-9a51-007cfbdda20fn%40googlegroups.com.


Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Tom Keffer
Sorry. I had assumed you were still using your v3.9.1 Seasons skin. If
that's the case, the tag $current.barometer is in the file
Seasons/current.inc.

Incidentally, there's no reason not to continue using your old skin.

But, if you are actually using a V4 skin, then to answer your questions:

1. The line "#set observations = ..." is actually saying get the set of
observations from $DisplayOptions. If DisplayOptions does not have an
entry, then the fallback is to use just outTemp and barometer. See the
configuration file skin.conf for what's in DisplayOptions.

2. You can specify an override for the barometer formatting for the unit
"inHg" in weewx.conf:

[StdReport]
  ...
  [[Defaults]]
...
[[[Units]]]
  ...
  StringFormats
inHg = %.2f

3. I'm not following your question about "LakeElev". I don't know what that
is.


On Sun, Jul 16, 2023 at 12:33 AM Messy Potamia 
wrote:

> Where do those 2 formatting statements go?
> Also, why, in current.inc, is the line
> #set $observations =
> $to_list($DisplayOptions.get('observations_current', ['outTemp',
> 'barometer']))
> containing only outTemp and barometer? Where are the rest of the items
> displayed in Current Conditions? Sorry I'm just not getting the
> formatting layout big picture. Yes I'm reading the customization guide
> but I'm having questions as I read it.
> Thanks!
>
> On Sun, Jul 16, 2023 at 12:22 AM Tom Keffer  wrote:
> >
> > For altitude, format it like any other tag. See the section Formatting
> options in the Customizing Guide. For example, if you do not want anything
> beyond the decimal point:
> >
> > $station.altitude.format("%.0f")
> >
> > Same with barometer. To show 2 digits:
> >
> > $current.barometer.format("%.2f")
> >
> > Whether it is in bold is a function of whatever CSS styling you are
> using.
> >
> > -tk
> >
> >
> > On Sat, Jul 15, 2023 at 2:55 PM messyp...@gmail.com <
> messypota...@gmail.com> wrote:
> >>
> >> I got the added  measurement added to the database, and into the skins,
> however I don't need Lake Elevation to be show in so many digits.  I
> previously (3.9.1) had it showing 2 digits to the right of the decimal.
> >> Also, I don't know what happened but now the Barometer has changed its
> formatting to bold and more decimal places.
> >> Where do I fix this?
> >> Thanks - - -
> >> Current Conditions
> >>
> >> Outside Temperature
> >> 86.1°F
> >> Dew Point
> >> 73.8°F
> >> Outside Humidity
> >> 67%
> >> Barometer
> >> 29.799 inHg (-0.033)
> >> Wind
> >> 0 mph N/A ( N/A)
> >> Rain Today
> >> 0.02 in
> >> Rain Rate
> >> 0.00 in/h
> >> Inside Temperature
> >> 92.6°F
> >> LakeElev
> >> 594.77
> >> Inside Humidity
> >> 64%
> >>
> >> --
> >> 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 weewx-user+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/c2c9ce27-f091-4ddb-afad-616d6c287bfdn%40googlegroups.com
> .
> >
> > --
> > You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> > To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/9hY3_PBqY5E/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> weewx-user+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAaMotCOwYy6y0sqiPK-n8Jzz1F2ZzRB0t5ofQtfJefBQ%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAB7-S75_iZULqbfyqN7s8bMqYfG9q%2B17k7pOjJrvsLj2qU1Q2w%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAfhRDtxg7L3Dbhu_WtVPyhurobZqtNGJXqDzs%3Dr30YiQ%40mail.gmail.com.


[weewx-user] Re: how to add new data from MQTT and include it into db

2023-07-16 Thread 'Peter Fletcher' via weewx-user
Your condition 2) is, of course, an absolute requirement. Your condition 1) 
isn't, strictly speaking. It is perfectly possible (and fairly common) for 
a Service triggered by the Archive record event to add (e.g.) a calculated 
value to the archive record being processed, which is then inserted in the 
database.

On Sunday, July 16, 2023 at 4:23:30 AM UTC-4 gjr80 wrote:

> For WeeWX to save data to the database two conditions must be met (1) the 
> data must be present in a field in a WeeWX generated archive record (lines 
> starting with REC: when running WeeWX directly) and (2) the same field must 
> exist in the database. If these conditions are not met then data for that 
> field will not be saved to database, whether the data is from a 
> service/driver or an import. Getting data from new fields into the database 
> is typically achieved by either re-purposing an existing, unused database 
> field (ie you rename the archive record field to match the repurposed 
> database field) or you add a new type to the database with the same name as 
> the field in your archive record. 
>
> I suggest you have a read of the Customising the database 
>  section 
> of the Customization Guide , 
> in particular the Modifying an existing database 
>  
> section.
>
> Gary
> On Sunday, 16 July 2023 at 08:17:47 UTC+1 IceNov wrote:
>
>> Just started experimenting with weewx - and using the simulator with 
>> lighttpd serving up the data to a great looking web page on my rPi.
>>
>> While I don't have a weather station yet, I've been trying to incorporate 
>> data from an mqtt service and have had partial success. I am using the 
>> MQTTSubscribeService.
>>
>> I can see the mqtt data when running weewxd from the command line - it is 
>> one of the fields showing up in the terminal output - but it's not being 
>> added to the database.
>>
>> I've also tried importing a csv file with timestamp and value - which 
>> reported success - but still no new column in the db.
>> How do I get a new measurement into the standard database?
>> Thanks
>> Tony
>>  
>>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/037e608f-c933-4abb-848e-4acdcced73dcn%40googlegroups.com.


Re: [weewx-user] Where do I override / specify %3.2 float format for an added measurement?

2023-07-16 Thread Messy Potamia
Also should I have mentioned my newly added LakeElev column in the
database is not a member of any "group"? i.e. not group_altitude. Not
sure where I would group it; I do remember that in my 3.9.1 I edited
"units.py" and added group Lake and added new things like "foot2" and
"inch2" and someone politely admonished me as that was not the optimum
practice, but I didn't understand the preferred method of making Lake
Elevation %3.2f and wave height (inches) %2.0f.  Sorry.
Thanks for your help.

On Sun, Jul 16, 2023 at 9:32 AM Messy Potamia  wrote:
>
> Where do those 2 formatting statements go?
> Also, why, in current.inc, is the line
> #set $observations =
> $to_list($DisplayOptions.get('observations_current', ['outTemp',
> 'barometer']))
> containing only outTemp and barometer? Where are the rest of the items
> displayed in Current Conditions? Sorry I'm just not getting the
> formatting layout big picture. Yes I'm reading the customization guide
> but I'm having questions as I read it.
> Thanks!
>
> On Sun, Jul 16, 2023 at 12:22 AM Tom Keffer  wrote:
> >
> > For altitude, format it like any other tag. See the section Formatting 
> > options in the Customizing Guide. For example, if you do not want anything 
> > beyond the decimal point:
> >
> > $station.altitude.format("%.0f")
> >
> > Same with barometer. To show 2 digits:
> >
> > $current.barometer.format("%.2f")
> >
> > Whether it is in bold is a function of whatever CSS styling you are using.
> >
> > -tk
> >
> >
> > On Sat, Jul 15, 2023 at 2:55 PM messyp...@gmail.com 
> >  wrote:
> >>
> >> I got the added  measurement added to the database, and into the skins, 
> >> however I don't need Lake Elevation to be show in so many digits.  I 
> >> previously (3.9.1) had it showing 2 digits to the right of the decimal.
> >> Also, I don't know what happened but now the Barometer has changed its 
> >> formatting to bold and more decimal places.
> >> Where do I fix this?
> >> Thanks - - -
> >> Current Conditions
> >>
> >> Outside Temperature
> >> 86.1°F
> >> Dew Point
> >> 73.8°F
> >> Outside Humidity
> >> 67%
> >> Barometer
> >> 29.799 inHg (-0.033)
> >> Wind
> >> 0 mph N/A ( N/A)
> >> Rain Today
> >> 0.02 in
> >> Rain Rate
> >> 0.00 in/h
> >> Inside Temperature
> >> 92.6°F
> >> LakeElev
> >> 594.77
> >> Inside Humidity
> >> 64%
> >>
> >> --
> >> 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 weewx-user+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/weewx-user/c2c9ce27-f091-4ddb-afad-616d6c287bfdn%40googlegroups.com.
> >
> > --
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "weewx-user" group.
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/weewx-user/9hY3_PBqY5E/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to 
> > weewx-user+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/weewx-user/CAPq0zEAaMotCOwYy6y0sqiPK-n8Jzz1F2ZzRB0t5ofQtfJefBQ%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAB7-S76ZZzzmNj%3DMcGp6VK%3DKiQzMe6imu63PMXwJuMEJRAioog%40mail.gmail.com.


[weewx-user] Re: how to add new data from MQTT and include it into db

2023-07-16 Thread gjr80
For WeeWX to save data to the database two conditions must be met (1) the 
data must be present in a field in a WeeWX generated archive record (lines 
starting with REC: when running WeeWX directly) and (2) the same field must 
exist in the database. If these conditions are not met then data for that 
field will not be saved to database, whether the data is from a 
service/driver or an import. Getting data from new fields into the database 
is typically achieved by either re-purposing an existing, unused database 
field (ie you rename the archive record field to match the repurposed 
database field) or you add a new type to the database with the same name as 
the field in your archive record. 

I suggest you have a read of the Customising the database 
 section of 
the Customization Guide , in 
particular the Modifying an existing database 
 
section.

Gary
On Sunday, 16 July 2023 at 08:17:47 UTC+1 IceNov wrote:

> Just started experimenting with weewx - and using the simulator with 
> lighttpd serving up the data to a great looking web page on my rPi.
>
> While I don't have a weather station yet, I've been trying to incorporate 
> data from an mqtt service and have had partial success. I am using the 
> MQTTSubscribeService.
>
> I can see the mqtt data when running weewxd from the command line - it is 
> one of the fields showing up in the terminal output - but it's not being 
> added to the database.
>
> I've also tried importing a csv file with timestamp and value - which 
> reported success - but still no new column in the db.
> How do I get a new measurement into the standard database?
> Thanks
> Tony
>  
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/b9d7f886-9f24-4619-8793-dab360c63db8n%40googlegroups.com.


[weewx-user] how to add new data from MQTT and include it into db

2023-07-16 Thread IceNov
Just started experimenting with weewx - and using the simulator with 
lighttpd serving up the data to a great looking web page on my rPi.

While I don't have a weather station yet, I've been trying to incorporate 
data from an mqtt service and have had partial success. I am using the 
MQTTSubscribeService.

I can see the mqtt data when running weewxd from the command line - it is 
one of the fields showing up in the terminal output - but it's not being 
added to the database.

I've also tried importing a csv file with timestamp and value - which 
reported success - but still no new column in the db.
How do I get a new measurement into the standard database?
Thanks
Tony
 

-- 
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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5f0c431d-15ec-4e77-969d-58661a7d1910n%40googlegroups.com.