Problem: temperature C/F rotational

Thanks.

1 Like

very good

1 Like


hi i need some help, i am seriously not good at math, as would be the tag for this look, help

You could try

$#WM#==F?(170-(clamp(#WCT#,32,104)*2.5)):(90-(clamp(#WCT#,0,30)*6))$

edit: Sorry the above expression has an error in the fahrenheit part, it should be

$#WM#==F?(196.66-(clamp(#WCT#,32,86)*3.333)):(90-(clamp(#WCT#,0,30)*6))$

teste
hi, what a complex code! seems to be right on my face, I will test during the week, because the temperature is bad to test! I only use degrees C, at the moment thank you very much for your help, I’m from Curitiba Pr, Brazil

1 Like

You are most welcome - hopefully it will work ok on your watch.

1 Like

Hi Mikeoday! By abusing your good will, you can recalculate the temperature from 0 to 40 degrees, because the coloration from 0 to 30 was strange, as the movement was great!

1 Like

I think this will work

$#WM#==F?(170-(clamp(#WCT#,32,104)*2.5)):(90-(clamp(#WCT#,0,40)*4.5))$
1 Like

muito bom, obrigado novamente, nota 10

1 Like

very good, thanks again, note 10

1 Like

Hi guys, I also take advantage, as on other occasions, to use your advice and formulas, thanks.

1 Like

hi mikeoday, it really just got better now! Is the math from 0 to 40 correct? If you don’t mind and have time without commitment, could you reveal how this math is done? because just looking can not understand how it does! would you like me to somehow repay this help?

1 Like

Well I think it is right. I walk you through it and that should confirm ( or otherwise :slight_smile: )

$#WM#==F?(170-(clamp(#WCT#,32,104)*2.5)):(90-(clamp(#WCT#,0,40)*4.5))$

If the watch/phone weather units are imperial ( ie. #WM#==F ) then the expression is

(170-(clamp(#WCT#,32,104)*2.5))

check:
#WCT# == 32 ( equivalent to 0C )
clamp(32,32,104) will return 32
32*2.5 = 80
170-80 = 90
So, when temp = 32, rotation = 90 degrees

#WCT# == 104 ( equivalent to 40C )
clamp(104,32,104) will return 104
104*2.5 = 260
170-260 = -90
So, when temp = 104, rotation = -90 degrees

If the watch/phone weather units are metric( ie. #WM# not = F ) then the expression is

(90-(clamp(#WCT#,0,40)*4.5))

check:
#WCT# == 0 ( equivalent to 32F )
clamp(0,0,40) will return 0
0*4.5 = 0
90-0 = 90
So, when temp = 0, rotation = 90 degrees

#WCT# == 40 ( equivalent to 104F )
clamp(40,0,40) will return 40
40*4.5 = 180
90-180 = -90
So, when temp = 40, rotation = -90 degrees

I hope that helps.

:slight_smile:

1 Like

very good! now I understand! super explanation, all right here, as soon as I finish revealing how it was and put your credits to the face, I’m very grateful for your help! :grinning:

1 Like

You are most welcome.

:slight_smile:

Hi! Do you know how to use these tags for Cº and Fº at the same time? I am using it in degrees Cº I would like it to work in both modes
$ # WCT # <= 10? 100: 0 $
$ # WCT # <= 19 && # WCT #> = 11? 100: 0 $
$ # WCT # <= 25 && # WCT #> = 20? 100: 0 $
$ # WCT # <= 30 && # WCT #> = 26? 100: 0 $
$ # WCT #> = 31? 100: 0 $

1 Like

No the results will be different for Celsius and Fahrenheit

You can use the following tag to test for which units are active on the user’s watch:

:wink::+1:t4: thanks

1 Like

I know this is an old thread by your maths, @mikeoday, helped me greatly so I would like to extend my thanks as well!

2 Likes

Thanks, are most welcome and I’m glad it helped!

:grinning: