Page 1 of 1

Set alarm clock in iOS and in Indigo

PostPosted: Wed Dec 12, 2018 11:36 pm
by MarcoGT
Hi,

I created a small iOS Shortcut and a related Python script which make following:

- ask you (by voice) to set up an alarm clock
- this alarm will be set in iOS and using SSH server also in Indigo

In my Indigo setup I have an "alarm clock" schedule which does some basic stuffs, and then a "good morning" action which makes other things; the second one is called manually (by voice), the first one is a schedule configured which takes the "alarm clock" variable as schedule time

iOS Shortcut: https://www.icloud.com/shortcuts/e2342c ... ce7a130369

Python Script:
Code: Select all
alarm_clock = indigo.variables[469044268].value # "sveglia"
alarm_cleaned = "0" + alarm_clock.split()[0]
indigo.variable.updateValue(469044268, value=alarm_cleaned)


Quick explanation: if I say to Siri "set an alarm at 6" (in Europe we usually do not use AM/PM, but 6 or 18), Siri will set the alarm in iOS at 18, I do not know why.
Therefore I have to say "set an alarm an 6 in the morning"; then of course the variable will not contain only the time, but also some other words; the small script will take just the number and will insert a leading zero for Indigo so that it recognizes as time for the schedule.

Marco

Re: Set alarm clock in iOS and in Indigo

PostPosted: Thu Dec 13, 2018 3:25 pm
by Londonmark
Great thinking. Like this a lot.

Re: Set alarm clock in iOS and in Indigo

PostPosted: Tue Apr 26, 2022 12:23 pm
by SofterEasy77
so nice function and code preview. if this work correctly can you share all of code? or it's open source?

Re: Set alarm clock in iOS and in Indigo

PostPosted: Wed Apr 27, 2022 1:10 am
by MarcoGT
There is no more code required in Indigo, just the shortcut posted above which will update the variable in Indigo