# Weekday clock RULE

**URL:** <https://discourse.mozilla.org/t/weekday-clock-rule/96762>\
**Category:** WebThings\
**Created:** [May 2, 2022, 6:45am UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762 "2022-05-02T06:45:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 2, 2022, 6:45am UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/1 "2022-05-02T06:45:26Z")

</div>

Hello good morning I have recently implemented a Webthings. I am trying to make an alarm that sounds certain days of the week at a certain time, but I can only tell it the time without a day. Would there be any way to make the rule by days of the week? I hope your help, it is very important.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 2, 2022, 10:04am UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/2 "2022-05-02T10:04:05Z")

</div>

Hello, the calendar addons will help you with that!

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 2, 2022, 11:56am UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/3 "2022-05-02T11:56:51Z")

</div>

Yes, I had seen them correctly, but the truth is that I would not know how it can be used. Could you help me implement it? What I would need would be for Monday to Thursday to be one schedule and Friday a different one. Example: from Monday to Thursday it is activated at 14:45 and on Friday it would be activated at 15:15. It would be more or less an example of what I would like.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 2, 2022, 12:02pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/4 "2022-05-02T12:02:35Z")

</div>

![image](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/6/0/60a88356ef19a14a9a80b39058e9122e708f4c70.png)

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 2, 2022, 2:14pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/5 "2022-05-02T14:14:04Z")

</div>

This exactly with what complement is done?

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 2, 2022, 2:25pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/6 "2022-05-02T14:25:18Z")

</div>

this is a rule with datetime from calendar addon as condition. then you could mix multiple day of week if you want.  
EDIT: sorry my bad, it was the DateTime Adapter that you need!

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 2, 2022, 3:39pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/7 "2022-05-02T15:39:09Z")

</div>

![imagen](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/2/0/20ecff3d933cea58800db884a2c0fbd336bee2f1.png)  
 ![imagen](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/f/4/f4312a0ae650d7533b36a19010190239e20300d8.png)  
After installing the plugin I don’t see it in the rules. Do I have it configured correctly?

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 2, 2022, 4:08pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/8 "2022-05-02T16:08:16Z")

</div>

you need long and lat, could find it from google maps!

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 2, 2022, 5:01pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/9 "2022-05-02T17:01:04Z")

</div>

Hello Martin, I think he got it, he did it in the following way.

See if it’s correct.

 ![imagen](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/e/d/edd97207d9efee48f6456b577076d5d426e92889.png)  
 ![imagen](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/4/4/448d69b521d24ce91ff5137a79f43def9368c057.png)

Thank you very much.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 2, 2022, 5:02pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/10 "2022-05-02T17:02:33Z")

</div>

look good, congrats!

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 4, 2022, 4:45pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/11 "2022-05-04T16:45:08Z")

</div>

After carrying out several tests with the conditions, it does not work for me if I add more than an hour, I attach a screenshot.

 ![image](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/2/7/2705321006639231e22b8c9e09d8ad30b993c2af.png)

If I leave it this way the siren never sounds, I have tried making the changes in the if for while, also changing the or for and and vice versa. Could you tell me what would be the best way to perform the condition so that it would work correctly. Thank you so much for everything.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 4, 2022, 4:50pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/12 "2022-05-04T16:50:27Z")

</div>

The rules only allow simple condition, if you need to build more complexe situation, i suggest you to take a look at the macros addon

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 4, 2022, 5:08pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/13 "2022-05-04T17:08:14Z")

</div>

Could you tell me an example of how I should put the condition as I have told you so that I can perform this function. Right now I already have the plugin you indicated installed and it seems perfect for what I need.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 4, 2022, 5:10pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/14 "2022-05-04T17:10:04Z")

</div>

can you tell me exctly what you want  
ex: on monday at 18h43 and 13h23 i want to set sirene to on

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 4, 2022, 5:12pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/15 "2022-05-04T17:12:15Z")

</div>

If you look, for example, we would like that from Monday to Thursday, the siren will sound at 06:00, 9:30 and 15:15, to give an example

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 4, 2022, 5:24pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/16 "2022-05-04T17:24:50Z")

</div>

you start like this:

 ![image](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/c/d/cd213efea024819c485c2b1482ede70bae304462.png)  
and then you use if block with or and and to compare everything you need!

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 4, 2022, 5:29pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/17 "2022-05-04T17:29:06Z")

</div>

> [@Martin\_Verret](#):
>
> and then you use if block with or and and to compare everything you need!

Could you give me a graphic example with the complete example parameters, because the truth is that I don’t know how to do it, sorry.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 4, 2022, 5:32pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/18 "2022-05-04T17:32:31Z")

</div>

what you need to do:

If weekday = monday or weekday = tuesday or weekday = wednesday or weekday = thursday

do  
if hour = 6 and minute =0 or hour = 9 and minute = 30 or hour = 15 and minute = 15

do  
set sirena attribute to ON  
else

else

this is basicly what you need to see on your screen with the different block, unfortunately i can’t do it myself to give you a screen shot.

---

<div class="post-metadata">

**Author:** ![Xjj2020](https://avatars.discourse-cdn.com/v4/letter/x/65b543/32.png) [@Xjj2020](https://discourse.mozilla.org/u/Xjj2020)\
**Post date:** [May 4, 2022, 5:37pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/19 "2022-05-04T17:37:02Z")

</div>

![image](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/c/7/c72c58bc04577f5ef189b0ae000def1bf769564d.png)

Okay perfect, this is exactly what I need, the only thing I don’t know how to enter the days once indicated that I need the day of the week and I don’t know how to enter the time either.

---

<div class="post-metadata">

**Author:** ![Martin\_Verret](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Martin\_Verret](https://discourse.mozilla.org/u/Martin_Verret)\
**Post date:** [May 4, 2022, 5:38pm UTC](https://discourse.mozilla.org/t/weekday-clock-rule/96762/20 "2022-05-04T17:38:58Z")

</div>

1)your trigger must be on minutes, not even minute  
2)you will have to add multiple or and and to make it work, and to check for weekday and hour and minute, you have to see almost exactly what i write 😉  
3) for comparaison you should add a = with a text after for the week day

[Next page](https://discourse.mozilla.org/t/weekday-clock-rule/96762.md?page=2)
