I'm doing it with a bash script, an example for cloud cover:
Code: Select all
#!/bin/bash
#Retrieve sensor data
/usr/bin/python fmi_observations.py > /home/pi/domoticz/scripts/fmi_observations.tmp
#Find parameters to update
CloudCover=$(cat /home/pi/domoticz/scripts/fmi_observations.tmp | grep 'TotalCloudCover' | awk -F ',' '{print $2}')
#Update if value has changed
curl -s "http://url:port/json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=$CloudCover"
(note, although the commented line says "Update if value has changed" I have not yet added the check for current value in Domoticz to determine whether to update)
Here I'm getting similar data as you are but I took away the extra space between the columns (if you keep it, you need to modify/replace the awk statement). Also, with grep it only works if "TotalCloudCover" is only once in the results (=> if you plan to fetch also forecast, once again modifications are needed). On your example the data is on third column so '{print $2} would ned to be '{print $3}.
In any case, basically this will fetch the the data with the python script and store it to a temp file (always writes over the previous). Then find the row matching to "TotalCloudCover" and store the second column (data) of that line as variable CloudCover. Curl fetches then the url which updates the value to Domoticz through the json api.
Several ways to add all the parameters here, the simplest one probably to just add more variables and curls

Finally have it run with cron on desired intervals.
On the Finnish home automation fb group where you probably picked this up from, there is also an example how to do it with node red (available by default in case you used sd image to orginally install Domoticz). I used to do stuff with node red but for some reason it kept hogging the memory which lead to crashes and slowness, probably due to my own fault though
edit: my data is in this format:
Code: Select all
GeopHeight,112.94
Temperature,4.44
Pressure,1007.0
Humidity,88.98
WindDirection,257.67
WindSpeedMS,2.39
WindUMS,1.98
WindVMS,1.33
MaximumWind,3.67
WindGust,7.17
DewPoint,2.15
TotalCloudCover,100.0
WeatherSymbol3,3.0
LowCloudCover,92.4
MediumCloudCover,0.0
HighCloudCover,95.5
Precipitation1h,0.0
PrecipitationAmount,0.0
RadiationGlobalAccumulation,0.0
RadiationLWAccumulation,6416061.5
RadiationNetSurfaceLWAccumulation,-166203.08
RadiationNetSurfaceSWAccumulation,0.0
RadiationDiffuseAccumulation,0.0