Regarding %c_m2hcm%

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Regarding %c_m2hcm%

#1 Post by chromo23 » 16 Oct 2022, 17:15

Right now the conversion converts 0 and 1440 to 00:00 which makes it difficult for me to use it in rules with my time slider:
Bildschirmfoto 2022-10-16 um 17.06.34.png
Bildschirmfoto 2022-10-16 um 17.06.34.png (12.15 KiB) Viewed 1546 times
a simple rule like that is not working when something is supposed to be on until 24h:

Code: Select all

On Clock#Time=All,**:** Do
    If %eventvalue2%>=%c_m2hcm%(any minute) and %eventvalue2%<=%c_m2hcm%(1440)
    	do something
   Else
       do something else
   Endif
Endon
In my opinion 0 minutes is not equal 1440 minutes and therefore the conversion should convert 1440 to 24:00
What do you think @tonhuisman....

Edit: on the other hand i understand, using 00:00 makes sense for a multiple of 1440..... hmmmmm maybe it shouldn’t be changed :D
Edit2: Question also could be: How can the code be changed to make it work with every setting? I am stumped right now...

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Regarding %c_m2hcm%

#2 Post by Ath » 16 Oct 2022, 17:40

chromo23 wrote: 16 Oct 2022, 17:15 Edit2: Question also could be: How can the code be changed to make it work with every setting? I am stumped right now...
Don't understand this question...?
/Ton (PayPal.me)

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Regarding %c_m2hcm%

#3 Post by chromo23 » 16 Oct 2022, 17:44

I am sorry.. i´m very good in writing before thinking :D
I found a workaround...just imagine you haven’t seen the last post. (i´ll delete it anyway)

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Regarding %c_m2hcm%

#4 Post by Ath » 16 Oct 2022, 17:46

chromo23 wrote: 16 Oct 2022, 17:15

Code: Select all

    If %eventvalue2%>=%c_m2hcm%(any minute) and %eventvalue2%<=%c_m2hcm%(1440)
That second condition, right side of 'and' will always be true.

For checking the current # of minutes there is %syssec_d%/60 :idea:
/Ton (PayPal.me)

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Regarding %c_m2hcm%

#5 Post by chromo23 » 16 Oct 2022, 17:55

Ath wrote: 16 Oct 2022, 17:46 For checking the current # of minutes there is %syssec_d%/60
Oh man... (imagine yourself a huge facepalm emoji here)... good that i asked! Of course, that’s a brilliant idea, thank you. There are so many possibilities in ESPeasy...

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 35 guests