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
-
Henrik4223
- Posts: 47
- Joined: Fri Mar 04, 2016 10:18 am
Re: SunTracker - with moving ghost
GREAT!!! thanks a lot - that fixed it!
-
heggholmen
- Posts: 6
- Joined: Thu Aug 07, 2014 3:05 pm
Re: SunTracker - with moving ghost
Thanks - good idea. I'll give it a try:)
Re: SunTracker - with moving ghost
Hi there.
I have been using the GetWeatherCondition action to.... get the weather condition.
Recently it has stopped working, coming back with "undefined"as the result.
Has something changed?
Do I need to update the plugin?
Here is my error log...
20:03:41 SunTracker: GetWeatherCondition
20:03:41 Speech: Speak: The weather today will be {eg.result}
20:03:41 u'The weather today will be Undefined'
20:03:41 SunTracker: GetForecasts
20:03:41 Error in Action: "SunTracker: GetForecasts"
20:03:41 Traceback (most recent call last) (1669):
20:03:41 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
20:03:41 return self(*args)
20:03:41 File "C:\Program Files (x86)\EventGhost\plugins\SunTracker\__init__.py", line 5318, in __call__
20:03:41 return self.plugin.weather_data['forecasts']
20:03:41 KeyError: 'forecasts'
I have been using the GetWeatherCondition action to.... get the weather condition.
Recently it has stopped working, coming back with "undefined"as the result.
Has something changed?
Do I need to update the plugin?
Here is my error log...
20:03:41 SunTracker: GetWeatherCondition
20:03:41 Speech: Speak: The weather today will be {eg.result}
20:03:41 u'The weather today will be Undefined'
20:03:41 SunTracker: GetForecasts
20:03:41 Error in Action: "SunTracker: GetForecasts"
20:03:41 Traceback (most recent call last) (1669):
20:03:41 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
20:03:41 return self(*args)
20:03:41 File "C:\Program Files (x86)\EventGhost\plugins\SunTracker\__init__.py", line 5318, in __call__
20:03:41 return self.plugin.weather_data['forecasts']
20:03:41 KeyError: 'forecasts'
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Hard to say, I would guess something is currently not working with weather services at your location. I have sometimes noticed that the weather service temporarily may not work for some locations. Try to change your location settings to a more stable. For instance, instead of using a suburban type of setting, try a location closer to the center of the city.
Also, try this script and copy & paste the results here
Also, try this script and copy & paste the results here
Code: Select all
print eg.plugins.Suntracker.GetForecasts()
print eg.plugins.Suntracker.GetCurrentCondition()
#print eg.plugins.Suntracker.GetWeatherCondition()
#print eg.plugins.Suntracker.GetWindData()
#print eg.plugins.Suntracker.GetAtmosphereData()
#print eg.plugins.Suntracker.GetSunStateWithTimeStamp()
#print eg.plugins.Suntracker.GetSunState()
print eg.plugins.Suntracker.plugin.weather_data
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
hi
I also have been having the same issue for the past couple of days, i didnt update or change anything, it just stopped working.
i tried to do what you mention above and updated my location, and i think it partly worked.
if i try eg.plugins.Suntracker.GetWeatherCondition i get "Undefined".
and if i try eg.plugins.Suntracker.GetForecasts i get this
any suggestions?
thanks
I also have been having the same issue for the past couple of days, i didnt update or change anything, it just stopped working.
i tried to do what you mention above and updated my location, and i think it partly worked.
if i try eg.plugins.Suntracker.GetWeatherCondition i get "Undefined".
and if i try eg.plugins.Suntracker.GetForecasts i get this
Code: Select all
13:52:03 Error in Action: "SunTracker: GetForecasts"
13:52:03 Traceback (most recent call last) (1722):
13:52:03 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
13:52:03 return self(*args)
13:52:03 File "C:\Program Files (x86)\EventGhost\plugins\SunTracker\__init__.py", line 5318, in __call__
13:52:03 return self.plugin.weather_data['forecasts']
13:52:03 TypeError: 'NoneType' object is unsubscriptable
thanks
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
If I run this script
I get the following results
Just to verify, try another location like GMXX0007:1:GM
Code: Select all
print eg.plugins.Suntracker.GetWeatherCondition()
print eg.plugins.Suntracker.GetForecasts()
Code: Select all
15:14:21 Light Rain
15:14:21 [{'day_of_week': u'Wednesday', 'high': u'7', 'sunset': u'7:44 PM', 'low': u'3', 'night': {'brief_text': u'Clear Late', 'text': u'Clouds Early / Clearing Late', 'chance_precip': u'20', 'humidity': u'84', 'wind': {'gust': u'N/A', 'direction': u'241', 'speed': u'30', 'text': u'WSW'}, 'icon': u'29'}, 'date': u'Apr 6', 'day': {'brief_text': u'Showers', 'text': u'Showers', 'chance_precip': u'60', 'humidity': u'84', 'wind': {'gust': u'N/A', 'direction': u'241', 'speed': u'30', 'text': u'WSW'}, 'icon': u'11'}, 'sunrise': u'5:59 AM'}, {'day_of_week': u'Thursday', 'high': u'10', 'sunset': u'7:44 PM', 'low': u'3', 'night': {'brief_text': u'Cloudy', 'text': u'Cloudy', 'chance_precip': u'20', 'humidity': u'80', 'wind': {'gust': u'N/A', 'direction': u'191', 'speed': u'22', 'text': u'S'}, 'icon': u'26'}, 'date': u'Apr 7', 'day': {'brief_text': u'Light Rain', 'text': u'Light Rain', 'chance_precip': u'70', 'humidity': u'75', 'wind': {'gust': u'N/A', 'direction': u'191', 'speed': u'22', 'text': u'S'}, 'icon': u'11'}, 'sunrise': u'5:59 AM'}, {'day_of_week': u'Friday', 'high': u'10', 'sunset': u'7:44 PM', 'low': u'2', 'night': {'brief_text': u'P Cloudy', 'text': u'Partly Cloudy', 'chance_precip': u'10', 'humidity': u'79', 'wind': {'gust': u'N/A', 'direction': u'224', 'speed': u'19', 'text': u'SW'}, 'icon': u'29'}, 'date': u'Apr 8', 'day': {'brief_text': u'Cloudy', 'text': u'Cloudy', 'chance_precip': u'20', 'humidity': u'67', 'wind': {'gust': u'N/A', 'direction': u'224', 'speed': u'19', 'text': u'SW'}, 'icon': u'26'}, 'sunrise': u'5:59 AM'}, {'day_of_week': u'Saturday', 'high': u'12', 'sunset': u'7:44 PM', 'low': u'0', 'night': {'brief_text': u'P Cloudy', 'text': u'Partly Cloudy', 'chance_precip': u'0', 'humidity': u'78', 'wind': {'gust': u'N/A', 'direction': u'247', 'speed': u'14', 'text': u'WSW'}, 'icon': u'29'}, 'date': u'Apr 9', 'day': {'brief_text': u'P Cloudy', 'text': u'Partly Cloudy', 'chance_precip': u'10', 'humidity': u'58', 'wind': {'gust': u'N/A', 'direction': u'247', 'speed': u'14', 'text': u'WSW'}, 'icon': u'30'}, 'sunrise': u'5:59 AM'}, {'day_of_week': u'Sunday', 'high': u'12', 'sunset': u'7:44 PM', 'low': u'0', 'night': {'brief_text': u'M Clear', 'text': u'Mostly Clear', 'chance_precip': u'0', 'humidity': u'75', 'wind': {'gust': u'N/A', 'direction': u'72', 'speed': u'9', 'text': u'ENE'}, 'icon': u'33'}, 'date': u'Apr 10', 'day': {'brief_text': u'M Sunny', 'text': u'Mostly Sunny', 'chance_precip': u'0', 'humidity': u'61', 'wind': {'gust': u'N/A', 'direction': u'72', 'speed': u'9', 'text': u'ENE'}, 'icon': u'34'}, 'sunrise': u'5:59 AM'}]
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
Hello!
I did a clean install of Event Ghost, set-up Suntracker with the default location info, made a macro to run the script you suggested, and this is what I got in the log :
Is there an update to Sun Tracker that we need to download? What geographic info are you using?
And thanks for your help - we appreciate it!
I did a clean install of Event Ghost, set-up Suntracker with the default location info, made a macro to run the script you suggested, and this is what I got in the log :
- Python Script
Undefined
Traceback (most recent call last):
Python script "1", line 2, in <module>
print eg.plugins.Suntracker.GetForecasts()
File "C:\Program Files (x86)\EventGhost\plugins\SunTracker\__init__.py", line 5318, in __call__
return self.plugin.weather_data['forecasts']
KeyError: 'forecasts'
- Longitude: 40.7128
Latitude: -74.0059
Location: 2459115
Is there an update to Sun Tracker that we need to download? What geographic info are you using?
And thanks for your help - we appreciate it!
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
@dt1000
I suspect you are using the Suntracker version included in the Eventghost setup. Unfortunately, this is not the latest, it might even be obsolete. You have to upgrade the plugin, see the link below for download. For New York you can use USNY0996:1:US
I suspect you are using the Suntracker version included in the Eventghost setup. Unfortunately, this is not the latest, it might even be obsolete. You have to upgrade the plugin, see the link below for download. For New York you can use USNY0996:1:US
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
Thanks for the tip.
I updated the plugin and get a very similar error...
I updated the plugin and get a very similar error...
- Python Script
Undefined
Traceback (most recent call last):
Python script "0", line 2, in <module>
print eg.plugins.Suntracker.GetForecasts()
File "C:\Program Files (x86)\EventGhost\plugins\SunTracker\__init__.py", line 5431, in __call__
return self.plugin.weather_data['forecasts']
KeyError: 'forecasts'
Re: SunTracker - with moving ghost
Ah! Changing the location info as you suggested seemed to fix it.
The code I was using was from Yahoo Weather, not The Weather Channel.
Maybe Yahoo have altered something recently that breaks Sun Tracker?
I'll stick with TWC for now. Thanks for the help!

