Much appreciated. That made it look simple.
Thanks so much
Hi, i came here after looking for somting simular, When using this code all work correct exept if my start hour is before midnight and my end hour after midnight it wont let my messeges thrue.
Fof exemple if i want to let thrue after 23:30 and before 01:00. Is there something i do wrong?
I only changed the input_datetime entity id’s.
It’s just the way the functions written. It will not work across midnight. With the start being later in the day and the end of being early in the morning. You would have to change the greater than or equal to symbols to work in that case. In the final argument. I’m not really sure what the logic would look like for that. I’ll think about it and if I come up with something I’ll post.
The only way I could see to do it would be to have an overarching if statement that looked at your times to see if your start time was greater than your end time. Then you could just have two if statements with opposite logic has the results of that if.
I’m not sure quite how to nest it.
Thanks for the explanation. I either have no idea how to implement that, I’m just beginning to learn, the only knowledge of programming i have is from youtube videos and copy/paste code from these forums.
Will look if i can find more info on the internet.
Have you found a way to get this to work? I have the same problem but can’t find a solution for it.
No, still no solution for this problem. can’t find anything on the internet.
Thank you a lot. Looked for a workaround. From normal HA to NodeRed, and then i tryed this. Only had to change the right input entitys and it works.
For people that struggles, just copy and paste this in the function block.