Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

strings.ini and posting data using ECOWITTEXTRA

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
watsonm
Posts: 209
Joined: Sun 03 Jan 2016 3:39 pm
Weather Station: N96GY -but like Triggers Broom!!
Operating System: Raspberry Pi4 Vers:11 Bullseye
Location: Poundbury, Dorset

strings.ini and posting data using ECOWITTEXTRA

Post by watsonm »

Hi,

Yet again I am confusing myself over the strings.ini file and posting data from an third party airquality sensor to cumulusmx.

My undestanding is that strings.ini just allows you to rename the appropriate entries on the external sensors page of CMX.
I do not use the (dead ) console so have python code reading sensors and shipping the data to CMX via the ECOWITT protocol

The appropriate section of my strings.ini is:

Code: Select all

[SoilMoistureCaptions]
Sensor1=SoilHum1
Sensor2=Sensor 2
Sensor3=Sensor 3
Sensor4=Sensor 4
Sensor5=Sensor 5
Sensor6=Sensor 6
Sensor7=Sensor 7
Sensor8=Sensor 8
.............
............
[AirQualityCaptions]
Sensor1=voc
Sensor2=Sensor 2
Sensor3=Sensor 3
Sensor4=Sensor 4
SensorAvg1=voc 24hr Avg
SensorAvg2=Sensor Avg 2
SensorAvg3=Sensor Avg 3
SensorAvg4=Sensor Avg 4

I successfully send my soil humidity from my WH51 by issuing the following (in a try/catch expression)

Code: Select all

  soil_data={  'SoilMoisture1'      : int(soil_moisture),     }
  
         x = requests.post( CMX_url+"extra" , soil_data, timeout = 5)
                  
  where:        CMX_url  = "http://localhost:8998/station/ecowitt"
       
 
In the air quality section I want to send the24hr average but cannot find the file which describes the command word (like SoilMoisture1) .
I have tried various options all to now avail.

Any pointers apprecaited.....
Regards Mike
Image
Raspberry Pi 4 Bullseye
Directly connected : BMP388 pressure sensor. DHT22 For internal Humidity/temp Sensor. PMS5003 Particle Sensor
Wireless connected: 3 (WS2083)Temp TXr's, WH57 Lightning Sensor, FO Solar sensor
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: strings.ini and posting data using ECOWITTEXTRA

Post by HansR »

Mike,

Tbh I do not fully understand what you are doing, but these values can be fetched using the API as follows (this is the URL as I would give in the browser, you should adjust it probably for your purpose) :

Code: Select all

http://localhost:8998/api/tags/process.json?AirQuality1&AirQualityAvg1
Otherwise I really havo no clue what your code would be doing.
For the soilmoisture:

Code: Select all

http://localhost:8998/api/tags/process.json?SoilMoisture1
The Webtags are described in the wiki on the Full list of Webtags
The API is described on the Local API page.

This all has nothing to do with strings.ini. Are you confused with Cutils?
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
watsonm
Posts: 209
Joined: Sun 03 Jan 2016 3:39 pm
Weather Station: N96GY -but like Triggers Broom!!
Operating System: Raspberry Pi4 Vers:11 Bullseye
Location: Poundbury, Dorset

Re: strings.ini and posting data using ECOWITTEXTRA

Post by watsonm »

Hans,
I wanted to send/write those parameters to CMX from my python script using the ecowitt http protocol. When writing the values , if I use AirQuality1 and AirQualityAvg1 I do not get the data into CMX. However writing to SoilMoisture1 does work!

Any way after many hours I have resolved the issue and I am using the following to write SoilMosture, AirQuality and AirQuality 24hr Average :

Code: Select all

    soil_data =  {   'SoilMoisture1'         : int(soil_moisture),       \
          'pm25_ch1'              : int(voc),       \
          'pm25_avg_24h_ch1'      : int(voctwenty),   }
          
        x = requests.post( CMX_url+"extra" , soil_data, timeout = 5)