The code I was using was from Yahoo Weather, not The Weather Channel.
Maybe Yahoo have altered something recently that breaks Sun Tracker?
I'll stick with TWC for now. Thanks for the help!
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Yep, Yahoo is not working any longer, it was quit a while it stopped actually. Now it is Weather.com that I use and it seems to have been reasonable stable for some while
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
Thanks for this neat plugin. I have the basic configs for sunrise/sunset down by reading posts here. But there is another idea I have that I don't know how to execute and would kindly ask for assistance.
I'd like to trigger an event ( eg.TriggerEvent('') when chance of precipitation falls in different ranges for the next day. I see the parameters 'chance_precip' when I use the eg.plugins.Suntracker.GetForecasts(), but I have no idea how to parse it as my python is very weak. Also I have no idea how to get get weather forecast for the next day so it checks it repeatedly everyday on schedule or loops as I don't see it in the plugin config.
So the general idea would once eg.plugins.Suntracker.GetForecasts() runs, it grabs the data for the next day specifically so forecasts[1] .
If 'chance_precip' is between 0-10 it would trigger event "main.noraintmrw", if between 20-30 it will trigger event "main.dizzletmrw" and so on.
Can anyone give me an idea how to do this? Thanks in any event.
I'd like to trigger an event ( eg.TriggerEvent('') when chance of precipitation falls in different ranges for the next day. I see the parameters 'chance_precip' when I use the eg.plugins.Suntracker.GetForecasts(), but I have no idea how to parse it as my python is very weak. Also I have no idea how to get get weather forecast for the next day so it checks it repeatedly everyday on schedule or loops as I don't see it in the plugin config.
So the general idea would once eg.plugins.Suntracker.GetForecasts() runs, it grabs the data for the next day specifically so forecasts[1] .
If 'chance_precip' is between 0-10 it would trigger event "main.noraintmrw", if between 20-30 it will trigger event "main.dizzletmrw" and so on.
Can anyone give me an idea how to do this? Thanks in any event.
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Thanks!
You try with this python script that selects example of the data you are looking for
You try with this python script that selects example of the data you are looking for
Code: Select all
fc = eg.plugins.Suntracker.GetForecasts()
nc_p = fc[1]['night']['chance_precip']
nf = fc[1]['night']['text']
dc_p = fc[1]['day']['chance_precip']
df = fc[1]['day']['text']
print 'Forecast tomorrow night: ', nf
print 'Forecast tomorrow day: ', df
if nc_p <= 10:
eg.TriggerEvent(
'No rain tomorrow night',
payload = '',
prefix = 'WeatherForecast'
)
if nc_p > 10 and nc_p <= 20:
eg.TriggerEvent(
'Drizzle tomorrow night',
payload = '',
prefix = 'WeatherForecast'
)
if nc_p > 20 and nc_p <= 30:
eg.TriggerEvent(
'??? tomorrow night',
payload = '',
prefix = 'WeatherForecast'
)
if dc_p <= 10:
eg.TriggerEvent(
'No rain tomorrow day',
payload = '',
prefix = 'WeatherForecast'
)
if dc_p > 10 and nc_p <= 20:
eg.TriggerEvent(
'Drizzle tomorrow day',
payload = '',
prefix = 'WeatherForecast'
)
if dc_p > 20 and nc_p <= 30:
eg.TriggerEvent(
'??? tomorrow day',
payload = '',
prefix = 'WeatherForecast'
)
# etc, etc, etc, just add more rules for night & day
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: SunTracker - with moving ghost
Oh wow, thanks for the reply!krambriw wrote:message
1) I need to backup and ask a question on simple sunrise/sunset. This morning I woke up to a barrage of notifications from Sunrise event as it was triggered like 10 times after correct sunrise



