Pausing Kodi with incoming call

Moderator: leecollings

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

Pausing Kodi with incoming call

Post 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 6544 times
unpause.PNG
unpause.PNG (10.71 KiB) Viewed 6544 times
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Pausing Kodi with incoming call

Post 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?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
klontje
Posts: 19
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post 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.
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Pausing Kodi with incoming call

Post 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.
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: 19
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post 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 6471 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 6471 times
klontje
Posts: 19
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post 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 6462 times
klontje
Posts: 19
Joined: Sunday 01 September 2013 13:16
Target OS: Windows
Domoticz version:
Contact:

Re: Pausing Kodi with incoming call

Post 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.
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Pausing Kodi with incoming call

Post 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.
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 0 guests