Author Topic: Developing a Weather Plugin, videos  (Read 102556 times)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #30 on: August 05, 2013, 03:52:11 am »
An update in screenshots and small video snippets.

I am still working on the Orbiter facing stuff, and working around some of the interesting pitfalls that can happen when you try to push a LOT of data to orbiter screens.

A series of workshop videos are coming, but I still need to work out some of the bugs, before I can do this. But for now:

Forecast


3-day:
https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-ash3/1090993_10151485919357115_144248390_o.jpg
https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-prn2/976455_10151485919362115_11081090_o.jpg

6-day forecast:



Radar View:
http://www.youtube.com/watch?v=Bs1lHGGyAMY <-- UI2 TV
http://www.youtube.com/watch?v=T3O19SpmrI0 <-- UI1 Archos Tablet
http://www.youtube.com/watch?v=mO3U69uurIo <-- UI1 Joggler

Enjoy, more knowledge coming.
-Thom

coley

  • Guru
  • ****
  • Posts: 492
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #31 on: August 06, 2013, 06:55:36 pm »
 8) Great stuff there.

-Coley.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #32 on: August 15, 2013, 12:01:16 am »
Did a quick preview, now that I have tied together the UI.

Note that the current weather icon is displayed on the main page. This is updated when the weather data changes.

Enjoy,
http://www.youtube.com/watch?v=ofw-yYRRbts

-Thom

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #33 on: August 18, 2013, 02:51:12 am »
For those who are curious, yes, another video will be coming, with all the errata, addendums, etc, that I had bumped into while developing the Weather Plugin.

I can't record it yet, because I have not had an opportunity to do so. My wife is in mother mode, and has permanently camped herself in the living room, which is adjacent to the kitchen, which is adjacent to the den, where I work; there are no doors in between, so everything bleeds through. I do not have a studio, like I once had to do the voiceovers, so I am having to wait until the house is quiet enough, and there isn't a risk of a baby waking up, so I can do the next video.

Until then, the Weather Plugin has been checked into the repository, the events it intercepts are considered frozen, as are the various variable names it expects, so this can be used by others to create a weather device to populate the weather plugin.

You can see an example of how to use MessageSend to emit the appropriate events inside the source tree:

http://svn.linuxmce.org/trac.cgi/browser/trunk/src/Weather/weather-test.sh

If somebody wants to take a stab at implementing the Weather c++ device, then go for it.

-Thom

p.s. yes, the Value parameters are full integers. I see NO point in decimal points for weather values, none. If someone can convince me of a valid reason to use floating point values, I will change this.

p.p.s. in the weather-test.sh, yes the event passed is event 91, which is a outside temperature change. This should be changed on each line for each relevant piece of data, (temperature for temperature events, humidity for humidity events etc..) this works because (1) the weather events ALL use the same parameters, and (2) all of the weather data goes into the same map, but for the sake of properly intercepting events, please use the correct PK_Event numbers.

« Last Edit: August 18, 2013, 02:53:20 am by tschak909 »

Hackit2me

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #34 on: August 21, 2013, 05:21:31 am »
If a picture says a thousand words, a video says TWO thousand.

The videos is what got me interested in MCE in the first place.  Reading documentation is one thing, seeing it in action is another.  I agree, keep making them even if we don't watch them for a bit.

mkbrown69

  • Guru
  • ****
  • Posts: 213
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #35 on: August 24, 2013, 05:08:06 pm »
p.s. yes, the Value parameters are full integers. I see NO point in decimal points for weather values, none. If someone can convince me of a valid reason to use floating point values, I will change this.
Thom,

I've been mulling this over for a bit.  Something to consider is that some other sources of weather/temperature data return floating point data (WeatherBug, Environment Canada, Davis/Oregon weather stations, thermostat API's, 1-Wire, etc).  To take the weather plugin to the next level, we'll need to do something with that data.  That usually means doing comparisons...

Pseudo-event code criteria
Code: [Select]
If $outside_temp < $inside_temp and $outside_temp > 0 then
   Disable A/C unit
   enable external air baffle and whole house fan
End

So, if the weather plugin uses integers, all other drivers will have to do type conversions.  Fahrenheit to Celcius conversions (and vice versa) would also need to be rounded to the nearest integer.  So, that may complicate all the drivers that have to interact with the weather plugin.

Just something to consider...

/Mike

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #36 on: August 24, 2013, 06:53:37 pm »
You're overthinking this. ;)

