mtatsuma / MMM-WeatherChart

Magic Mirror Module for displaying weather chart
MIT License
26 stars 8 forks source link

Show Rain not converting to imperial #15

Closed ankonaskiff17 closed 3 years ago

ankonaskiff17 commented 3 years ago

I have loaded MMM-WeatherChart in to my MM and set units to imperial. I'm in USA. Converts high and low temperatures as expected but not doing math to convert mm to inches.

mtatsuma commented 3 years ago

Hi

The units config param is simply passed to OpenWeather API. But OpenWeather API returns rain volume info with mm unit even when the units is specified as imperial.

Then, I added a new config param rainUnit with the latest commit to change the unit of rain volume.

If you want to change it to inch, clone the latest module and add "rainUnit": "inch" in your module config.

Please try it.

ankonaskiff17 commented 3 years ago

That worked perfectly.

I tried to figure out how to contact you directly about that so put in problem report.

This was driven by person managing MagicMirror forum telling me not to edit the module file directly but to put all modifications in config.js file. I am not a programmer but I can sort of read and understand code.

I was looking at code and it seems like the minimum temperature are configured so that the minimum and maximum temperatures don’t overlap. I can easily be wrong about that.

It seems like the rain volume scale (bottom line vertical axis) is too narrow so a small amount makes a significant trend. Is there a way to scale that to prevent it being such a big hump it seems like it is impacting the minimum and maximum temperatures causing them to overlap.

See attached jpg file.

