Author Topic: What Synthetic Channels are you using?  (Read 13616 times)

xairbusdriver

  • Storm
  • *****
  • Posts: 3131
What Synthetic Channels are you using?
« on: January 04, 2016, 07:51:56 PM »
I may have missed posts here, but I see only a very few about specific Synthetic Channel usage. The Manual seems to say Apple Scripting is needed or useful, while posts here say it's not; 'actions' can be entered directly into the Channel creation dialog.

Basically, I'm just interested in what useful additional data can or is being generated from Stu's very powerful program. [tup]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6706
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Using a bunch! (Re: What Synthetic Channels are you using?)
« Reply #1 on: January 04, 2016, 11:20:51 PM »
Dear X-Air and WeatherCat data infomaniacs, . . .

I may have missed posts here, but I see only a very few about specific Synthetic Channel usage.

I think one of the reasons that synthetic channels haven't gotten as much attention is that some of the initial development was when WeatherCat 2.0 was in private beta.

I have all 5 channels used for the following data:

  • Blancy-Criddle ET
  • Difference from normal rainfall
  • Weekly Wind Run
  • WeatherCat Memory use (requires WC Status Growler running and a flag enabled.)
  • Outdoor Cooling Potential

I've made a collection of AppleScript synthetic channels that you can download at this Dropbox link:

https://www.dropbox.com/s/bcz9t2eff12i9ek/Sample%20Synthetic%20Channels%202016-01-04.zip?dl=0

They aren't all mine.  Included is Randall's Internal Heat Index.  Two of them even has some documentation.  Between this and the WeatherCat manual, you should be able to get your feet wet!

Cheers, Edouard  [cheers1]

P.S. I didn't include the WeatherCat memory script since it is rather involved to make work.

xairbusdriver

  • Storm
  • *****
  • Posts: 3131
Re: What Synthetic Channels are you using?
« Reply #2 on: January 04, 2016, 11:32:56 PM »
Thanks, Edouard. Anyone else doing other things?
No problem getting my feet wet around here. I just need to walk a few miles toward the nearest flooding river!
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

Blicj11

  • Storm
  • *****
  • Posts: 4088
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Sonoma 14.8.7 | WeatherCat 3.3.3 | Supportive Wife
Re: What Synthetic Channels are you using?
« Reply #3 on: January 05, 2016, 03:54:13 AM »
  • Outdoor Cooling Potential
  • Indoor Heating Potential
  • Daily Wind Run
Blick


Bull Winkus

  • Storm
  • *****
  • Posts: 783
  • 2013 iMac 2 x 27", OS Ver. 10.15.7
    • EW0095
    • KARHORSE2
    • WU for Horseshoe Bend, Arkansas
  • Station Details: Davis Wireless Vantage Pro 2, iMac 2 x 27"
Re: What Synthetic Channels are you using?
« Reply #4 on: January 05, 2016, 06:35:55 PM »
I'm just doing a simple plot of difference between indoor and outdoor temperature.

 [cheers1]
Herb

Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: What Synthetic Channels are you using?
« Reply #5 on: January 05, 2016, 09:18:20 PM »
I'm running 24 here
 you can see them @ http://randysweatheronthehill.com/customgauges.html


cheers


 [cheers1]

Blicj11

  • Storm
  • *****
  • Posts: 4088
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Sonoma 14.8.7 | WeatherCat 3.3.3 | Supportive Wife
Re: What Synthetic Channels are you using?
« Reply #6 on: January 06, 2016, 02:00:44 AM »
I'm running 24 here

Ha ha, Randy. You can't be running 24 since there are only 5 to start with. You are talking about custom gauges, not synthetic channels.
Blick


Blicj11

  • Storm
  • *****
  • Posts: 4088
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Sonoma 14.8.7 | WeatherCat 3.3.3 | Supportive Wife
Re: What Synthetic Channels are you using?
« Reply #7 on: January 06, 2016, 02:02:12 AM »
I'm just doing a simple plot of difference between indoor and outdoor temperature.
Herb:

I am wasting two channels to do what you are doing in one. Would you mind posting (or PMing me) your Apple Script?
Blick


xairbusdriver

  • Storm
  • *****
  • Posts: 3131
Re: What Synthetic Channels are you using?
« Reply #8 on: January 06, 2016, 03:03:23 AM »
Bull, please post here so others can see them in a search. And post them whether they are AppleScripts or not. From what I've found here, some don't need Apple Scripting, at all, you simply use what WC provides.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: What Synthetic Channels are you using?
« Reply #9 on: January 06, 2016, 11:05:14 PM »
your right Blicj
 had a dumb ass attack
 running all five though


cheers


 [cheers1]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6706
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
All use AppleScript (Re: What Synthetic Channels are you using?)
« Reply #10 on: January 06, 2016, 11:34:56 PM »
Dear X-Air, Herb, Randall, Blick, and WeatherCat scripters,

I'm just doing a simple plot of difference between indoor and outdoor temperature.

I am wasting two channels to do what you are doing in one. Would you mind posting (or PMing me) your Apple Script?

I'm not sure I understand how you could use two AppleScripts to do that.  It is as simple as can be.  Here is my version and it has the "super-deluxe" feature of returning zero when the exterior temperature is hotter than inside (since I use it to decide whether to open the windows or not.)

Code: [Select]
-- Script: Outdoor cooling potential.scpt
-- -------------------------------------------------------------------------------------------------------------------
-- This AppleScript is designed to be loaded into WeatherCat synthetic channel feature to
-- continuously compute the difference between the exterior and interior temperature so monitor
-- when cooling an interior space can be cooled by opening the windows.  When it is hotter outside
-- than inside, it returns zero.
--
-- Requires that the Param1 be set to the external temperature and Param2 set to internal
-- temperature
--
-- DISCLAIMER: This AppleScript and associated supporting materials is not subject to copyright
-- protection and has been put into the Public Domain as a public service.  The author assumes
-- no responsibility whatsoever for use by other parties of its source code, documentation or other
-- materials, and makes no guarantees, expressed or implied, about its quality, reliability, or any other
-- characteristics. Any user assumes all risk and liability by attempting to use these materials in any
-- form whatsoever.
--
-- -------------------------------------------------------------------------------------------------------------------

set ExteriorT to Param1 -- Convert parameters into names that make code easier to read.
set InteriorT to Param2

if (ExteriorT ≥ InteriorT) then -- If it is hotter outside than inside, no way to cool the interior
return (0) -- Return 0 in those cases.
else -- Otherwise return the difference between in the interior and exterior temperature
return (InteriorT - ExteriorT)
end if

Even with my gabby coding it is only 7 lines of actual AppleScript.

In the little package I put on dropbox, this AppleScript has some companion AppleScripts that put up Growl notifications when it is time to open or close the windows.  That's just an extra convenience if you want an alert on the screen to tell you it is time to run around the house and open or close everything.

Post them whether they are AppleScripts or not. From what I've found here, some don't need Apple Scripting, at all, you simply use what WC provides.

Actually this isn't true.  Synthetic channels always use the Apple built-in AppleScript interpreter.  That allowed Stu to avoid reinventing the wheel with a new language to handle the usual "if then" and other things you would want to do with a synthetic channel.  AppleScript is very english-like so it may appear to be something other than programming, but in fact it is always AppleScript.

Cheers, Edouard  [cheers1]

xairbusdriver

  • Storm
  • *****
  • Posts: 3131
Re: What Synthetic Channels are you using?
« Reply #11 on: January 07, 2016, 04:27:04 PM »
Quote
Synthetic channels always use the Apple built-in AppleScript interpreter.
My bad. [banghead] The Manual does describe how to use AppleScript. I miss understood Stu's comments in this thread. The "code" he mentions in post #2 is actually AS. The "Query" part made me think of SQL and I proceeded down the 'rabbit hole' from there. [rolleyes2] I should have recognized "set" as an AS 'verb'(?). I assume "Query" is an AS keyword?