The Weather Plugin does not know or understand that there are weather devices out there, nor that it even cares.

I saw no reason whatsoever to futz over a point degree difference, when it comes to the outside weather, because depending on where you are outside, this can fluctuate a lot. It simply does not matter.

The different weather APIs return textual data as strings. WE HAVE TO DO A TYPE CONVERSION, ANYWAY as part of the parsing process. :) (This is something that all you guys who write scripting languages all day, don't have to deal with, with your language magically converting everything).

The REASON that the integer values are here anyway, is precisely for the case you outline below, it's so that you can match things in event criteria. The weather plugin expects BOTH the integer values and the textual values to be returned as part of the event.

As for F to C conversions, this is something that is being decided, e.g. to put the F/C in device data, and have the weather devices read this (The weather plugin does not care, it's just a cubby hole), it's up to the weather devices to do the necessary conversions.

-Thom

mkbrown69

  • Guru
  • ****
  • Posts: 213
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #37 on: August 25, 2013, 04:54:27 am »
You're overthinking this. ;)
Bad habit from work... I'm busy writing techical architecture design specifications where the overarching reference architecture docs the enterprise types are supposed to have gotten to us, haven't been written yet... Lots o fun  :P

The different weather APIs return textual data as strings. WE HAVE TO DO A TYPE CONVERSION, ANYWAY as part of the parsing process. :) (This is something that all you guys who write scripting languages all day, don't have to deal with, with your language magically converting everything).

The REASON that the integer values are here anyway, is precisely for the case you outline below, it's so that you can match things in event criteria. The weather plugin expects BOTH the integer values and the textual values to be returned as part of the event.

As for F to C conversions, this is something that is being decided, e.g. to put the F/C in device data, and have the weather devices read this (The weather plugin does not care, it's just a cubby hole), it's up to the weather devices to do the necessary conversions.

Fair enough... I'll kick the tires on it when I get the ISY driver out in the wild.  My plans are to get the CT-80 driver out in the next couple of weeks, the first cut ISY driver out in late September/early October, and then upgrade to 12.04 to work on a bunch of things, including integrating with the weather plugin for the ISY driver and the CT-80.

Thanks for the excellent summary on how the plugin works.  It'll give me a lot to think about over the next little while.

/Mike

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #38 on: August 25, 2013, 07:11:00 am »
If you want to see the code, it's here:

http://svn.linuxmce.org/trac.cgi/browser/trunk/src/Weather_PlugIn

:)

-Thom

cfernandes

  • Guru
  • ****
  • Posts: 359
    • View Profile
    • my company web site
Re: Developing a Weather Plugin, videos
« Reply #39 on: July 08, 2014, 04:26:24 pm »
Hi Thom

i try this on 12.04  and 10.04

on 10.04  is working  but on 12.04  not .

i checked the templates and are completely different.



tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #40 on: July 08, 2014, 10:45:33 pm »
Very surprised as I did not write the code for 10.04, but for 12.04, and it needs to be compiled, anyway.. The Plugin is there, however, the DEVICE that emits the events needs to be written.

-Thom

cfernandes

  • Guru
  • ****
  • Posts: 359
    • View Profile
    • my company web site
Re: Developing a Weather Plugin, videos
« Reply #41 on: July 13, 2014, 06:12:34 pm »
HI Thom

for my test  i write  a php script  that grab info  from worldweatheronline

and the condicon  is changing  but other  values not !



darkwizard864

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #42 on: December 10, 2014, 07:29:43 am »
cf
I couldn't get your test script to work at all.
could I get your help making one for weather.com based

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #43 on: December 10, 2014, 02:47:30 pm »
Portions of the weather plugin were missing from the binary releases up until about 8 weeks ago.  Some changes may have occurred during that addition.  All missing graphics should now be available and all items *should* update based on Thom's initial test script.

J.

bherbie

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Re: Developing a Weather Plugin, videos
« Reply #44 on: December 10, 2014, 10:00:40 pm »
Quote
I couldn't get your test script to work at all.
could I get your help making one for weather.com based

This is not my script but I did try it out and made some improvements to it as it did not work for me as listed.  First, if you aren't running the script from /var/www/lmce-admin directory, you will need to change the required file path to find the included file.  Also, if your city name has a space in it, like my city does and many others (i.e. San Antonoio, Las Vegas, etc.) you will need to urlencode the city name returned from the database query or the script fails.

Other then that, the script works fine in my testing...

HTH,
herb