Have you considered using Python's JSON function to put the whole thing
into a dictionary so there's no need for all the if statements?

On Thu, Mar 3, 2022, 10:26 AM an oldman <[email protected]> wrote:

> this is the output for rtl_433 -M utc -M protocol -M level -F json command
> for acurite atlas sensor
>
> {"time" : "2022-03-03 18:16:57", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 0,
> "battery_ok" : 1, "message_type" : 39, "wind_avg_mi_h" : 3.000, "uv" : 2,
> "lux" : 45830, "strike_count" : 3, "strike_distance" : 10, "exception" : 0,
> "raw_msg" : "81eee78142a3e7006a0d", "mod" : "ASK", "freq" : 433.946, "rssi"
> : -4.499, "snr" : 28.102, "noise" : -32.602}
> {"time" : "2022-03-03 18:16:57", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 1,
> "battery_ok" : 1, "message_type" : 39, "wind_avg_mi_h" : 3.000, "uv" : 2,
> "lux" : 45830, "strike_count" : 3, "strike_distance" : 10, "exception" : 0,
> "raw_msg" : "85eee78142a3e7006a11", "mod" : "ASK", "freq" : 433.946, "rssi"
> : -4.499, "snr" : 28.102, "noise" : -32.602}
> {"time" : "2022-03-03 18:16:57", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 2,
> "battery_ok" : 1, "message_type" : 39, "wind_avg_mi_h" : 3.000, "uv" : 2,
> "lux" : 45830, "strike_count" : 3, "strike_distance" : 10, "exception" : 0,
> "raw_msg" : "89eee78142a3e7006a15", "mod" : "ASK", "freq" : 433.946, "rssi"
> : -4.499, "snr" : 28.102, "noise" : -32.602}
> {"time" : "2022-03-03 18:17:07", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 0,
> "battery_ok" : 1, "message_type" : 37, "wind_avg_mi_h" : 5.000,
> "temperature_F" : 14.600, "humidity" : 69, "strike_count" : 3,
> "strike_distance" : 10, "exception" : 0, "raw_msg" :
> "81ee65824422c5006aeb", "mod" : "ASK", "freq" : 433.947, "rssi" : -5.061,
> "snr" : 27.083, "noise" : -32.144}
> {"time" : "2022-03-03 18:17:07", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 1,
> "battery_ok" : 1, "message_type" : 37, "wind_avg_mi_h" : 5.000,
> "temperature_F" : 14.600, "humidity" : 69, "strike_count" : 3,
> "strike_distance" : 10, "exception" : 0, "raw_msg" :
> "85ee65824422c5006aef", "mod" : "ASK", "freq" : 433.947, "rssi" : -5.061,
> "snr" : 27.083, "noise" : -32.144}
> {"time" : "2022-03-03 18:17:07", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 2,
> "battery_ok" : 1, "message_type" : 37, "wind_avg_mi_h" : 5.000,
> "temperature_F" : 14.600, "humidity" : 69, "strike_count" : 3,
> "strike_distance" : 10, "exception" : 0, "raw_msg" :
> "89ee65824422c5006af3", "mod" : "ASK", "freq" : 433.947, "rssi" : -5.061,
> "snr" : 27.083, "noise" : -32.144}
> {"time" : "2022-03-03 18:17:18", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 0,
> "battery_ok" : 1, "message_type" : 38, "wind_avg_mi_h" : 5.000,
> "wind_dir_deg" : 94.000, "rain_in" : 1.140, "strike_count" : 3,
> "strike_distance" : 10, "exception" : 0, "raw_msg" :
> "81ee6682427872006aed", "mod" : "ASK", "freq" : 433.948, "rssi" : -3.818,
> "snr" : 28.326, "noise" : -32.144}
> {"time" : "2022-03-03 18:17:18", "protocol" : 40, "model" :
> "Acurite-Atlas", "id" : 494, "channel" : "B", "sequence_num" : 1,
> "battery_ok" : 1, "message_type" : 38, "wind_avg_mi_h" : 5.000,
> "wind_dir_deg" : 94.000, "rain_in" : 1.140, "strike_count" : 3,
> "strike_distance" : 10, "exception" : 0, "raw_msg" :
> "85ee6682427872006af1", "mod" : "ASK", "freq" : 433.948, "rssi" : -3.818,
> "snr" : 28.326, "noise" : -32.144}
>
> you could add them to sdr.py i added them for some acurite sensors that
> did not have them it looks something like
> # connection diagnostics (-M level)
> if 'mod' in obj:
>     pkt['mod'] = obj.get('mod')
> if 'freq' in obj:
>     pkt['freq'] = Packet.get_float(obj, 'freq')
> if 'rssi' in obj:
>     pkt['rssi'] = Packet.get_float(obj, 'rssi')
> if 'snr' in obj:
>     pkt['snr'] = obj.get('snr')
> if 'noise' in obj:
>     pkt['noise'] = obj.get('noise')
>
> yes must be in the sensor map
>
> here is what is in my for my acurite atlas [sensor_map] for rssi, freq,
> snr, noise, protocol
> rssi = rssi.494.AcuriteAtlasPacket
> freq = freq.494.AcuriteAtlasPacket
> snr = snr.494.AcuriteAtlasPacket
> noise = noise.494.AcuriteAtlasPacket
> protocol = protocol.494.AcuriteAtlasPacket
>
> On Thursday, March 3, 2022 at 8:12:42 AM UTC-6 [email protected] wrote:
>
>> They don't seem to be in sdr.py for my stations. Would it work to add it
>> manually to sdr.py for the wh65b and whx080?
>> And do I have to add these to the sensor map?
>>
>> an oldman schrieb am Donnerstag, 3. März 2022 um 13:43:42 UTC+1:
>>
>>> I do know about the skin.conf and Seasons files, but the extensions.py
>>> and weewx.conf should be ok.
>>> I backup all of weewx before any upgrade, then check the files i modified
>>>
>>> for snr/noise/rssi rtl_433 use the -M level switch here is the command i
>>> use
>>> /usr/local/bin/rtl_433 -M utc -M protocol -M level -F json
>>>
>>> Use "protocol" / "noprotocol" to output the decoder protocol number meta
>>> data.
>>> Use "level" to add Modulation, Frequency, RSSI, SNR, and Noise meta data.
>>> but i don't know if sdr.py puts them in the loop data for all sensors.
>>> snr/noise/rssi/frequency are not saved to the database so only the
>>> current tag works for them and to get them formated added to extensions.py
>>> weewx.units.obs_group_dict['noise'] = 'group_db'
>>> weewx.units.obs_group_dict['rssi'] = 'group_db'
>>> weewx.units.obs_group_dict['snr'] = 'group_db'
>>>
>>> to get the signal in weewx.conf i have this
>>>
>>> [StdCalibrate]
>>>     [[Corrections]]
>>>         rxCheckPercent = rssi + 100
>>>         signal1 = rssi1 + 100
>>>
>>> On Thursday, March 3, 2022 at 4:21:32 AM UTC-6 [email protected] wrote:
>>>
>>>> Thanks it worked!
>>>>
>>>> But the <td> tables somehow broke the 2-row listing of the graphs so i
>>>> left it out for now. As i already got all the graphs i need.
>>>>
>>>> Will I have to do modify these files (including skin.conf,
>>>> extensions.py) again after the update to weewx 4.7?
>>>>
>>>> Your SDR setup looks very nicely tweaked. How did you get the
>>>> snr/noise/rssi and signal quality info and how to put them into weewx?
>>>>
>>>> an oldman schrieb am Dienstag, 1. März 2022 um 23:34:06 UTC+1:
>>>>
>>>>> i do not have public access to my weather page so if you want to see
>>>>> some of it these are about a 3rd of it starting at the top
>>>>>
>>>>> On Tuesday, March 1, 2022 at 11:57:42 AM UTC-6 an oldman wrote:
>>>>>
>>>>>> in Seasons/skin.conf
>>>>>> plot_groups list the plots to show
>>>>>>
>>>>>> moistsoil shows the plots for soilMoist1-4
>>>>>> tempsoil for soilTemp1-4
>>>>>>
>>>>>> if you remove moistsoil, tempsoil from the list will stop showing the
>>>>>> plots
>>>>>>
>>>>>> you would have to add to plot_groups the extra wind stuff say
>>>>>> extrawind, extrawinddir, then under [ImageGenerator] section you would 
>>>>>> have
>>>>>> to something like
>>>>>>
>>>>>> [[[dayextrawind]]]
>>>>>>     [[[[soilMoist1]]]]
>>>>>>     [[[[soilMoist2]]]]
>>>>>>
>>>>>> to do it for week, month, and year for week, month and year add
>>>>>> aggregate_type = max for week plot something like
>>>>>>
>>>>>> [[[weekextrawind]]]
>>>>>>     [[[[soilMoist1]]]]
>>>>>>     [[[[soilMoist2]]]]
>>>>>>         aggregate_type = max
>>>>>>
>>>>>> for direction an agian for week, month and year
>>>>>> [[[dayextrawinddir]]]
>>>>>>     yscale = 0.0, 360.0, 45.0
>>>>>>     line_type = None
>>>>>>     marker_type = box
>>>>>>     marker_size = 2
>>>>>>     [[[[soilTemp4]]]]
>>>>>>
>>>>>> in Seasons/current.inc file after the last #end for and before
>>>>>> </tbody> add something like
>>>>>>
>>>>>> <tr>
>>>>>>   <td class="label">Wind Speed</td>
>>>>>>   <td class="data">$current.soilMoist1
>>>>>> $current.soilTemp1.ordinal_compass ($current.soilTemp1)</td>
>>>>>> <tr>
>>>>>>
>>>>>> no restart is needed for that just the next report cycle
>>>>>>
>>>>>> On Tuesday, March 1, 2022 at 10:25:22 AM UTC-6 [email protected]
>>>>>> wrote:
>>>>>>
>>>>>>> As the database is quite new i just deleted the few soilMost3
>>>>>>> entries out and made a
>>>>>>>
>>>>>>> sudo wee_database --rebuild-daily --from=2022-03-01 --to=2022-03-01
>>>>>>> --config=/etc/weewx/weewx-sdr.conf
>>>>>>>
>>>>>>> and started weewx-sdr again, now it's looking quite good. I'm still
>>>>>>> trying to figure out how to change the wind direction lines to dots?
>>>>>>>
>>>>>>>
>>>>>>> [email protected] schrieb am Dienstag, 1. März 2022 um 13:37:09
>>>>>>> UTC+1:
>>>>>>>
>>>>>>>> That's good to know, so I have to repeat these steps after a weewx
>>>>>>>> update?
>>>>>>>>
>>>>>>>> I have it now running with the additional sensors:
>>>>>>>> http://meteo.fankyy.ch/WsDi1c_sdr/
>>>>>>>> Not sure if the rain graph will only appear after it begins with
>>>>>>>> rain count?
>>>>>>>>
>>>>>>>> I used soilMoist 1-3 for Wind, Gust and Direction, but it put all
>>>>>>>> in one graph, with the highest number 360 for wind direction, the 
>>>>>>>> speed is
>>>>>>>> barely visible. So i use soiltemp4 for the wind direction now and 
>>>>>>>> hope, the
>>>>>>>> back-to-normal named soilMoist3 will go out of the daily graph after 
>>>>>>>> 24h?
>>>>>>>> Is there an easy way to delete it out of the database, without having 
>>>>>>>> to
>>>>>>>> examine/stopping the database for a long time?
>>>>>>>>
>>>>>>>> I couldn't find where tho do this step:
>>>>>>>> then to display wind speed you would use $current.soilMoist1 in a
>>>>>>>> template
>>>>>>>> and for wind dir $current.soilMoist2 and/or
>>>>>>>> $current.soilMoist2.ordinal_compass
>>>>>>>> in the seasons skin
>>>>>>>> an oldman schrieb am Sonntag, 27. Februar 2022 um 09:11:24 UTC+1:
>>>>>>>>
>>>>>>>>> there are other units.  just look at the schema file to see what
>>>>>>>>> there is.
>>>>>>>>> if your station sends wind gust you could one that's not in use.
>>>>>>>>> acurite 5n1 do not send wind gust just wind speed and dir.  to get
>>>>>>>>> the extra wind stuff i have to hack weewx files for every weewx 
>>>>>>>>> update.
>>>>>>>>>
>>>>>>>>> On Sunday, February 27, 2022 at 1:33:17 AM UTC-6 [email protected]
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> That would be a good and much simpler solution if it works, will
>>>>>>>>>> definitely try this. Is there some unit remaining which i could use 
>>>>>>>>>> for
>>>>>>>>>> wind_gust?
>>>>>>>>>>
>>>>>>>>>> Thanks a lot!
>>>>>>>>>>
>>>>>>>>>> an oldman schrieb am Samstag, 26. Februar 2022 um 23:47:49 UTC+1:
>>>>>>>>>>
>>>>>>>>>>> you could try something like in this if
>>>>>>>>>>> soilMoist1, soilMoist2, extraTemp1, extraHumid1,
>>>>>>>>>>> windBatteryStatus and hail are unsed
>>>>>>>>>>>
>>>>>>>>>>> in weewx.conf
>>>>>>>>>>> [SDR]
>>>>>>>>>>>     [[sensor_map]]
>>>>>>>>>>>         soilMoist1 = wind_speed.1276.Acurite5n1PacketV2
>>>>>>>>>>>         soilMoist2 = wind_dir.1276.Acurite5n1PacketV2
>>>>>>>>>>>         extraTemp1 = temperature.1276.Acurite5n1PacketV2
>>>>>>>>>>>         extraHumid1 = humidity.1276.Acurite5n1PacketV2
>>>>>>>>>>>         windBatteryStatus = battery.1276.Acurite5n1PacketV2
>>>>>>>>>>>         hail_total = rain_total.1276.Acurite5n1PacketV2
>>>>>>>>>>>     [[deltas]]
>>>>>>>>>>>         hail = hail_total
>>>>>>>>>>>
>>>>>>>>>>> [Accumulator]
>>>>>>>>>>>     [[hail]]
>>>>>>>>>>>         extractor = sum
>>>>>>>>>>>
>>>>>>>>>>> and in extensions.py
>>>>>>>>>>> import weewx.units
>>>>>>>>>>> weewx.units.obs_group_dict['soilMoist1'] = 'group_speed'
>>>>>>>>>>> weewx.units.obs_group_dict['soilMoist2'] = 'group_direction'
>>>>>>>>>>>
>>>>>>>>>>> then to display wind speed you would use $current.soilMoist1 in
>>>>>>>>>>> a template
>>>>>>>>>>> and for wind dir $current.soilMoist2 and/or
>>>>>>>>>>> $current.soilMoist2.ordinal_compass
>>>>>>>>>>>
>>>>>>>>>>> not shure where to change the labels at but i think in 4.6.2 it
>>>>>>>>>>> is in the lang files
>>>>>>>>>>> say in en.conf
>>>>>>>>>>> [Labels]
>>>>>>>>>>>     [[Generic]]
>>>>>>>>>>>         soilMoist1 = Wind Speed (5n1)
>>>>>>>>>>>         soilMoist2 = Wind Direction (5n1)
>>>>>>>>>>>         windBatteryStatus = Battery (5n1)
>>>>>>>>>>>         hail = Rain (5n1)
>>>>>>>>>>> $obs.label.soilMoist1 should show Wind Speed (5n1) and so on.
>>>>>>>>>>>
>>>>>>>>>>> On Saturday, February 26, 2022 at 11:27:03 AM UTC-6 an oldman
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> that config won't work with your set up, had to add a lot to
>>>>>>>>>>>> the sdr driver for sensors, make some extension, add to the schema 
>>>>>>>>>>>> and
>>>>>>>>>>>> user/extensions.py file and change some weewx core files.
>>>>>>>>>>>> look in the wiki under data management Switching to the new,
>>>>>>>>>>>> extended schema wview_extended
>>>>>>>>>>>> <https://github.com/weewx/weewx/wiki/Switching-to-the-new-wview_extended-schema>
>>>>>>>>>>>> .
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Saturday, February 26, 2022 at 10:53:58 AM UTC-6
>>>>>>>>>>>> [email protected] wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Now that's really great, thanks for the config. Where or how
>>>>>>>>>>>>> exactly do i have to add the entrys in the schema file?
>>>>>>>>>>>>>
>>>>>>>>>>>>> an oldman schrieb am Samstag, 26. Februar 2022 um 16:41:11
>>>>>>>>>>>>> UTC+1:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> I have
>>>>>>>>>>>>>> here is my sdr from weewx.conf
>>>>>>>>>>>>>> extraTemp, batteryStatus, extraHumid1 - 8 are in the
>>>>>>>>>>>>>> wview_extended.py schema.
>>>>>>>>>>>>>> I had to add to the schema extrawindSpeed, extrawindDir,
>>>>>>>>>>>>>> lightning_distance15, lightning_strike_count15 and extraTemp,
>>>>>>>>>>>>>> batteryStatus, extraHumid 9 - 16.
>>>>>>>>>>>>>> Had a 3rd 5n1 but a hail storm took out 2 5n1s, had to
>>>>>>>>>>>>>> combine them to get 1 working 5n1.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Saturday, February 26, 2022 at 2:51:21 AM UTC-6
>>>>>>>>>>>>>> [email protected] wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Would it be possible to record data from two or more full
>>>>>>>>>>>>>>> sensor arrays (including wind and rain) in one weewx instance? 
>>>>>>>>>>>>>>> Or record
>>>>>>>>>>>>>>> the data in multiple weewx instances with only one SDR-stick?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I know multiple SDR sticks to multiple weewx instances is
>>>>>>>>>>>>>>> possible, but how could it be done with just one stick?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I already achieved to get the temperature from a second
>>>>>>>>>>>>>>> sensor with the extraTempSensor value in the sensor map, but i 
>>>>>>>>>>>>>>> guess this
>>>>>>>>>>>>>>> wouldn't work for wind and rain? It seems like it would need 
>>>>>>>>>>>>>>> basically only
>>>>>>>>>>>>>>> an adaption to the schema and database, but to edit these seems 
>>>>>>>>>>>>>>> a bit
>>>>>>>>>>>>>>> complex for me, has anyone ever done this?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> --
> 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/db3dab70-ffa9-412d-8d8b-1ddddd8dbddcn%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/db3dab70-ffa9-412d-8d8b-1ddddd8dbddcn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAA1SM233TH7Ymb4t0HFib65brr%3DDzELNbqa%2B09H9ENk3Wugjbw%40mail.gmail.com.

Reply via email to