Pausing Kodi with incoming call

Post Reply
klontje
Posts: 38
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Pausing Kodi with incoming call

Post by klontje » Friday 04 December 2015 14:48

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 3439 times
unpause.PNG
unpause.PNG (10.71 KiB) Viewed 3439 times

pvm
Posts: 952
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: Stable
Location: NL
Contact:

Pausing Kodi with incoming call

Post by pvm » Friday 04 December 2015 19:05

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?
Synology NAS, PI3, ZWave, Xiamo zigbee devices, BTLE plant sensor

klontje
Posts: 38
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post by klontje » Friday 04 December 2015 22:58

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.

User avatar
Dnpwwo
Posts: 750
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Pausing Kodi with incoming call

Post by Dnpwwo » Saturday 05 December 2015 10:41

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.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

klontje
Posts: 38
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post by klontje » Saturday 05 December 2015 12:14

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 3366 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 3366 times

klontje
Posts: 38
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post by klontje » Saturday 05 December 2015 12:44

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 3357 times

klontje
Posts: 38
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post by klontje » Sunday 06 December 2015 16:12

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.

User avatar
Dnpwwo
Posts: 750
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Pausing Kodi with incoming call

Post by Dnpwwo » Sunday 06 December 2015 22:07

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.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests