Go to advanced search

by eccentricdyslexic
Fri Oct 02, 2020 1:40 pm
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Re: Scrape a url for specific data

neilgl wrote:
Fri Oct 02, 2020 12:58 pm
And their pricing page has:

Code: Select all

Current Weather
Minute Forecast 1 hour
Hourly Forecast 2 days
Daily Forecast 7 days
Government Weather Alerts
Historical weather 5 days
I agree, their pricing page does not match their subs page.
by eccentricdyslexic
Fri Oct 02, 2020 1:39 pm
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Re: Scrape a url for specific data

Can I see your script to pull that info pls chap?
by eccentricdyslexic
Fri Oct 02, 2020 10:52 am
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Re: Scrape a url for specific data

Then use this to trigger a Sonoff or Alexa to turn on my electric water heater tank because there will likely be insufficient solar. I'd look at a commercial product like https://myenergi.com/product/eddi/ (which is made by my EV charger company). We're looking at getting PV in 2021 (mainly to char...
by eccentricdyslexic
Fri Oct 02, 2020 10:50 am
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Re: Scrape a url for specific data

eccentricdyslexic wrote:
Fri Oct 02, 2020 10:26 am
neilgl wrote:
Fri Oct 02, 2020 10:24 am
The free openweathermap API has daily forecast for next seven days. (I like free)
I’m sure I read it was only current weather?
Yes it is not free :-(
57D98F98-E146-4581-B858-42F5A33DBE02.jpeg
57D98F98-E146-4581-B858-42F5A33DBE02.jpeg (122.34 KiB) Viewed 189 times
by eccentricdyslexic
Fri Oct 02, 2020 10:26 am
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Re: Scrape a url for specific data

neilgl wrote:
Fri Oct 02, 2020 10:24 am
The free openweathermap API has daily forecast for next seven days. (I like free)
I’m sure I read it was only current weather?
by eccentricdyslexic
Fri Oct 02, 2020 10:00 am
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Re: Scrape a url for specific data

Open weather do an api, but the subscription for forecasts is prohibitive. Unless I can find another api that will provide the forecast via api, I have to scrape.
Steve
by eccentricdyslexic
Fri Oct 02, 2020 8:15 am
Forum: Beginners
Topic: Scrape a url for specific data
Replies: 18
Views: 327

Scrape a url for specific data

Hi all,
I want to scape a weather forecast page during the night for the cloud cover % for the day to come. Then use this to trigger a Sonoff or Alexa to turn on my electric water heater tank because there will likely be insufficient solar.
How would you go about this pls peeps?
Ta
Steve
by eccentricdyslexic
Wed Jan 08, 2020 5:39 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Ok, i got this to work (hopefully...will be sure tomorrow!) if testmode == "yes" or sunrise <= ephem.localtime(ephem.now()) - timedelta(hours=0, minutes=60):#if its an hour before sunrise or test mode Turns out sunrise is a datetime object after beeing converted by the localtime function. Thanks for...
by eccentricdyslexic
Mon Jan 06, 2020 7:46 am
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Thanks, will delve more into it and let you know how I get on.
Cheers
Steve
by eccentricdyslexic
Sun Jan 05, 2020 9:43 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Ok had a play and the error is this - Traceback (most recent call last): File "timelapseV3.py", line 22, in <module> print "ephem time plus hour = %s" %ephem.localtime(ephem.now() + ephem.hour) File "/usr/local/lib/python2.7/dist-packages/ephem/__init__.py", line 467, in localtime timetuple = time.l...
by eccentricdyslexic
Sun Jan 05, 2020 9:09 am
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Ok, script runs from crontab at reboot at 4 am everyday. Woke this morning and found the script is not working as i used too. Seems to hanging on the add hour bit - Date & time program started = 2020/1/5 04:00:15 Next sunrise = 2020/1/5 08:38:33 Next sunset = 2020/1/5 17:31:53 Minutes between next s...
by eccentricdyslexic
Sat Jan 04, 2020 9:48 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Ok, I’ve added the extra code and it should log now, so will ssh in tommorow and see what’s reported:-)
Thanks for your help mate
Steve
by eccentricdyslexic
Sat Jan 04, 2020 5:39 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

this triggers it -

Code: Select all

while ephem.localtime(ephem.now()) <= ephem.localtime(home.next_rising(sun)):
                time.sleep(1)
                dostuff()


by eccentricdyslexic
Fri Jan 03, 2020 9:30 am
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

I must have missed something, here’s the first half of the code- import sys import os import time import ephem from datetime import datetime from datetime import timedelta #find local time of sun rise and sunset sun = ephem.Sun() home = ephem.Observer() home.lat, home.lon = '45.226691', '0.013133' #...
by eccentricdyslexic
Thu Jan 02, 2020 10:53 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Hi David. I did as you suggested, But the code didnt trigger. It worked fine in the original quoted code- if testmode == "yes" or sunrise <= ephem.localtime(ephem.now()): But this is not triggering an hour earlier as hoped- if testmode == "yes" or ephem.localtime(ephem.now()) >= sunrise - datetime.t...
by eccentricdyslexic
Wed Jan 01, 2020 9:46 am
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Thanks David. You are right, woke up this NY morning and the script had not triggered.
Will amend as you suggest and see if we are back up and running.
Cheers
Steve
by eccentricdyslexic
Tue Dec 31, 2019 9:19 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Re: Simple python question

Yes I believe so.
Many thanks
Steve
by eccentricdyslexic
Tue Dec 31, 2019 7:12 pm
Forum: Python
Topic: Simple python question
Replies: 17
Views: 1035

Simple python question

I do t want to get this wrong, but how do 8 minus off 60mins of this sunrise calc- if testmode == "yes" or sunrise <= ephem.localtime(ephem.now()): It triggers some code at sunrise, but I want it to trigger an hour early. Do i do it like this? if testmode == "yes" or sunrise <= ( ephem.localtime(eph...
by eccentricdyslexic
Tue Nov 26, 2019 11:36 am
Forum: Python
Topic: ImgMagick error
Replies: 0
Views: 139

ImgMagick error

All of a sudden my python timelpase pi is not working. I've not made any changes but im getting this error - [crop @ 0x1268340] w:1440 h:1080 -> w:2592 h:1458 [crop @ 0x1268340] Invalid too big or non positive size for width '2592' or heig ht '1458' Error opening filters! I've uninstalled and reinst...
by eccentricdyslexic
Fri Nov 08, 2019 11:26 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 45
Views: 4012

Re: Upload a pic every minute

Before I go js I am trying convert -resize 1000x700
Will let you know tomorrow if it works:-)
by eccentricdyslexic
Wed Nov 06, 2019 8:41 am
Forum: General discussion
Topic: Upload a pic every minute
Replies: 45
Views: 4012

Re: Upload a pic every minute

So.... I need to install java on the pi and replace string...args with “latest image.jpg”, 1200x740 ?
by eccentricdyslexic
Tue Nov 05, 2019 8:04 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 45
Views: 4012

Re: Upload a pic every minute

Yes I’d like to keep the hi res for the timelapse so your idea sounds good, what js did you use?
Steve
by eccentricdyslexic
Tue Nov 05, 2019 2:33 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 45
Views: 4012

Re: Upload a pic every minute

Thanks all, I have it working fine, but my internet connection is very very slow, the Hd pictures from raspistill take ages to upload. Can I still take the picture hd then scale it down before sending it to the folder where apache picks it up from?
Cheers
Steve
by eccentricdyslexic
Sun Oct 06, 2019 6:24 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 45
Views: 4012

Re: Upload a pic every minute

Cool, will look into it,

Steve
by eccentricdyslexic
Sat Oct 05, 2019 10:37 pm
Forum: General discussion
Topic: Upload a pic every minute
Replies: 45
Views: 4012

Re: Upload a pic every minute

Great, I e got it working, crontab mv the img from home to var/www/html every minute.
Now, I want to share it with others, how to secure my pi?

Go to advanced search