Author Topic: Custom Graph reporting °C instead of °F  (Read 2033 times)

Blicj11

  • Storm
  • *****
  • Posts: 4061
    • 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.3 | WeatherCat 3.3 | Supportive Wife
Custom Graph reporting °C instead of °F
« on: June 26, 2024, 03:35:34 PM »
I have one Custom Graph that displays the results in °C, whilst all other Custom Graphs report in °F. This graph uses a Synthetic Channel.

Here is my script:
Code: [Select]
-- Script: Outside 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

Although the Status of the Sythnetic Channel returns a number that says it is °F it is actually displaying the result in °C.

See the attached screenshot, which shows the current value= 15.6°F. It should be displaying 60.1°F. 15.6 is the Centigrade value.

All other custom graphs using Synthetic Channel or otherwise display correctly in °F.

Any suggestions will be appreciated.
Blick


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6661
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Is it always off? (Re: Custom Graph reporting °C instead of °F)
« Reply #1 on: June 26, 2024, 11:04:26 PM »
Dear Blick and WeatherCat scripters,

I have one Custom Graph that displays the results in °C, whilst all other Custom Graphs report in °F. This graph uses a Synthetic Channel.

. . . . .

Although the Status of the Sythnetic Channel returns a number that says it is °F it is actually displaying the result in °C.

See the attached screenshot, which shows the current value= 15.6°F. It should be displaying 60.1°F. 15.6 is the Centigrade value.

Are you always seeing the value displayed in Centigrade?  I'm running exactly the same script and it is working fine for me.

Cheers, Edouard

Blicj11

  • Storm
  • *****
  • Posts: 4061
    • 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.3 | WeatherCat 3.3 | Supportive Wife
Re: Custom Graph reporting °C instead of °F
« Reply #2 on: June 26, 2024, 11:57:41 PM »
Yes. Always. I went back to WC 3.2 and it happened there, so it is not unique to 3.3. I am baffled because I have other scripts that return °F, but this one does not.
Blick


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6661
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Dear Blick and WeatherCat scripters,

Yes. Always. I went back to WC 3.2 and it happened there, so it is not unique to 3.3. I am baffled because I have other scripts that return °F, but this one does not.

Okay, I'll second the "I'm baffled" motion.  Do you graph this value?  My graph does exactly what it should.  When the outside it hotter than the inside the value goes to zero as it should.  When you can cool with the outside air, it shows the value.  At least around here, the value is never more than a few degrees because even the nighttime temperatures are close to the indoor temperatures.  Here is today's graph to this moment:



Overnight it got unusually cold for June, so we had a cooling potential of almost 20° F.  As the sun rose, it quickly started dropping until it reached zero.

Are you seeing anything like this?

Edouard

Blicj11

  • Storm
  • *****
  • Posts: 4061
    • 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.3 | WeatherCat 3.3 | Supportive Wife
Re: Custom Graph reporting °C instead of °F
« Reply #4 on: June 29, 2024, 04:05:40 PM »
Thank you for sharing your graph and comment. It help me figure it out. There is nothing wrong with how WC is reporting my script. I thought the graph would display the actual outside temperature, but thanks to your explanation, I now understand it is reporting the cooling potential and so what I thought was °C of the outside temperature is actually °F of the cooling potential. Hence the name, Cooling Potential. Hahaha. I am so dense sometimes it amazes me. When I created that script, I knew exactly what it did, but somehow over the years I forgot. Edouard, thanks for once again showing me the light.
Blick


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6661
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Glad it is resolved. (Re: Custom Graph reporting °C instead of °F)
« Reply #5 on: June 29, 2024, 09:22:45 PM »
Dear Blick and WeatherCat scripters,

Thank you for sharing your graph and comment. It help me figure it out. There is nothing wrong with how WC is reporting my script. I thought the graph would display the actual outside temperature, but thanks to your explanation, I now understand it is reporting the cooling potential and so what I thought was °C of the outside temperature is actually °F of the cooling potential. Hence the name, Cooling Potential. Hahaha.

I'm glad you got that straightened out!

I am so dense sometimes it amazes me. When I created that script, I knew exactly what it did, but somehow over the years I forgot. Edouard, thanks for once again showing me the light.

It could just in time too!  It appears we are headed for an unusually hot summer.  You might need to monitor the exterior cooling potential to remain comfortable.

Unfortunately for the folks in California, it appears we are headed toward a period where that script will be useless.  The forecast overnight lows for next week are so high that it might not be possible to cool the house with anything but the central air.   [sweat2]

Fortunately for our household, we just has our A/C unit serviced.  So it should be up to task of running all that time if need be.

Edouard