If AS is the only way to create Synthetic Channels, so be it, hopefully this thread will at least be a collection of applications for those searching for uses.
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

xairbusdriver

  • Storm
  • *****
  • Posts: 3131
Re: What Synthetic Channels are you using?
« Reply #12 on: January 07, 2016, 08:57:30 PM »
I discovered that I actually had one Synthetic Channel. It was used to compute/store the Lowest Daily Wind Chill value. It was then used on the "Wind Chill" Custom Gauge. For some reason, I never noticed that Stu already provides a "Main Pointer Daily High/Low/Average" option in the list of items to select for any pointer. Apparently, even though it is labeled "Main Pointer" it can be used for any of the four available pointers/bugs. Not sure what it would do if there were two other, non-related items being displayed, but I think he designed WC to always use the first (Main?) pointer weather data. So one could have Temperature, Wind Chill, Heat Index pointers and still display the daily high/low/average Temperature, even if that was pointer/bug number four.

I simply changed that gauge to use the built-in low daily Wind Chill. I assume that there may be a o.000001 speed difference in creating the gauge, since the value is already being provided by Davis rather than needing to be computed by WC. [goofy]
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 3025
    • CW9739
    • IIBSTO2
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, extra temp stations, no U.V. WeatherLinkLive.
Re: What Synthetic Channels are you using?
« Reply #13 on: January 10, 2016, 11:26:34 AM »
A little background may be interesting:
Synthetic channels came about because there were occasionally requests for derived types being added that always follow the same theme - take some existing data, apply a function to it to create the derived type then making it available.

This is the primary use for the synthetic channels - up to 5 existing channels can be input, a function is applied to that data and the results then recorded. As they are an integrated channel, everything you can do with a normal channel you can do with a synthetic channel - custom graphs, gauges, alerts and STAT$ tag queries etc.

Normally I'd have embedded something like a Lua interpreter to do this BUT, although it's an easy enough language to understand, it's still quite complicated, especially for people who aren't programmers. After searching for a bit it dawned on me that, as we're on the Mac, and it already has a scripting language which has plenty of examples and documentation available, that's a candidate. Then it dawned on me that if we did use Apple Script, it would have access to WeatherCat's Apple Script interface internally, expanding its capabilities quite considerably. (See Appendix 1 in the manual for details of the interface).

So, synthetic channels can be used in the following ways:
1. Take data from existing channels, process it to a new derived type. The data from each input channel can be the current value, daily high, low or average.
2. Interact with the WeatherCat's Apple Script interface to pull out other data - for example to perform a query - as we've just seen with wind run.
3. Pull in external data to a channel (for example from the web/external device).
4. Used as a glorified custom alert - in this case you're just providing the logic of the alert where it needs to be more complicated than what can be done with a custom alert.
And combinations of the above.

Going forward, there are some things that can be added in the future - for example at the moment there are no persistent variables, so you can't store data across runs - you have to store the data yourself (in a file for example).
Secondly, if one is being used purely as a custom alert, it must still be enabled which means the data will be recorded (it's probably pointless).
Thirdly, it looks like we could use a few more.

The reason there are 5 is that at the time it wasn't known what the processing load would be like - it appears it isn't a problem, especially since the move to make the maximum processing rate once per minute (they were originally processed on every sample).

Finally, more information and notes can be found on page 56 of the current manual.

[Edit: There's also no way of setting a channel invalid at the moment - for example if you're pulling in say some astronomical data from a web site, and the web-site goes down, you can't set your channel invalid].

Blicj11

  • Storm
  • *****
  • Posts: 4088
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Sonoma 14.8.7 | WeatherCat 3.3.3 | Supportive Wife
Re: What Synthetic Channels are you using?
« Reply #14 on: January 10, 2016, 03:30:37 PM »
Thanks for taking the time to explain the background of synthetic channels. I hope you will consider adding your post in some form to a future version of the manual.
Blick