2) About chance of precipitation script, it's not triggering event at all when I test it even though 'chance_precip' is currently 0. It should generate event like "WeatherForecast.No rain tomorrow day" and "WeatherForecast.No rain tomorrow night", correct? All it shows is this in log:

3)Where should I put this script in EG so it runs every day? This is my n00b guess:

4)Can you explain what is the concept behind "moving ghost"? I searched the thread, I can't any meaningful explanation.
Thanks in advance
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
1) Almost. You do not need to have the action (SunTracker: "SunTracker") for sunrise/sunset events, those are created by the plugin itself. To make actions to generate events, you need to fill in at least one time for each daytype. If you only need events at sunset/sunrise, fill in 1100 for all 'Morning ON' settings
2) Ooops, try this script instead
3) To run anything a certain day or time, you need a scheduler plugin. Two examples are SchedulGhost and Scheduler. You can read about and find them here:
http://eventghost.net/forum/viewtopic.php?f=9&t=2740
http://eventghost.net/forum/viewtopic.p ... uler#p5067
(If you go for the Scheduler, instead of using the version in the post, download using my link below to be sure you get the latest)
You then simply put the script and the scheduler event in a macro. The script will be executed when the event triggers the macro.
4) The Moving Ghost is a special mode of operation for a SunTracker action. When activated, it will randomly generate On/Off events that can be used to control lamps etc in your home. The idea is to give strangers observing your home the impression that you are at home (even if you happen to be away). The time span between events are a bit longer BEFORE midnight and shorter AFTER midnight.
BR Walter
2) Ooops, try this script instead
Code: Select all
fc = eg.plugins.Suntracker.GetForecasts()
nc_p = int(fc[1]['night']['chance_precip'])
nf = fc[1]['night']['text']
dc_p = int(fc[1]['day']['chance_precip'])
df = fc[1]['day']['text']
print 'Forecast tomorrow night: ', nf
print 'Forecast tomorrow day: ', df
if nc_p <= 10:
eg.TriggerEvent(
'No rain tomorrow night',
payload = '',
prefix = 'WeatherForecast'
)
if nc_p > 10 and nc_p <= 20:
eg.TriggerEvent(
'Drizzle tomorrow night',
payload = '',
prefix = 'WeatherForecast'
)
if nc_p > 20 and nc_p <= 30:
eg.TriggerEvent(
'??? tomorrow night',
payload = '',
prefix = 'WeatherForecast'
)
if dc_p <= 10:
eg.TriggerEvent(
'No rain tomorrow day',
payload = '',
prefix = 'WeatherForecast'
)
if dc_p > 10 and nc_p <= 20:
eg.TriggerEvent(
'Drizzle tomorrow day',
payload = '',
prefix = 'WeatherForecast'
)
if dc_p > 20 and nc_p <= 30:
eg.TriggerEvent(
'??? tomorrow day',
payload = '',
prefix = 'WeatherForecast'
)
# etc, etc, etc, just add more rules for night & day
http://eventghost.net/forum/viewtopic.php?f=9&t=2740
http://eventghost.net/forum/viewtopic.p ... uler#p5067
(If you go for the Scheduler, instead of using the version in the post, download using my link below to be sure you get the latest)
You then simply put the script and the scheduler event in a macro. The script will be executed when the event triggers the macro.
4) The Moving Ghost is a special mode of operation for a SunTracker action. When activated, it will randomly generate On/Off events that can be used to control lamps etc in your home. The idea is to give strangers observing your home the impression that you are at home (even if you happen to be away). The time span between events are a bit longer BEFORE midnight and shorter AFTER midnight.
BR Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM