Page 1 of 1

Pausing Kodi with incoming call

Posted: Friday 04 December 2015 13:48
by klontje
Hello,

I'm trying to build a blocky macro for pausing Kodi when receiving a phonecall throught my fritzbox. I got the first part working (pausing on incoming) but can't get in to un-pause after the call has ended. In the logging I can see the event isn't triggered so its something in the first part...

Another thing that would be great is if it would be possible to trigger stuff by reading a text utility (if X contains/starts with YZ then ...) and that it is possible to trigger the unpause only after the pause has been triggered. This to preven that on random times kodi will unpause because it sees that phone = off and kodi = paused. Don't know if this is possible but I couldn't find it.

Below my pause and unpause scripts.
pause.PNG
pause.PNG (10.42 KiB) Viewed 8753 times
unpause.PNG
unpause.PNG (10.71 KiB) Viewed 8753 times

Pausing Kodi with incoming call

Posted: Friday 04 December 2015 18:05
by pvm
When you pause on purpose you can set a uservariable or virtual switch active. If you check this in the blockly you can prevent unaniem unpause commands
Does the phone part work correctly? Does the state of the mediaplayer indeed stay paused?

Re: Pausing Kodi with incoming call

Posted: Friday 04 December 2015 21:58
by klontje
Thanks for the tip with the variable! About the status of the phone and media player:

Mediaplayer stays paused status during the call. Phone switches on when calling and returns to off after the call has ended.

Re: Pausing Kodi with incoming call

Posted: Saturday 05 December 2015 9:41
by Dnpwwo
Technically in the current stable implementation setting the state to 'Paused' causes a 'Play/Pause' command (which is a toggle) to be sent to the Kodi, setting it Paused again would theoretically make it start playing again.

Thats a bit of a hack though so I've fixed it in the beta build (although I can't test it ...... don't ask :cry: ) by making play and pause send those specific commands.

Re: Pausing Kodi with incoming call

Posted: Saturday 05 December 2015 11:14
by klontje
I already tried setting different stuff but the problem lies in the Telefoon which doesn't trigger the blocky. I tried the following:
unpause.PNG
unpause.PNG (7.26 KiB) Viewed 8680 times
Which results in nothing in the logging (although you can see the Telefoon switching on and off again). The Telefoon on triggers the right blocky and pauses Kodi but the off command doesn't do anything.
pause.PNG
pause.PNG (33.23 KiB) Viewed 8680 times

Re: Pausing Kodi with incoming call

Posted: Saturday 05 December 2015 11:44
by klontje
Update: Thought it was working (worked once) but now it's not again. The phone switches nicely but the blocky isn't triggered... It's a bit random which is strange. Any idea what could be wrong? I'm using 2.3771 on Windows.

All is fixed after restarting Domoticz :? :?

The blocky's were working and after a little modification they wouldn't but after a restart of domoticz they were working again. Below my defnitive blocky!
Capture.PNG
Capture.PNG (44.35 KiB) Viewed 8671 times

Re: Pausing Kodi with incoming call

Posted: Sunday 06 December 2015 15:12
by klontje
I see my topic is moved to Kodi but really the problem is in Domoticz being inconsistent with when the blocky is triggered and when not. Statusses are the same and there's no logic to when it is and when it isn't triggered.

Re: Pausing Kodi with incoming call

Posted: Sunday 06 December 2015 21:07
by Dnpwwo
Only thing I can suggest is to put logging in each part of your script showing variable and device status and post the output.

That might highlight where the problem is.