I am able to display {wss} correctly on the watch, but when I do string.sub({wss},1,20) I get COMPLICATION.5452.TI. The formula works in Studio, just not on the watch itself (Pixel Watch 4).
The same happens when using
string.sub(β{wl}β, 1, 12)
(Xiaomi watch 5)
{wss} is suset time e.g.: 18:30 β¦ i think you want to parse first 20 characters from weather description instead of time?
No, I want sunset/sunrise times so I can calculate percent of 24 hours since we no longer have wsrp/wssp on wff.
1,20 gives you first 20 chars. i donβt understand right now what you plan to do with e.g. 05:45 and 18:30
you want a value from 0β100% showing how far the current time is between sunrise and sunset ?
This formula works in Studio but not on WFF watchface.
(tonumber(string.sub({wsr},1,2)) * 3600 + tonumber(string.sub({wsr},4,5)) * 60) / 86400
If we had tags for integer values of Sunrise Hour {wsrh}, Sunrise Minute {wsrm}, Sunset Hour {wssh} and Sunset Minute {wssm} then the formulas below might work
Sunrise % of day:
({wsrh} * 3600 + {wsrm} * 60) / 86400
Sunset % of day:
({wssh} * 3600 + {wssm} * 60) / 86400
is daytime as a clean conditional:
{dh23i} * 3600 + {dm} * 60 + {ds} >= {wsrh} * 3600 + {wsrm} * 60 and {dh23i} * 3600 + {dm} * 60 + {ds} < {wssh} * 3600 + {wssm} * 60 and 100 or 0
Exactly. Which took me forever to track down that {wss} and {wsr} work fine by themselves but have different values when you use them in a function.
Im sure WM support will let us know whats possible. Whats your use case for needing it? More justification may make it happen sooner?
I want it to change weather icons at sunset and sunrise.
Also change some images and some cloros.
its hard to fix substring for complication fields
so i think better if i add back wsrp/wssp
hopefully next week in android update
Please let us know when the can be used again . I for one am very excited . It will steal a March on the other Platforms for sure .
