Release Sleep Timer (service.sleeptimer)
#46
Its probably the second one. xx returns AM or PM so it was planned. System.time is probably returning AM/PM and breaking the logic. I'll do some tests at home
Reply
#47
Yeah, that happens if the display clock is set to display hh:mm xx. Attempt to fix here: https://github.com/enen92/service.sleept...5f90b40384

For direct download: https://github.com/enen92/service.sleept...master.zip

Hopefully it's fixed, Thanks solo
Reply
#48
Is it possible to have the addon work like a normal tv sleep timer? - ie. press a button and pop a notification saying sleeping in x minutes, press again and it increases, finally going back to zero after a couple of presses?

I'd like this functionality but would like to make use of the additions in this addon such as soft mute and running a command before sleeping (i need to tell my harmony hub that the activity is now off - otherwise it gets all confused as it still thinks the TV is on Smile)
Reply
#49
(2015-12-31, 16:19)Swifty Wrote: Is it possible to have the addon work like a normal tv sleep timer? - ie. press a button and pop a notification saying sleeping in x minutes, press again and it increases, finally going back to zero after a couple of presses?

I'd like this functionality but would like to make use of the additions in this addon such as soft mute and running a command before sleeping (i need to tell my harmony hub that the activity is now off - otherwise it gets all confused as it still thinks the TV is on Smile)

The addon is not designed to work that way..it is a service that is always running and checks for playing media. I like your idea (if I understood it correctly) but that is more appropriated for another independent addon.
Can you explain the idea with a bit more detail?
Reply
#50
Thanks for your reply, I figured it probably wouldn't work that way, but wanted to check Smile

My idea is have a service addon will always be running with Kodi, then have a remote button mapped to run a particular function within that addon (lets call it 'Arm_SleepTimer')
Each time the function was called (by pressing the remote button) the 'Arm_SleepTimer' function would run and step one iteration through the following timer values (as an example); 10m, 20m, 30m, 60m, 90m, 0m (disable)
Then when the timer runs out it would fire the event to soft mute Kodi, stop playback and then execute a custom command (in my case a wget/curl which tells my Harmony hub to sleep the Kodi box and turn off the TV/AVR)

I've got the basics up and running in an addon, but I don't have much experience in making them or Python, so I'm stuck on two bits;

- Persisting the current 'timer' setting in a variable in the addon, so that the next time the remote button is pressed I know what the last timer value was, so I can step to the correct value. I don't want to use a file to hold this, incase of early (manual) shutdown/sleep as it would then be out of step with reality Smile
- Mapping a button press in Kodi to a particular function within a service addon... I literally have no idea how to do that Smile
Reply
#51
(2016-01-17, 21:53)Swifty Wrote: Thanks for your reply, I figured it probably wouldn't work that way, but wanted to check Smile

My idea is have a service addon will always be running with Kodi, then have a remote button mapped to run a particular function within that addon (lets call it 'Arm_SleepTimer')
Each time the function was called (by pressing the remote button) the 'Arm_SleepTimer' function would run and step one iteration through the following timer values (as an example); 10m, 20m, 30m, 60m, 90m, 0m (disable)
Then when the timer runs out it would fire the event to soft mute Kodi, stop playback and then execute a custom command (in my case a wget/curl which tells my Harmony hub to sleep the Kodi box and turn off the TV/AVR)

I've got the basics up and running in an addon, but I don't have much experience in making them or Python, so I'm stuck on two bits;

- Persisting the current 'timer' setting in a variable in the addon, so that the next time the remote button is pressed I know what the last timer value was, so I can step to the correct value. I don't want to use a file to hold this, incase of early (manual) shutdown/sleep as it would then be out of step with reality Smile
- Mapping a button press in Kodi to a particular function within a service addon... I literally have no idea how to do that Smile

Ah, got it. I'll try to have a crack at it at night. It has to be a different plugin though. This one is just a player watchdog Smile
It looks like something that can be handy for a lot of people Nod
Reply
#52
Oh great, thanks.. I'm happy to continue trying myself if you have any tips on those two issues I'm facing.
Didn't expect you to do it all yourself Smile
Reply
#53
The feature you are discussing is one that exists with most dvr's and tv's, even older ones.
I really like the current sleeptimer service, but would certainly welcome the 'revival' of the good ol' sleeptimer function!
Reply
#54
(2016-02-06, 19:46)Atreyu Wrote: The feature you are discussing is one that exists with most dvr's and tv's, even older ones.
I really like the current sleeptimer service, but would certainly welcome the 'revival' of the good ol' sleeptimer function!

I did a search to "prod" threads where users had made a request for a "TV Like Sleep Timer" so that people are aware that I've just released one Smile (So they get notified if they are subscribed to the thread)

I have been unsure if I should post on this thread as it's for a "Sleep Timer" - however my timer does not actually do what this addon does, so I'm hoping that no-one minds (If there are any objections, then I'm willing to delete this post).

Anyway, Atreyu, I think the Sleep Addon that I've done may do what you are looking for:

http://forum.kodi.tv/showthread.php?tid=261959

NOTE: Please do not post to this thread about the "Sleep" Addon - I don't want to pollute Sleep Timer's thread! (Use the thread in the link above)

Thanks

Rob
Reply
#55
Great stuff Smile
Hopefully people requesting that functionality will use your addon. Only objection is the name which is pretty similar. Originally this addon was called safestop which was in my opinion a more appropriate name than sleeptimer. If you submit your addon to the repository I'll work out a different name to this service (keeping the same id though).
Reply
#56
Hello,

is it possible to set custom maximum allowed playback time?

Now its minimun 30 min. I would like 10/20 min also.
Reply
#57
I am using Kodi on a Raspberry below our bed, in order to be able to hear music or audio books until sleeping. Therefore, I am very fond of the sleep timer. However, I would like to be able to enable it via remote, since I am exclusively controlling Kodi via smartphone.

Could you expose the sleep timer functionality via Kodi's JSON-RPC? (At least during my last investigation, which was several months ago, I think that was not available yet.)
Reply
#58
Newbie Running Xubuntu here. What would be the CMD i could use to shutdown the PC?
Reply
#59
(2016-02-27, 13:58)robwebset Wrote:
(2016-02-06, 19:46)Atreyu Wrote: The feature you are discussing is one that exists with most dvr's and tv's, even older ones.
I really like the current sleeptimer service, but would certainly welcome the 'revival' of the good ol' sleeptimer function!

I did a search to "prod" threads where users had made a request for a "TV Like Sleep Timer" so that people are aware that I've just released one Smile (So they get notified if they are subscribed to the thread)

I have been unsure if I should post on this thread as it's for a "Sleep Timer" - however my timer does not actually do what this addon does, so I'm hoping that no-one minds (If there are any objections, then I'm willing to delete this post).

Anyway, Atreyu, I think the Sleep Addon that I've done may do what you are looking for:

http://forum.kodi.tv/showthread.php?tid=261959

NOTE: Please do not post to this thread about the "Sleep" Addon - I don't want to pollute Sleep Timer's thread! (Use the thread in the link above)

Thanks

Rob
Exactly whati was looking for indeed.
Very nicely done, thanks a lot!
Reply
#60
Hi. I'm brand new to the world of Kodi. I'm using the Kdlinks A300 and was wondering if this addon has a way of shutting down the box completely as opposed to just stopping Kodi? And I can't thank you guys enough who make these addons, I'm blown away at all the awesome things Kodi can do!
Reply

Logout Mark Read Team Forum Stats Members Help
Sleep Timer (service.sleeptimer)1