Paid Development Request: Driver for Raddy L7 JSON

205 views
Skip to first unread message

Michael

unread,
Mar 13, 2024, 11:42:52 AMMar 13
to weewx-user
Hello,

I currently have a Raddy L7 LoRA station.  It appears that that the weather station provides a JSON output of observations.  I am soliciting a paid opportunity to develop a driver for this weather station and create a Github page for driver to spread the word.  I am just a personal user, but figure this may be a better approach than having to buy a supported station.  I am not a developer and simply don't have the time to undertake the effort, but want users of this weather station to be able to use WeeWx (Yes, I tried Interceptor, but I failed in getting to work and this appears to be a more graceful approach).  If you are interested in the work, please let me know.  


The update period appears to vary between 5-30 seconds.  

Example output 
Sensor         Parameter           Value
-------------------------------------------------------
Indoor         Temperature         69.4
Indoor         Humidity            43
Outdoor        Temperature         44.7
Outdoor        Humidity            70
Pressure       Absolute            26.74
Pressure       Relative            29.86
Wind Speed     Max Daily Gust      3.8
Wind Speed     Wind                0.0
Wind Speed     Gust                0.0
Wind Speed     Direction           213
Wind Speed     Wind Average 2 Minute0.0
Wind Speed     Direction Average 2 Minute204
Wind Speed     Wind Average 10 Minute0.2
Wind Speed     Direction Average 10 Minute300
Rainfall       Rate                0.0
Rainfall       Hour                0.0
Rainfall       Day                 0.0
Rainfall       Week                0.73
Rainfall       Month               0.73
Rainfall       Year                6.45
Rainfall       Total               11.39
Solar          Light               0.3
Solar          UVI                 0.0
JSON Message:
{"sensor":[ {"title":"Indoor","list":[["Temperature","71.6","°F"],["Humidity","41","%"]]},{"title":"Outdoor","list":[["Temperature","59.2","°F"],["Humidity","44","%"]]},{"title":"Pressure","list":[["Absolute","26.77","inhg"],["Relative","29.89","inhg"]]},{"title":"Wind Speed","list":[["Max Daily Gust","8.9","mph"],["Wind","3.6","mph"],["Gust","3.8","mph"],["Direction","264","°"],["Wind Average 2 Minute","4.3","mph"],["Direction Average 2 Minute","246","°"],["Wind Average 10 Minute","3.1","mph"],["Direction Average 10 Minute","241","°"]]},{"title":"Rainfall","list":[["Rate","0.0","inch/hr"],["Hour","0.0","inch","43"],["Day","0.0","inch","44"],["Week","0.73","inch","45"],["Month","0.73","inch","46"],["Year","6.45","inch","47"],["Total","11.39","inch","48"]],"range":"Range: 0inch to 393.7inch."},{"title":"Solar","list":[["Light","153.59","w/m²"],["UVI","0.8",""]]}],"battery":{"title":"Battery","list":["All battery are ok"]}}

Ebryant

unread,
Jun 22, 2024, 8:47:05 PM (11 days ago) Jun 22
to weewx-user
I have a Raddy WF-100SE station that I would like to get data to aprs.fi and CWOP. If anyone has any suggestions it would help.

Michael

unread,
Jun 22, 2024, 9:12:03 PM (11 days ago) Jun 22
to weewx-user
I would verify if you can get the observations out of the unit like I was able to.   

I went with CumulusMX instead of WeeWX and their board suggested translating the JSON to a ECOWITT HTTP Post.  Script is in the thread below.  Overall, I am happier with CumulusMX both in terms of product and support community over WeeWX.  I was able to enable the WXNOW file for Direwolf to post APRS reports easily.  

Eddie Bryant

unread,
Jun 22, 2024, 9:35:17 PM (11 days ago) Jun 22
to weewx...@googlegroups.com
Michael,

Thank you for your response. I am not familiar with JSON. The WiFi setup for the WF-100SE says to connect to the L7-xxxx network and using a browser type in 192.168.1.5. That brings up a page where I type in my network SSID and the pass key. Below that is sections for adding IDs and keys for linking to weather unground and weather cloud.

I reason if I can link to those I should be able to link to APRS.fi and CWOP but I am not sure how to do that.

Eddie 



--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/28bf858b-693d-4dc0-9ac1-182cc61fa7den%40googlegroups.com.

Michael

unread,
Jun 22, 2024, 10:17:03 PM (11 days ago) Jun 22
to weewx-user
go to http://192.168.1.5/client?command=record  Do you get a result?  

Eddie Bryant

unread,
Jun 22, 2024, 10:37:11 PM (11 days ago) Jun 22
to weewx...@googlegroups.com
Michael,

I get a page that shows the data.

Eddie 

Michael

unread,
Jun 22, 2024, 10:38:21 PM (11 days ago) Jun 22
to weewx...@googlegroups.com
I would head over the CumulusMX forum like.  I posted a Python script you can modify to reformat the data for CMX.  

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/Lz7X2sp3B8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAJ8RQDqKCX1eis1vf1pc63y1%3D305W1oh2xNLse1Bi7iiD1UWJw%40mail.gmail.com.


--

Eddie Bryant

unread,
Jun 22, 2024, 10:40:23 PM (11 days ago) Jun 22
to weewx...@googlegroups.com
Thanks, I'll check it out tomorrow. Good night.

Eddie 

Eddie Bryant

unread,
Jun 23, 2024, 6:00:19 PM (11 days ago) Jun 23
to weewx...@googlegroups.com
Hi Michael,

I am on the Cumulus support page looking for your script. Trying to find it. 

Eddie 

Eddie Bryant

