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:
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
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