From: tatsuma notifications@github.com Sent: Saturday, December 12, 2020 9:39 AM To: mtatsuma/MMM-WeatherChart MMM-WeatherChart@noreply.github.com Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com Subject: Re: [mtatsuma/MMM-WeatherChart] Show Rain not converting to imperial (#15)

Hi

The units config param is simply passed to OpenWeather API. But OpenWeather API returns rain volume info with mm unit even when the units is specified as imperial.

Then, I added a new config param rainUnit with the latest commit https://github.com/mtatsuma/MMM-WeatherChart/commit/a730676198b2c27207d3fb4b58351b9769bacb1d to change the unit of rain volume.

If you want to change it to inch, clone the latest module and add "rainUnit": "inch" in your module config.

Please try it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtatsuma/MMM-WeatherChart/issues/15#issuecomment-743765469 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMT3ATPZTFYFDOQEUDLDAWTSUN6CBANCNFSM4UXMDBIQ . https://github.com/notifications/beacon/AMT3ATJY65IOZBYKF4UV7S3SUN6CBA5CNFSM4UXMDBI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFRKPLXI.gif

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

mtatsuma commented 3 years ago

See attached jpg file.

I cannot find the jpg file. Could you attach it directly to this issue page?

ankonaskiff17 commented 3 years ago

No problem InkedWeatherChart_LI

mtatsuma commented 3 years ago

Thank you for sharing the problem.

I added two changes to solve the problem. https://github.com/mtatsuma/MMM-WeatherChart/pull/17 https://github.com/mtatsuma/MMM-WeatherChart/pull/18

To avoid the significant trend by the small amount rain, you can add a new param rainMinHeight and set it as a value that you think it is significant. For example, if you think 0.1 inches of rain is significant, you should set rainMinHeight as 0.1.

Please clone the latest version of module and try it.

ankonaskiff17 commented 3 years ago

That works great. Thank you.

I think I understand the minRainHeight but what I was wondering about would be more of maxRainHeight config option. minRainHeight would always = zero.

But maxRainHeight would be a config option.

That would be determined by individuals location. If you are auto scaling everything that won’t work but if you are only auto scaling the high and low temperatures it might.

Tokyo maxRainHeight = X

Columbia, SC USA maxRainHeight = Y (<---My location)

Singapore maxRainHeight = Z

From: tatsuma notifications@github.com Sent: Wednesday, December 16, 2020 9:02 AM To: mtatsuma/MMM-WeatherChart MMM-WeatherChart@noreply.github.com Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com Subject: Re: [mtatsuma/MMM-WeatherChart] Show Rain not converting to imperial (#15)

Thank you for sharing the problem.

I added two changes to solve the problem.

17 https://github.com/mtatsuma/MMM-WeatherChart/pull/17

18 https://github.com/mtatsuma/MMM-WeatherChart/pull/18

To avoid the significant trend by the small amount rain, you can add a new param rainMinHeight and set it as a value that you think it is significant. For example, if you think 0.1 inches of rain is significant, you should set rainMinHeight as 0.1.

Please clone the latest version of module and try it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtatsuma/MMM-WeatherChart/issues/15#issuecomment-746333117 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMT3ATO7VKXKEIELRBTP2TDSVC4WHANCNFSM4UXMDBIQ . https://github.com/notifications/beacon/AMT3ATK6FN5MVOHLNOIREULSVC4WHA5CNFSM4UXMDBI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFR6CHPI.gif

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

mtatsuma commented 3 years ago

I think I understand the minRainHeight but what I was wondering about would be more of maxRainHeight config option. minRainHeight would always = zero.

I'm sorry for the confusion. rainMinHeight means minimum height of the rain volume (y-axis) in chart. So, it's the minimum rather than maximum. See this picture. image

That would be determined by individuals location. If you are auto scaling everything that won’t work but if you are only auto scaling the high and low temperatures it might.

It's almost impossible for me because there are many many places in the world and it's also difficult to get the place name from the latitude and longitude specified in config. In my opinion, the adequate value of rainMinHeight depends on people rather than the location. So, it's enough to make it configurable.

ankonaskiff17 commented 3 years ago

What I was trying to say was to let the maxRainHeight be configurable.

Here in South Carolina the maximum normal daily rain is probably less than 1 inches. So I would put in a value of 1 inches.

A tropical rainforest country might see a daily maximum rainfall of 3 inches so that person would put in a value of 3 inches or equivalent mm number. I didn’t mean to imply plugging in values for every location.

Where you live has some daily rainfall average value. It is probably different than the value of where I live. That is all I was asking about.

But Thank you for what you have done it helps a bunch.

From: tatsuma notifications@github.com Sent: Thursday, December 17, 2020 7:01 AM To: mtatsuma/MMM-WeatherChart MMM-WeatherChart@noreply.github.com Cc: ankonaskiff17 ankonaskiff17@twc.com; Author author@noreply.github.com Subject: Re: [mtatsuma/MMM-WeatherChart] Show Rain not converting to imperial (#15)

I think I understand the minRainHeight but what I was wondering about would be more of maxRainHeight config option. minRainHeight would always = zero.

I'm sorry for the confusion. rainMinHeight means minimum height of the rain volume (y-axis) in chart. So, it's the minimum rather than maximum. See this picture. https://user-images.githubusercontent.com/48573325/102484235-4c60e000-40a9-11eb-8806-42029326b877.png

That would be determined by individuals location. If you are auto scaling everything that won’t work but if you are only auto scaling the high and low temperatures it might.

It's almost impossible for me because there are many many places in the world and it's also difficult to get the place name from the latitude and longitude specified in config. In my opinion, the adequate value of rainMinHeight depends on people rather than the location. So, it's enough to make it configurable.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtatsuma/MMM-WeatherChart/issues/15#issuecomment-747397644 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMT3ATK3URKGC23R2QE43VLSVHXI3ANCNFSM4UXMDBIQ . https://github.com/notifications/beacon/AMT3ATPEM3MYUWACKQ6WHMLSVHXI3A5CNFSM4UXMDBI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFSGGEDA.gif

-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

mtatsuma commented 3 years ago

What I was trying to say was to let the maxRainHeight be configurable.

You mean you want to fix the y-axis scale to a configured value? Actually, fixing the maximum height of rain volume to a value is not simple because there are temperature charts above the rain volume charts.

Anyway, this may be another requests that is not related to this issue. If you have another problem or feature requests, please open a new issue with a appropriate title. It's very helpful to clearly describe the problem with a screenshot!