-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How do I extract data from this app? #137
Comments
Hello, Do you know how to add widgets in Conky ? |
@dglent ` 2023/09/11 19:11:51 INFO: Actual weather status for: Loughton GB 21.9° Feels like 22 °C overcast clouds - 2431: meteo_qt I have no wish to see any meteo-qt icons within conky, just the data from the meteo-gt app. |
In the log file you have some usefull data Feels like 22 °C overcast clouds` I don’t know how you add data in conky. If you read this file every hour for exemple you can exctract the current weather status. If you need more data as forecast it will be easy to add also. |
@dglent Location Thanks, Dave. |
You can add this line: logging.info(
f'EXPORT:{ {key: value if type(value) == str else " ".join(v for v in value) for key, value in self.weatherDataDico.items()} }'
) here just after this line: Line 2431 in 92ec153
and tell me if you can use it and if you want more data |
Hi, I added the line you told me to and now the program will not start at
startup. I try to start the program manually via the start-menu and
nothing. I have since removed the line:
logging.info(
f'EXPORT:{ {key: value if type(value) == str else " ".join(v for v in value) for key, value in self.weatherDataDico.items()} }'
)
and the program works fine again.
…On Tue, 19 Sept 2023 at 04:03, Dimitrios Glentadakis < ***@***.***> wrote:
You can add this line:
logging.info(
f'EXPORT:{ {key: value if type(value) == str else " ".join(v for v in value) for key, value in self.weatherDataDico.items()} }'
)
here just after this line:
https://github.com/dglent/meteo-qt/blob/92ec15380a227fc28ddb0179ab51639cfcbdd4a6/meteo_qt/meteo_qt.py#L2431
and tell me if you can use it and if you want more data
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZTI7JGWSQWXEYWNDLTX3EDRNANCNFSM6AAAAAA4SGOZMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It should work, try the exact following code. if not self.toggle_tray_action:
logging.info(f'Actual weather status for: {self.notification}')
logging.info(
f'EXPORT:{ {key: value if type(value) == str else " ".join(v for v in value) for key, value in self.weatherDataDico.items()} }'
) |
Hi,
So I got it working, all works well.
You mentioned if I required any other parameters I should ask. Can
*moonrise* and *moonfall* be added?
Also, can the exported data be in CSV database format? Like:
Parameter,Value
Sunrise,06:48
Sunset,19:03
Feels_Like,10.52 C
...
Dave.
…On Fri, 22 Sept 2023 at 04:28, Dimitrios Glentadakis < ***@***.***> wrote:
It should work, try the exact following code.
I wanted to know if this way is suitable to import data in Conky.
Then i will format the data (e.g. the time) and i will add more data in
this object/dictionary export but firstly test if it is usable like this
[image: εικόνα]
<https://user-images.githubusercontent.com/4337756/269820192-be4a791d-d77a-4dac-87b0-381cf2f60b09.png>
if not self.toggle_tray_action:
logging.info(f'Actual weather status for: {self.notification}')
logging.info(
f'EXPORT:{ {key: value if type(value) == str else " ".join(v for v in value) for key, value in self.weatherDataDico.items()} }'
)
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZVTUYFREUCPZRKNE6LX3UAXHANCNFSM6AAAAAA4SGOZMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I started with this, is the lines format ok for your need ? logging.info(
f"\nEXPORT_START\n"
f"City,{city_label}\n"
f"Feels like,{self.feels_like_value.text()}\n"
f"Wind,{self.weatherDataDico['Wind'][4]} {wind_speed} {self.unit_system_wind} {self.weatherDataDico['Wind'][1]}\n"
f"Cloudiness,{self.weatherDataDico['Clouds']}\n"
f"EXPORT_END\n"
) Add this code here (it is at the end of the update of the gui panel): Line 821 in 92ec153 |
Yes, its fine. Thank you.
…On Wed, 4 Oct 2023 at 05:28, Dimitrios Glentadakis ***@***.***> wrote:
I started with this, is the lines format ok for your need ?
logging.info(
f"\nEXPORT_START\n"
f"City,{city_label}\n"
f"Feels like,{self.feels_like_value.text()}\n"
f"Wind,{self.weatherDataDico['Wind'][4]} {wind_speed} {self.unit_system_wind} {self.weatherDataDico['Wind'][1]}\n"
f"Cloudiness,{self.weatherDataDico['Clouds']}\n"
f"EXPORT_END\n"
)
Add this code here (it is at the end of the update of the gui panel):
https://github.com/dglent/meteo-qt/blob/92ec15380a227fc28ddb0179ab51639cfcbdd4a6/meteo_qt/meteo_qt.py#L821
[image: εικόνα]
<https://user-images.githubusercontent.com/4337756/272461184-4ecca40d-24b6-40b3-855c-bf42c5a315ad.png>
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZWB6BFQC7WKWRWIXYLX5TQWLAVCNFSM6AAAAAA4SGOZMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBWGEYTINRQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Try the above commit to tell me if ok
|
Hi, I cannot seem to find the exported information in a CSV database file
anywhere. Where would the CSV file be saved to? Thanks. David.
…On Sat, 7 Oct 2023 at 07:13, Dimitrios Glentadakis ***@***.***> wrote:
Try the above commit to tell me if ok
- The air quality an UV are arriving after the update of the GUI so
you will see them after the next update of the weather.
It needs to make some modifications to make some variables global etc,
check as it and tell me
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZSWP3OV33JIQVVGR5TX6DXI5AVCNFSM6AAAAAA4SGOZMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRGYYTKOJZG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ah sorry i didn't precise, the data are logged in the log file which you can find in ~/.config/meteo-qt/meteo-qt.log [dglent@localhost meteo-qt]$ pwd
/home/dglent/.config/meteo-qt
[dglent@localhost meteo-qt]$ awk '/EXPORT_START/{ f=1;r=""; next }f && /EXPORT_END/{f=0} f{ r=(r=="")? $0: r RS $0 }END{ print r }' meteo-qt.log
City,Paris, FR
Temperature,13.87 °C
Feels like,13.79 °C
Wind,South 7.6 km/h light breeze
Cloudiness,100% overcast clouds
Humidity,95 %
Visibility,10.0 km
Comfort,Comfortable
Precipitation,rain 1.15 mm
Sunrise,08:17
Sunset,18:52
Daylight,10:35
Air quality,Moderate
UV,2.08 Low
[dglent@localhost meteo-qt]$ awk '/EXPORT_START/{ f=1;r=""; next }f && /EXPORT_END/{f=0} f{ r=(r=="")? $0: r RS $0 }END{ print r }' meteo-qt.log > meteo_exp.csv
[dglent@localhost meteo-qt]$ ls
meteo_exp.csv meteo-qt.conf meteo-qt.log |
Hi again, I'm sorry to be a PITA but the CSV file has no data inside it. I
executed the following command:
*awk '/EXPORT_START/{ f=1;r=""; next }f && /EXPORT_END/{f=0} f{ r=(r=="")?
$0: r RS $0 }END{ print r }' meteo-qt.log > meteo_exp.csv*
But the file was empty. I have attached the generated file.
Thanks, Dave.
…On Fri, 20 Oct 2023 at 05:37, Dimitrios Glentadakis < ***@***.***> wrote:
Ah sorry i didn't precise, the data are logged in the log file which you
can find in the folder ~/.config/meteo-qt/meteo-qt.log
You can have a script which extracts (for e.g. every 30 minutes) the data
from this file.
You can extract the data and use them directly or create a csv file.
You can use the following awk command:
***@***.*** meteo-qt]$ ***@***.*** meteo-qt]$ awk '/EXPORT_START/{ f=1;r=""; next }f && /EXPORT_END/{f=0} f{ r=(r=="")? $0: r RS $0 }END{ print r }' meteo-qt.logCity,Paris, FRTemperature,13.87 °CFeels like,13.79 °CWind,South 7.6 km/h light breezeCloudiness,100% overcast cloudsHumidity,95 %Visibility,10.0 kmComfort,ComfortablePrecipitation,rain 1.15 mm Sunrise,08:17Sunset,18:52Daylight,10:35Air quality,ModerateUV,2.08 ***@***.*** meteo-qt]$ awk '/EXPORT_START/{ f=1;r=""; next }f && /EXPORT_END/{f=0} f{ r=(r=="")? $0: r RS $0 }END{ print r }' meteo-qt.log > ***@***.*** meteo-qt]$ lsmeteo_exp.csv meteo-qt.conf meteo-qt.log
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZW3OFMUDRXFNVLE7FLYAH5XHAVCNFSM6AAAAAA4SGOZMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSGA3DONBSGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If you run the commande without the "> meteo_exp.csv" you should see the data in the terminal. If not are you sure do have downloaded the latest meteo_qt.py file from github ? Do you find these data in the log file ? |
OK so I downloaded the new meteo_qt.py file from github and yes I see the
data in the log file. Thanks. David.
…On Sun, 22 Oct 2023 at 06:24, Dimitrios Glentadakis < ***@***.***> wrote:
If you run the commande without the "> meteo_exp.csv" you should see the
data in the terminal. If not are you sure do have downloaded the latest
meteo_qt.py file from github ? Do you find these data in the log file ?
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZU7W2XUBGJWJHAB6WTYASUZ3AVCNFSM6AAAAAA4SGOZMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTHE4TQNRVGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi @dglent, I have been having problems with the API but I can still see the weather data in the meteo-qt application window. But nothing is displayed within conky. I cleared the meteo-qt log file and restarted the application, below is the information from the log file:
Even with a new API key the error messages are like what I have posted above. Thanks, David. |
Do you have the latest version (3.4) ? |
No, I have posted a request in the AUR package page for the maintainer to
update it. Thanks.
…On Thu, 19 Sept 2024 at 04:01, Dimitrios Glentadakis < ***@***.***> wrote:
Do you have the latest version (3.4) ?
—
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZ2QZQBTA3N6DSBEPDYP2DZXI5ABAVCNFSM6AAAAABOOPKQZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJZHA3TSNJYGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi, I would like to extract data from this app and display it in conky. How do I do this? Thanks, Dave.
The text was updated successfully, but these errors were encountered: