You might take a look at the crt service: 
https://github.com/weewx/weewx/wiki/crt

This writes a text file, realtime.txt every time new loop data is received. 
The current outside temperature is always the third field in the file. 
However, many loop packets may not include temperature data, in which case 
that field contains "NULL". So your script would have to monitor that file 
continuously and assign the current temperature to a variable every time it 
updates.

Alternately, if your archive cycle is five minutes and you're saving a 
webcam image every five minutes, couldn't you set it up so that your script 
runs one minute after weewx updates?


On Wednesday, July 31, 2019 at 8:18:28 AM UTC-4, Robin wrote:
>
> Is it possible to get the current temperature to use in a shell script?
>
> Let me explain what I am doing and what I would like to do.
>
> I have a webcam. I use a shell script every five minutes to: 
>
>    1. grab an image with avconv
>    2. add text, including 'current' temperature (from a txt file 
>    generated using cheetah generator) and the time.
>    3. save the image so that rsync uploads it to my website with the 
>    other files.
>
> You can see the result here  <http://www.weather.molyvos.eu/image.jpg>
>
> My problem is the txt file is 5 minutes old. There is normally small or no 
> difference between 'current' and 5-minute old data. BUT, there are times 
> when the difference is significant and I would like to "do better"!
>
> I really am not good at this stuff, I meddle and poke until I get things 
> sorted or I break something, normally the latter. So I was hoping that 
> somebody could advise me.
>
> Can I use in my script to get loop data so the temperature will be correct 
> at the time of the grab?
>
> Thanks, people.
>

-- 
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/66744dd5-e310-4d64-841f-d4b037b8c803%40googlegroups.com.

Reply via email to