Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
SunTracker - with moving ghost
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
OK, I found an easy way to get the data. I can present both the condition, the temperature as well as the humidity. Humidity could also be good to know so that your marquees (or awnings) are not rolled out if the humidity is too high.
In what format would this be useful?
- a new actions that on request returns the complete set (condition, temp, humidity) in the payload
- update of the automatic event generated every minute with the complete set (as it is done today with condition only)
- keep the old event as is and in addition make a new one holding the temp and humidity
Anyway you will have to capture the data in a python script to make something useful with it but this I suppose is ok for you.
Reason for asking is that I am a bit afraid to break a backward compatibility if someone already uses the weather condition event that is generated every minute.
Best regards, Walter
In what format would this be useful?
- a new actions that on request returns the complete set (condition, temp, humidity) in the payload
- update of the automatic event generated every minute with the complete set (as it is done today with condition only)
- keep the old event as is and in addition make a new one holding the temp and humidity
Anyway you will have to capture the data in a python script to make something useful with it but this I suppose is ok for you.
Reason for asking is that I am a bit afraid to break a backward compatibility if someone already uses the weather condition event that is generated every minute.
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
zaptorrent
- Posts: 5
- Joined: Thu Oct 18, 2012 2:17 pm
Re: SunTracker - with moving ghost
Cool! Maybe a new action with al the info would be best in order to keep it from breaking anything in other peoples setups.
For me personaly it'd work fine with anything where I then could do something like:
x = 7
if x > (int(eg.result)):
eg.TriggerEvent("It's below 7")
For me personaly it'd work fine with anything where I then could do something like:
x = 7
if x > (int(eg.result)):
eg.TriggerEvent("It's below 7")
Re: SunTracker - with moving ghost
I agree with that in principle. Is it not possible to ask the user if they want to extend the 'standard one minute weather condition event' extended with additional information by adding a check box somewhere? If they do, the event is expanded, otherwise it stays the same.Reason for asking is that I am a bit afraid to break a backward compatibility if someone already uses the weather condition event that is generated every minute
Also, are more variables available from the weather service, such as wind speed and wind direction? These are also important variables for deciding if sunscreens need to be up or down.
Another 'nice to have' that I have been thinking about is weather forecast. Suppose you have an automatic garden watering scheme going and the weather service predicts a lot of rain tomorrow (while today is a day full of sunshine). It would be nice to automatically stop the watering today based on tomorrow's prediction.
It would also allow you to give yourself early weather warnings specific to your needs. As an example, if the predicted wind speed for the day after tomorrow, if it falls in the weekend, is above a certain threshold or from a certain direction, you need a warning to cancel or adjust a boat sailing trip.
Regards,
Perry
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
I could easily add a new action that holds all this type of weather condition data in the payload. Then with a python script, it would be very easy to extract exactly what is of interest. I will make a proposal that we could evaluate.
Best regards, Walter
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
I have added 3 new actions that you can use in scripts. Below is the sample code that shows how it works. Each action returns a dictionary holding the corresponding data. Please try it out how it works for you.
Best regards, Walter
Code: Select all
wind = eg.plugins.Suntracker.GetWindData()
print wind
{'direction': u'60', 'speed': u'11.27', 'chill': u'7'}
Code: Select all
atmosphere = eg.plugins.Suntracker.GetAtmosphereData()
print atmosphere
{'pressure': u'1015.92', 'rising': u'0', 'visibility': u'9.99', 'humidity': u'93'}
Code: Select all
forecasts = eg.plugins.Suntracker.GetForecasts()
print forecasts
[{'date': u'20 Oct 2012', 'high': u'9', 'code': u'11', 'low': u'8', 'text': u'Light Rain'}, {'date': u'21 Oct 2012', 'high': u'9', 'code': u'9', 'low': u'6', 'text': u'AM Drizzle'}]
print forecasts[0]
{'date': u'20 Oct 2012', 'high': u'9', 'code': u'11', 'low': u'8', 'text': u'Light Rain'}
print forecasts[1]
{'date': u'21 Oct 2012', 'high': u'9', 'code': u'9', 'low': u'6', 'text': u'AM Drizzle'}
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
This is working well, thanks. Would it be possible to get more than today and tomorrow's forecast? Five days would be ideal.
I found out other people are talking about this as well and there appear to be some solutions:
http://stackoverflow.com/questions/7399 ... eather-api
I found out other people are talking about this as well and there appear to be some solutions:
http://stackoverflow.com/questions/7399 ... eather-api
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Hi Perry,
I tried the hint but for me it did not give any change. It still only provides forecasts for today and for tomorrow.
http://weather.yahooapis.com/forecastrs ... 29&u=c&d=5
only gives for today and tomorrow, not for 5 days as expected.
http://weather.yahoo.com/forecast/NLXX0023_c.html
however gives more days but I will have to look into this more, it gives more complex html parsing since it is not the recommended yahoo api function and therefore I am not sure if can be used for stability reasons (a small change on the yahoo html-page can cause the function to stop working).
Thanks anyway for the hint.
Best regards, Walter
I tried the hint but for me it did not give any change. It still only provides forecasts for today and for tomorrow.
http://weather.yahooapis.com/forecastrs ... 29&u=c&d=5
only gives for today and tomorrow, not for 5 days as expected.
http://weather.yahoo.com/forecast/NLXX0023_c.html
however gives more days but I will have to look into this more, it gives more complex html parsing since it is not the recommended yahoo api function and therefore I am not sure if can be used for stability reasons (a small change on the yahoo html-page can cause the function to stop working).
Thanks anyway for the hint.
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
zaptorrent
- Posts: 5
- Joined: Thu Oct 18, 2012 2:17 pm
Re: SunTracker - with moving ghost
This is great and i can get all the new data from these actions to use as I wish but I dont get where I find the current temperature? The data that's in the "condition" statement where you're getting the text (partly cloudy... aso) from? Am I missing something?
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Missed one action, added in this version
Best regards, Walter
Use as follows:
Will soon put this as a release version in the first first if everything seems to be working ok
Use as follows:
Code: Select all
condition = eg.plugins.Suntracker.GetCurrentCondition()
print condition
{'date': u'Sun, 21 Oct 2012 12:19 pm CEST', 'text': u'Mostly Cloudy', 'code': u'28', 'temp': u'9', 'title': u'Conditions for Stockholm, SE at 12:19 pm CEST'}
print condition['temp']
9
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
zaptorrent
- Posts: 5
- Joined: Thu Oct 18, 2012 2:17 pm
Re: SunTracker - with moving ghost
I havent tried everything but as far as I can tell it's working perfectly. Great job! 
Re: SunTracker - with moving ghost
I apologies if this question has been asked, but i looked through the forum and google and couldn't find help.
can someone please tell me how can i make Sun Tracker give me the weather condition with the temp and then have the speech plugin say the condition out loud?
i have my location set up fine, but i cant seem to know how to "Get" info from Sun Tracker.
can someone please tell me how can i make Sun Tracker give me the weather condition with the temp and then have the speech plugin say the condition out loud?
i have my location set up fine, but i cant seem to know how to "Get" info from Sun Tracker.
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
This is a simple sample python script how you could do it:
Code: Select all
condition = eg.plugins.Suntracker.GetCurrentCondition()
weather = 'The current weather is '+condition['text']
temp = 'The temperature is '+condition['temp']+' degrees'
eg.plugins.Speech.TextToSpeech(u'Microsoft Anna - English (United States)', 0, weather, 0, 100)
eg.plugins.Speech.TextToSpeech(u'Microsoft Anna - English (United States)', 0, temp, 0, 100)
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
Hi Walter!
I updated the Suntracker today, then it broke!
Then I also get the following:
I grabbed the Suntracker from the first post and extracted it and overwrote the old files, maybe I should'nt have done that!
...so now what to do? Thankful for help, the sun is soon going down here in Gothenburg
I updated the Suntracker today, then it broke!
Code: Select all
15:13:41 Error starting plugin: SunTracker
15:13:41 Traceback (most recent call last) (1544):
15:13:41 File "C:\PROGRA~2\EVENTG~1\eg\Classes\PluginInstanceInfo.py", line 177, in Start
15:13:41 self.instance.__start__(*self.args)
15:13:41 TypeError: __start__() takes exactly 14 arguments (10 given)Code: Select all
15:13:41 SunTracker: Start new or control running SunTracker
15:13:41 Plugin "SunTracker" is not activated...so now what to do? Thankful for help, the sun is soon going down here in Gothenburg
Re: SunTracker - with moving ghost
Thank you very very much for the quick response and the help.
sorry if this question is stupid, but to get the forecast for the day do i switch the Condition = .... to this forecasts = eg.plugins.Suntracker.GetForecasts()
thanks
sorry if this question is stupid, but to get the forecast for the day do i switch the Condition = .... to this forecasts = eg.plugins.Suntracker.GetForecasts()
thanks
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
@Samme, this might become problematic. It looks like it was a rather old version you had before?
One way you can try is this:
1) Disable the Suntracker plugin and all SunTracker actions so that they not try to start when EG starts
2) Save and exit EG
3) Restart EG (now the SunTracker plugin and the actions should not start)
4) Open the settings for the plugin, click ok (hopefully this works)
5) Do the same for all Suntracker actions
6) Save
If this worked, try to enable the SunTracker plugin. It should start. Do the same for each action. Check that they have started ok.
If this does not work, you can do some xml editing. Create a new EG configuration, add only Suntracker and configure one SunTracker macro/action. Save and exit. Now open both the old and the new xml files in a text editor
1) Copy paste the new section with the plugin part to the old xml
2) Study the format of the SunTracker actions in both files, try to repair the old ones so that they get the same number of parameters, use the same data, this can be changed later.
3) Save, restart EG, open the old xml, hopefully it will work
4) Open and verify the configuration of the plugin and it actions as described earlier above
If this does not work, a last resort is always to reconfigure everything from scratch.
But before doing this, post your EG configuration file here, I might be able to repair it for you if you do not succed.
Best regards, Walter
One way you can try is this:
1) Disable the Suntracker plugin and all SunTracker actions so that they not try to start when EG starts
2) Save and exit EG
3) Restart EG (now the SunTracker plugin and the actions should not start)
4) Open the settings for the plugin, click ok (hopefully this works)
5) Do the same for all Suntracker actions
6) Save
If this worked, try to enable the SunTracker plugin. It should start. Do the same for each action. Check that they have started ok.
If this does not work, you can do some xml editing. Create a new EG configuration, add only Suntracker and configure one SunTracker macro/action. Save and exit. Now open both the old and the new xml files in a text editor
1) Copy paste the new section with the plugin part to the old xml
2) Study the format of the SunTracker actions in both files, try to repair the old ones so that they get the same number of parameters, use the same data, this can be changed later.
3) Save, restart EG, open the old xml, hopefully it will work
4) Open and verify the configuration of the plugin and it actions as described earlier above
If this does not work, a last resort is always to reconfigure everything from scratch.
But before doing this, post your EG configuration file here, I might be able to repair it for you if you do not succed.
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM