Page 1 of 1
Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Sun Jun 09, 2024 2:17 pm
by Logansfury
Good Morning everyone,
Despite the time it took, the years it shed off my life expectancy, and the three and a half aneurysms it caused, getting the Cronograph conky up and running with openweathermap was tremendous fun.
I have taken a look at the Accuweather conditions icon set, and found it to contain 40 images for different reported weather, as opposed to the 18 images/conditions that Openweathermap recognizes.
I am starting to work on an Accuweather conky:
The issue is that there seems to be only current temp, weather condition, and an icon number in their current conditions forecast:
www.dataservice.accuweather.com/currentconditions/v1/329506?apikey=xxx
is the URL I am using. Is anyone familiar with Accuweather and have a more robust command to use to get more info like min/max daily temps, feels like temp, wind spd, gusts, and direction, humidity etc.
Thanks for reading,
Logan
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Sun Jun 09, 2024 2:39 pm
by Logansfury
I just found another command to use in conjunction with the other command:
https://dataservice.accuweather.com/forecasts/v1/daily/1day/329506?apikey=xxxx
This is giving me max and min temps, and emergency alert conditions, but nothing else. Still need a way to get to sunrise/sunset, wind, humidity etc
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Mon Jun 10, 2024 8:45 pm
by zcot
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Mon Jun 10, 2024 11:25 pm
by Logansfury
It looks like while I was working on this I may have inadvertantly had a request being sent every second along with the conky refresh. I got a message that I made too many calls and my API KEY was nuked. All my calls now bring up a bad key message.
I have emailed their support to explain the situation and see if I can get a new key to resume work on this.
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Tue Jun 11, 2024 4:38 am
by Logansfury
Making forward progress again. I was only shut off from the service for 24 hours, and I have found out I can make 50 total calls a day, so I made sure to adjust the conf file.
I finally found the key to getting robust information, at the end of the forecast request I needed to append "details=true" that increased the output of information on the return page by a factor of about 8. I have sun rise/set, moon rise/set, moon phase, moon age, excessive temp warnings, wind info, total sunlight hours etc etc.
I am going to build a sweet little weather widget
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Tue Jun 11, 2024 4:59 am
by Logansfury
Safari, sogoodi.
I am forced to go Pseudo-Transparency to not wash out the icon, as I am using ${image} instead of a lua. I may well ask for help getting a lua put together so I can go full Transparency! I just need to get the correct icon name and that is already being calculated by existing bash scripts I coaxed out of an online resource.
Until I can get a lua version of the icon display, I would like an outline around the visible dimensions of the widget. Can anyone explain how to do that please?
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Tue Jun 11, 2024 7:31 am
by Logansfury
The humidity read from this provider is whacked, but the widget is getting more populated. Going to add more moon crap shortly:
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Tue Jun 11, 2024 4:25 pm
by Koentje
I did some abracadabra in the image lua and i changed it so you can present any image from within conky!
transparent-image.lua
Code: Select all
--[[
2024 Koentje
]]
require 'cairo'
require "imlib2"
home_path = os.getenv ('HOME')
function fDrawImage(cr,path,xx,yy,ww,hh,arc)
cairo_save (cr)
local img = cairo_image_surface_create_from_png(path)
local w_img, h_img = cairo_image_surface_get_width(img), cairo_image_surface_get_height(img)
cairo_translate (cr, xx, yy)
if arc then
cairo_rotate (cr, arc)
end
cairo_scale (cr, ww/w_img, hh/h_img)
cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
cairo_paint (cr)
cairo_surface_destroy (img)
collectgarbage ()
cairo_restore (cr)
end
function conky_image(img,xxx,yyy,hhh,www)
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)
local cr=cairo_create(cs)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>4 then
-- local image = img
fDrawImage(cr,img,xxx,yyy,www,hhh)
end
cairo_surface_destroy(cs)
cairo_destroy(cr)
end
Then add this to your conky script
Code: Select all
lua_load = './transparent-image.lua',
And if you want to show an image add this line to your conky script
Code: Select all
# "path to image" "position x" "position y" "image width" "image height"
${lua conky_image /home/admin/.conky/MyPanels/images/weather/s000f000.png 40 40 60 60}
Now you can also use this from within the weather_icon bash script. You can use the
$weather_icon string as filename!
echo "\${lua conky_image /path/to/$weather_icon 40 40 60 60}"
Tadaaa..
Re: Working on Accuweather conky. Have a question for anyone familiar with Accuweather.
Posted: Tue Jun 11, 2024 5:39 pm
by Logansfury
not sure where I fouled up, but I have no display.