I was puzzled as I could not find anywhere what these parameters should be. I had sort of presumed theye were in Extrafileheader.txt or the left hand column of strings.ini . Also search the source but I am non the wiser!! :roll:
Eventually found the one I needed on the WXForum by chance but if I need others in the future .... :(

Sorry to have confused you (and myself!!)
Regards Mike
Image
Raspberry Pi 4 Bullseye
Directly connected : BMP388 pressure sensor. DHT22 For internal Humidity/temp Sensor. PMS5003 Particle Sensor
Wireless connected: 3 (WS2083)Temp TXr's, WH57 Lightning Sensor, FO Solar sensor
User avatar
HansR
Posts: 6926
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: strings.ini and posting data using ECOWITTEXTRA

Post by HansR »

Writing values to CMX :!:
Did not know that was possible :o :clap:
Hans

https://meteo-wagenborgen.nl
CMX build 4070+ ● RPi 4B ● Linux 6.6.62+rpt-rpi-v8 aarch64 (bookworm) ● dotnet 8.0.1
BlueSky: https://bsky.app/profile/wagenborgenwx.bsky.social
watsonm
Posts: 209
Joined: Sun 03 Jan 2016 3:39 pm
Weather Station: N96GY -but like Triggers Broom!!
Operating System: Raspberry Pi4 Vers:11 Bullseye
Location: Poundbury, Dorset

Re: strings.ini and posting data using ECOWITTEXTRA

Post by watsonm »

Hans,

No hacking, a legitimate call to /station/ecowittextra as noted in
Settings-> extra sensor settings -> use a http station for extra sensors->Ecowitt.

Code: Select all

In WS View configure the Custom Server to use:-
Protocol: Ecowitt
Server: CMX IP Address
Path: /station/ecowittextra
Port: 8998
Interval: 20 
Regards Mike
Image
Raspberry Pi 4 Bullseye
Directly connected : BMP388 pressure sensor. DHT22 For internal Humidity/temp Sensor. PMS5003 Particle Sensor
Wireless connected: 3 (WS2083)Temp TXr's, WH57 Lightning Sensor, FO Solar sensor
User avatar
philpugh
Posts: 428
Joined: Tue 24 May 2011 8:34 am
Weather Station: See Signature
Operating System: Debian 12 (RPi5)
Location: Antrobus, Cheshire, UK
Contact:

Re: strings.ini and posting data using ECOWITTEXTRA

Post by philpugh »

It can be done but you need to define an Ecowitt station in CMX then send the correctly formatted string to this 'station'. I have done this to transfer data from a SKY/AIR Weatherflow system to CMX - but it isn't trivial.

This is the http string that I use to transfer data from a meteobridge station to CMX.
http://nnn.nnn.nnn.nnn:pppp/station/ecowitt?PASSKEY=someasciistring&stationtype=weatherflow_gwy&runtime=9696&dateutc=[YYYY]-[MM]-[DD]+[Uhh]:[Umm]:[Uss]&tempinf=[thb0temp-act=F.1]&humidityin=[thb0hum-act]&baromrelin=[thb0press-act=inHg.3]&baromabsin=[thb0seapress-act=inHg.3]&tempf=[th0temp-act=F.1]&humidity=[th0hum-act]&winddir=[wind0dir-act]&windspeedmph=[wind0wind-act=mph.2]&windgustmph=[wind0wind-max10.1:0=mph.2]&maxdailygust=[wind0wind-dmax=mph.2]&solarradiation=[sol0rad-act:--]&uv=[uv0index-act:--]&rainratein=[rain0rate-act=in.2]&dailyrainin=[rain0total-daysum=in.2]&monthlyrainin=[rain0total-monthsum=in.2]&yearlyrainin=[rain0total-yearsum=in.2]&model=MBridge
You would need to look at the Ecowitt API to determine the string for air quality.

Good luck!
Last edited by philpugh on Sat 22 Oct 2022 3:43 pm, edited 1 time in total.
Phil Pugh
GW1100 + WH65/WH57/WH31;GW1100 + WS68/WH40A (also with HP25xx console); GW2001 WittBoy
CumulusMX V4 / CUtils V7
Raspberry Pi 5 64bit
https://goosegate.uk/
SamiS
Posts: 511
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: strings.ini and posting data using ECOWITTEXTRA

Post by SamiS »

philpugh wrote: Sat 22 Oct 2022 1:36 pm It can be done but you need to define an Ecowitt station in CMX then send the correctly formatted string to this 'station'. I have done this to transfer data from a SKY/AIR Weatherflow system to CMX - but it isn't trivial.
As watsonm states in the previous post, you can enable ecowitt http api for extra sensors in CMX via Settings -> Extra Sensors -> Use a HTTP Station for extra sensors. This does not restrict ones ability to use something else as the main station. But yes, the correct call should be formatted as Ecowitt api defines. I’m not sure if Ecowitt has published its api regarding how the station communicates with the cloud, or only how to read data from their cloud. But there you can find something:

https://doc.ecowitt.net/web/#/

Best regards,

Sami
watsonm
Posts: 209
Joined: Sun 03 Jan 2016 3:39 pm
Weather Station: N96GY -but like Triggers Broom!!
Operating System: Raspberry Pi4 Vers:11 Bullseye
Location: Poundbury, Dorset

Re: strings.ini and posting data using ECOWITTEXTRA

Post by watsonm »

Thanks Phil and Sami.

Happy to say all working OK now but yes a full description of the API would have been helpful....

Phil) The code you have quoted is similar to my basic weather station data which is posted to "http://localhost:8998/station/ecowitt"

Code: Select all

             weather_data={'dateutc' : EW_time , 'solarradiation' :  LuxW, 'uv' : UV , \
             'tempf' : tempfahr  ,'tempinf' : tempfahrinf  ,'humidity' : humidity_send, 'baromrelin' : pressureinc , \
             'windspeedmph' : wind_avg_mph , 'windgustmph' : wind_gust_mph  ,'winddir' : wind_dir_EW, 'humidityin'  :  in_humidity, \
             'yearlyrainin'  : rain_inch ,'rainratein'  :  rainratein , 'yearlyrainmm'  :  rain, 'totalrainin'  : rain_inch}

What I was looking for was the extra sensor params to send to "http://localhost:8998/station/ecowittextra"

Code: Select all

 extra_sensor_data =  { 'SoilMoisture1' : int(soil_moisture), 'pm25_ch1' : int(voc), 'pm25_avg_24h_ch1' : int(voctwenty),   }
Regards Mike
Image
Raspberry Pi 4 Bullseye
Directly connected : BMP388 pressure sensor. DHT22 For internal Humidity/temp Sensor. PMS5003 Particle Sensor
Wireless connected: 3 (WS2083)Temp TXr's, WH57 Lightning Sensor, FO Solar sensor
watsonm
Posts: 209
Joined: Sun 03 Jan 2016 3:39 pm
Weather Station: N96GY -but like Triggers Broom!!
Operating System: Raspberry Pi4 Vers:11 Bullseye
Location: Poundbury, Dorset

Re: strings.ini and posting data using ECOWITTEXTRA

Post by watsonm »

To update the list :

Code: Select all

        Soil Moisture using WH51
        {'SoilMoisture1'    :  int(soil_ch1.value) }
        {'SoilMoisture2'    :  int(soil_ch2.value) }

        Voc - Volatile Organic Compounds  using   SGP40
        {'pm25_avg_24h_ch1' :  int(voctwenty) }   
        {'pm25_ch1'         :  int(voc) } 

        Air Quality using PMS5003
        {'pm25_co2'         :  pmg2p5 }
        {'pm25_24h_co2'     :  pmg25twenty }
        {'pm10_co2'         :  pmg10 }
        {'pm10_24h_co2'     :  pmg10twenty }



Regards Mike
Image
Raspberry Pi 4 Bullseye
Directly connected : BMP388 pressure sensor. DHT22 For internal Humidity/temp Sensor. PMS5003 Particle Sensor
Wireless connected: 3 (WS2083)Temp TXr's, WH57 Lightning Sensor, FO Solar sensor
Post Reply