[wind0dir-act]

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

Post Reply
User avatar
ConligWX
Gold Boarder
Gold Boarder
Posts: 194
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

[wind0dir-act]

Post by ConligWX » Fri Feb 01, 2019 9:26 pm

Boris

Why does Template [wind0dir-act] add a decimal place? Degrees in Wind are measured in whole numbers, "integers" and should not have a .0 after them.

I've tested this on a Twitter post and a text template, both added .0 after the value.

Can this be fixed at source?

User avatar
Ag2000CO
Expert Boarder
Expert Boarder
Posts: 102
Joined: Wed Jul 05, 2017 5:22 pm
Location: CO, USA
Contact:

Re: [wind0dir-act]

Post by Ag2000CO » Sun Feb 03, 2019 12:57 am

Looking at https://www.meteobridge.com/wiki/index.php/Templates
I see
Decimals
Unless otherwise defined numbers are reported with one decimal.
Doing a search of that page I did not see any where that wind0dir-act format was redefined.

Why not change the request to [wind0dir-act.0] That will report a whole number.
Lou
Say what you will about Sisyphus. He always has work.

User avatar
ConligWX
Gold Boarder
Gold Boarder
Posts: 194
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

Re: [wind0dir-act]

Post by ConligWX » Sun Feb 03, 2019 2:03 am

Yes I should be able to, but I am asking why is it not a integer already.

User avatar
Ag2000CO
Expert Boarder
Expert Boarder
Posts: 102
Joined: Wed Jul 05, 2017 5:22 pm
Location: CO, USA
Contact:

Re: [wind0dir-act]

Post by Ag2000CO » Sun Feb 03, 2019 3:04 am

From a "programmer's" point of view I think it is much better if all the numbers are available/presented in the same format. That way you (the user) do not have to remember which are real, which are integer, which are text strings or binary. JMHO

To change the format now would/could have unforeseen consequences for an unknown number of user applications.

As for why wind0dir was set up as a real number in the beginning(?) Just guessing but it would make sense to use a single common subroutine to convert an analog sensor signal to a real number in stead of having two procedures or an added step to round to an integer. This is especially true when the user interface already has the capability to format the requested data. When building an embedded system like MB, every byte of space is important; an extra step here, a byte there can add up to it does not fit or it runs to slow...
Lou
Say what you will about Sisyphus. He always has work.

User avatar
ConligWX
Gold Boarder
Gold Boarder
Posts: 194
Joined: Wed Nov 14, 2018 12:48 pm
Location: Conlig, Co. Down, UK
Contact:

Re: [wind0dir-act]

Post by ConligWX » Sun Feb 03, 2019 11:08 am

To change the format would be the correct thing to do so that Meteobridge reports the same as the rest of the world.

No weather report shows 0.0-360.0 degrees in wind direction.

It's just typically wrong show this value when reporting weather values.

Mattk
Platinum Boarder
Platinum Boarder
Posts: 738
Joined: Mon Sep 22, 2014 3:24 am

Re: [wind0dir-act]

Post by Mattk » Sun Feb 03, 2019 12:22 pm

Starting to really split hairs here, appears to be concern over something that is not a real issue with a mechanism to give the user the output they require. Time to move on to something that is really important and may require fixing.

User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 5785
Joined: Mon Oct 01, 2007 10:51 pm

Re: [wind0dir-act]

Post by admin » Sun Feb 03, 2019 3:47 pm

[wind0dir-act.0] will show what you are looking for.

Post Reply