unread,
Jun 23, 2024, 6:05:01 PM (11 days ago) Jun 23
to weewx...@googlegroups.com
I did a search for Python script but there seems to be a lot of posts. What is your user name there?

Eddie 

Michael

unread,
Jun 23, 2024, 7:08:39 PM (11 days ago) Jun 23
to weewx...@googlegroups.com
import requests
import json
from datetime import datetime
import time

def fetch_and_send_data():
    try:
        # Fetch the JSON data
        json_url = "http://192.168.1.9/client?command=record"
        response = requests.get(json_url)
        response.raise_for_status()  # Raise an exception for HTTP errors
        data = response.json()

        # Mapping function
        def map_data(data):
            mapped_data = {
                "tempinf": None,
                "humidityin": None,
                "baromrelin": None,
                "baromabsin": None,
                "tempf": None,
                "humidity": None,
                "winddir": None,
                "windspeedmph": None,
                "windgustmph": None,
                "maxdailygust": None,
                "solarradiation": None,
                "uv": None,
                "rainratein": None,
                "eventrainin": None,
                "hourlyrainin": None,
                "dailyrainin": None,
                "weeklyrainin": None,
                "monthlyrainin": None,
                "yearlyrainin": None,
                "totalrainin": None
            }

            for sensor in data['sensor']:
                title = sensor['title']
                for parameter in sensor['list']:
                    param_name = parameter[0]
                    value = parameter[1]

                    if title == "Indoor":
                        if param_name == "Temperature":
                            mapped_data["tempinf"] = value
                        elif param_name == "Humidity":
                            mapped_data["humidityin"] = value

                    elif title == "Outdoor":
                        if param_name == "Temperature":
                            mapped_data["tempf"] = value
                        elif param_name == "Humidity":
                            mapped_data["humidity"] = value

                    elif title == "Pressure":
                        if param_name == "Absolute":
                            mapped_data["baromabsin"] = value
                        elif param_name == "Relative":
                            mapped_data["baromrelin"] = value

                    elif title == "Wind Speed":
                        if param_name == "Direction":
                            mapped_data["winddir"] = value
                        elif param_name == "Wind":
                            mapped_data["windspeedmph"] = value
                        elif param_name == "Gust":
                            mapped_data["windgustmph"] = value
                        elif param_name == "Max Daily Gust":
                            mapped_data["maxdailygust"] = value

                    elif title == "Solar":
                        if param_name == "Light":
                            mapped_data["solarradiation"] = value
                        elif param_name == "UVI":
                            mapped_data["uv"] = value

                    elif title == "Rainfall":
                        if param_name == "Rate":
                            mapped_data["rainratein"] = value
                        elif param_name == "Hour":
                            mapped_data["hourlyrainin"] = value
                        elif param_name == "Day":
                            mapped_data["dailyrainin"] = value
                        elif param_name == "Week":
                            mapped_data["weeklyrainin"] = value
                        elif param_name == "Month":
                            mapped_data["monthlyrainin"] = value
                        elif param_name == "Year":
                            mapped_data["yearlyrainin"] = value
                        elif param_name == "Total":
                            mapped_data["totalrainin"] = value

            return mapped_data

        mapped_data = map_data(data)

        # Create the formatted response
        dateutc = datetime.utcnow().strftime('%Y-%m-%d+%H:%M:%S')
        PASSKEY = "ASDFASDF1234ASDF1234"
        stationtype = "RADDY_L7"
        MODEL = "RaddyL7"
        Frequency = "1"
        formatted_response = f"PASSKEY={PASSKEY}&stationtype={stationtype}&dateutc={dateutc}&model={MODEL}&Frequency={Frequency}"

        for key, value in mapped_data.items():
            if value is not None:
                formatted_response += f"&{key}={value}"

        # Define the URL to send the POST request to
        post_url = "http://localhost:8998/station/ecowitt"

        # Send the POST request
        headers = {'Content-Type': 'application/x-www-form-urlencoded'}
        post_response = requests.post(post_url, data=formatted_response, headers=headers)
        print(formatted_response)
        # Print the response from the POST request
        print(post_response.status_code)
        print(post_response.text)

    except Exception as e:
        print(f"An error occurred: {e}")

# Main loop to repeat the function every x seconds
x = 10  # Set the interval (in seconds)
while True:
    fetch_and_send_data()
    time.sleep(x)



--

Michael

unread,
Jun 23, 2024, 7:08:59 PM (11 days ago) Jun 23
to weewx-user

Jimi Lawson

unread,
Jun 23, 2024, 7:10:48 PM (11 days ago) Jun 23
to weewx...@googlegroups.com

Eddie Bryant

unread,
Jun 23, 2024, 8:17:24 PM (10 days ago) Jun 23
to weewx...@googlegroups.com
Thanks, I have copied the Python script file. What did you call the file and did you set it up to execute automatically on booting Linux? I am thinking of creating an O.S. using CumulusMx Raspberry Pi image. 

Eddie

Eddie Bryant

unread,
Jun 24, 2024, 11:19:40 AM (10 days ago) Jun 24
to weewx...@googlegroups.com
Michael,

Is JSON something that needs to be installed before running your script? I noticed that it is imported.

Eddie 

Eddie Bryant

unread,
Jun 24, 2024, 11:30:14 PM (9 days ago) Jun 24
to weewx...@googlegroups.com

I see that JSON is a library included with Python. I installed the CumulusMx image on my Pi4. I was going through the first time setup and was wondering what is the best station to use to be able to send data to APRS and CWOP. I thought about Ecowitt but it wanted information I didn't have.

Reply all
Reply to author
Forward
0 new messages