Set alarm clock in iOS and in Indigo

Posted on
Wed Dec 12, 2018 11:36 pm
MarcoGT offline
Posts: 933
Joined: Sep 11, 2014
Location: Germany

Set alarm clock in iOS and in Indigo

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

Posted on
Thu Dec 13, 2018 3:25 pm
Londonmark offline
Posts: 447
Joined: Feb 29, 2012

Re: Set alarm clock in iOS and in Indigo

Great thinking. Like this a lot.

Posted on
Tue Apr 26, 2022 12:23 pm
SofterEasy77 offline
Posts: 1
Joined: Apr 25, 2022

Re: Set alarm clock in iOS and in Indigo

so nice function and code preview. if this work correctly can you share all of code? or it's open source?

Posted on
Wed Apr 27, 2022 1:10 am
MarcoGT offline
Posts: 933
Joined: Sep 11, 2014
Location: Germany

Re: Set alarm clock in iOS and in Indigo

There is no more code required in Indigo, just the shortcut posted above which will update the variable in Indigo

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest