All Smart Lights Skills - Add Timer

Not sure where the best place is for this so if this is wrong I apologize.

I recently got my PiCroft in AIY Kit V1 running well enough to be a daily driver. I’ve got Hue, Lifx and Wemo switches in the mix. I discovered none of these things can be shut off (or turned on) on a timer. Think “Hey Mycroft turn the lights off in 5 minutes.”

I’m sure this would have fairly limited uses but sometimes the assistant is across the room from the stairs and I need the light on to find the stairs but don’t want to yell(hyperbole) across the room late at night to get the lights off. “Hey Mycroft turn the lights off in 5 minutes.” (said at normal volume near the mycroft) would be ideal. I imagine folks with larger spaces to traverse before the lights go out would enjoy such a feature.

Maybe timers would be a higher level system thing that skills could reference somehow? I have some, but limited, experience with python and it seems like this would be fairly easy to implement in each device’s skill but allowing a central way to do this seems to make some sense to me.

I also had a friend test this with Hue on an Amazon Echo and it did not work there. This seems an oversight by the big boys and would be a nice little leg up for Mycroft to be able to do. Not really a system seller but lots of little advantages can often put a product over the top.

I’m not sure where to go from here. Go to each skill’s github and file an issue to request they add this? Something else? Thanks for taking the time to have a look and consider this feature.


Hey there,

This is a great place to post it and it sounds like a cool idea :slight_smile:

It’s possibly something that could be added to the CommonIoTSkill class which would make it available for any IoT based Skill.

@Christopher_Rogers might have thoughts on it?

1 Like

Hey @Tekchip and @gez-mycroft,

This is actually something I thought about a while back, and largely what motivated me to write the extract_duration function.

When I thought about this before, my plan was to implement it similarly to the routine skill, in that it would just send arbitrary text to the massage bus. So, the user could say “do X in 5 minutes,” the skill would extract the duration, then send the remaining text (“do X” - returned by extract_duration, in addition to the duration value) to the bus at the correct time.

I would implement this as a separate skill, or as part of the Timer skill, rather than as part of CommonIoT - I think the application extends beyond IoT, e.g. it could be used for simple sleep timers. For example, while listening to music, the user could say “stop in 30 minutes.” I think it would be ideal to be able to use it for any command.



While this makes sense in the IoT context, I definitely agree there is an even broader need for it. Something like “at 7am turn on the lights and play the news” is ideal. There are several ways to break it up, but I think the routine skill is close – really it is a lot like a Macro, creating aliases for an action or actions, and then scheduling the macro. The implementation is just “saying” the words for you at the correct time. This is also very similar to Alarm Skill functionality which already supports the parsing and scheduling logic needed for things like “set an alarm for 7am weekdays” or “set an alarm for weekends at 10am”. If it could instead “run the morning routine at 7am weekdays” that is probably the most versatile.

Just my $0.02!

  • Steve
1 Like