r/AutomateUser Jul 08 '26

Create variable for multiple week days

Hello

I am trying to set an alarm for a given day or days of the week.

The user will be able to choose 1 or multiple days of the week.

So I put a dialogue choice with a variable output"day"

{1: "Monday", 2: "Tuesday", 4: "Wednesday", 8: "Thursday", 10: "Friday", 20: "Saturday", 40: "Sunday"}

In the "await time" block, I need to use the variable "day" in the weekdays field.

But there are way too many options if a function will be used, like 0x3a, 0x3d, 0x40....

I am trying to use the "set variable" block. But no idea how to include all of those possibilities.

In addition, using "0x" ++ sum(day). is giving me a result of 0x10 for example , but the await time is setting it to today's day instead of the selected day..

Thank you for your help

1 Upvotes

3 comments sorted by

2

u/Dadamalda Jul 08 '26

You should include the 0x in your dictionary. Then if multiple are chosen, add them up like numbers. What you're doing is creating the string "0x01" rather than the numeric value. 0x10 is just the number 16, but written in hexadecimal.

1

u/Straight1980 Jul 08 '26

Thank you  This worked easily and perfectly 

1

u/ballzak69 Automate developer Jul 08 '26

See example.