New Python3 AppleTV indigo Plugin

Posted on
Wed Jan 18, 2023 3:09 am
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

ukie wrote:
I also have issue with power state updating after my aTV4K (1st gen) goes to sleep.
When I trigger the OFF command from indigo (while the SecuritySpy app is running on the ATV), the ATV goes to sleep, but the device status in indigo remains ON.
Yep.
Thats a known issue with power state reporting not being particularly great. It’s mentioned in the documentation I believe.
Not much we can do about it, and it may get worse as OS advances.. but at least the ON / OFF commands work.


Sent from my iPad using Tapatalk

Posted on
Thu Jan 26, 2023 1:37 am
ukie offline
Posts: 69
Joined: Oct 15, 2010

Re: New Python3 AppleTV indigo Plugin

Got it... that's too bad.
Another question: How does the speak announcement action supposed to work?
I can't get to do speak anything on the HomePods or ATV.

Posted on
Sat Feb 04, 2023 5:19 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: New Python3 AppleTV indigo Plugin

#1. Thanks for this plugin.
#2. Would you prefer issues here (in the Indigo forum) or as github issues?
#3. And, I have a problem with the plugin. I think this is the same thing ukie reported. I cannot get the plugin to play a sound file or URL to a new HomePod.
Code: Select all
   Action Group                    AppleTV Homepod TEST
   appleTV Plugin                  Sending Command stream_file=/Users/rdp/Music/nescafe.aiff  to appleTV Device ID 1330741460
   appleTV Plugin                  Could not run this command at this time.
It throws a long series of errors in debug mode... I can post them if you like. But, I imagine you will get the same results.
#4. While looking into #3, I found another bug: Changing the action group settings has no effect, only the original settings are ever executed. I.e. Changes are not saved.

Cheers

Posted on
Sat Feb 04, 2023 3:07 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

Hi

The Homepods Play_URL is unsupported, but the rest was working when last checked on OS 16.2

As per the release:

These devices do not need to be paired - but once created setup the connect in the Device Edit screen

Play_URL for Homepod reports unsupported. And doesn’t work currently given library aspects and the changes with OS 16.

However Stream_File, or the Remote setting:
"Stream local file or remote file to device"

Works

Optional Argumment:
https://www.soundhelix.com/examples/mp3 ... Song-1.mp3
or
Local file: (like)
/Users/Indigo/Desktop/doorbell-1.mp3
Works.



Try the text to speech command for added interest - needs the xattr command run as per startup messaging.

Double check on release 0.1.16

Will need logs to see if a device specific issue (there are some networking settings that block access) - either here or github - if lots of logs probably Github

Thanks


Sent from my iPad using Tapatalk

Posted on
Sat Feb 04, 2023 3:47 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: New Python3 AppleTV indigo Plugin

Yes, I am on 0.1.16
Text to speech works. It is stream from file that fails.

Posted on
Sat Feb 04, 2023 4:05 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

New Python3 AppleTV indigo Plugin

Well thats interesting - as text to speech just creates the file on the fly and then sends it.

The log will probably show why, but may be some file specific aspects.

AppleTV will only play files it is happy with, which appears to be a limited list. It is likely only very specific file types are supported by appleTV - pretty sure mp3 and mp4 works

Homepod - probably even more limited. Stick to mp3 and presume that will fix issue.

https://developer.apple.com/library/arc ... rPlay.html

Glenn


Sent from my iPad using Tapatalk

Posted on
Sun Feb 05, 2023 4:16 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: New Python3 AppleTV indigo Plugin

GlennNZ wrote:
...AppleTV will only play files it is happy with, which appears to be a limited list. It is likely only very specific file types are supported by appleTV - pretty sure mp3 and mp4 works
...
The problem was the plugin crashing with the aiff file. I switched to an mp3 version and it works. However, still fails with the aiff. I tried updating the ffmpeg version in the plugin. But, that made no difference. In any case, It is working now. Thanks.

BTW, I will post the complete debug message from the error to github

Posted on
Sun Feb 05, 2023 4:24 am
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

New Python3 AppleTV indigo Plugin

It will be because the aiff is not supported by the homepod.


Homepod - probably even more limited. Stick to mp3 and presume that will fix issue.

https://developer.apple.com/library/arc ... rPlay.html




ffmpeg has nothing to do with the play file url - that is just sent directly to the homepod or the appletv to play.

The documentation on what is supported is limited for the homepod, as above I believe that mp3 alone would be the safest bet.

Glenn


Sent from my iPad using Tapatalk

Posted on
Sun Feb 05, 2023 11:10 pm
ukie offline
Posts: 69
Joined: Oct 15, 2010

Re: New Python3 AppleTV indigo Plugin

Running the plug-in in interactive shell and trying to use the Speak command, it indicates that libX11.6.dylib library not loaded because it cannot be found. XQuartz is installed. Is it located in the wrong location?

Posted on
Sun Feb 05, 2023 11:46 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

New Python3 AppleTV indigo Plugin

Have you followed the

pip3 install pyatv

instructions? Does that complete without error?
If error - see FAQ section.

If this is a specific issue - just with say and ffmpeg - have seen this with ffmpeg with homekit plugin usage.
Basically you have a library that is incorrectly located or not installed where the plugins ffmpeg thinks it should be….

You can try

find / -name libX11.6.dylib

and then create a symbolic link to where it is looking, for the missing the file location.

This appears to be related to past ffmpeg installs and locations - which is why it isn’t a more universal issue. It may be corrected by removing and reinstalling the other ffmpeg installs - but that doesn’t seem to be guaranteed.

Glenn


Sent from my iPad using Tapatalk

Posted on
Wed Feb 15, 2023 1:27 pm
ukie offline
Posts: 69
Joined: Oct 15, 2010

Re: New Python3 AppleTV indigo Plugin

The symlink fixed the issue. Thank you!

Posted on
Sat Feb 25, 2023 5:33 am
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: New Python3 AppleTV indigo Plugin

Homepod Mini - works, but the volume (or set volume) seems ignored. What is the scale?

p.s. I played some music, and now the volume control seems to work (the scale is 0-100?)

p.p.s. it would be nice to be able to choose the voice/language for the announcements.

Posted on
Sat Feb 25, 2023 3:20 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

New Python3 AppleTV indigo Plugin

Hi

As you guessed the volume is 0 (muted) to 100. Different protocols will support or not support various aspects.

Voice/Language - is selected by changing the default system voice (this is what we use). This ensures selected, downloaded and available. I could look at a selector - but would be time consuming to parse what is available, liable to fail when voice not downloaded, and change with different OSX versions (but will have a look and see this has already been done with a library somewhere)

If wish multiple different voices at different times - would suggest creating mp3 files of the various sentences and using those instead of text-speech.


Sent from my iPad using Tapatalk

Posted on
Wed Mar 08, 2023 4:49 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Plugin hangs

I am experiencing a fairly frequent (every 2 or 3 days) plugin hang. It simply becomes unresponsive. Reloading the plugin resolves the problem. I don't have any direct data on what is going on. In case they might be of use, I have included:
  1. the error thrown in the Indigo log when I try to configure the plugin when it is in the non-responsive state.
  2. A list of the processes open files (from activity monitor)
  3. A sample of program activity (from activity monitor)

the errors thrown in the Indigo log
Code: Select all
 Error (client)                  timeout waiting for plugin response from com.GlennNZ.indigoplugin.appleTV for request CalcDeviceFunc
   Error (client)                  timeout waiting for plugin response from com.GlennNZ.indigoplugin.appleTV for request UiGetValues2
   Error (client)                  timeout waiting for plugin response from com.GlennNZ.indigoplugin.appleTV for request CallPluginFunc
   Error (client)                  runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

list of the processes open files
open-files.txt
(6.94 KiB) Downloaded 19 times

sample of program activity
Sample of IndigoPluginHost3-AppleTV.txt
(87.06 KiB) Downloaded 17 times

Posted on
Wed Mar 08, 2023 2:07 pm
GlennNZ offline
User avatar
Posts: 1555
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

That will be annoying.

Not seeing that - in fact has been solid for 2+ months. Even went away for a month came back - turn on appleTV and on came lights with Play/Pause.

Thats an odd indigo client error - do you have a config window open somewhere?

Not sure whether Matt or Jay want to comment what might cause a such a client error?

I have a look and see if anything stands out.

Glenn


Sent from my iPad using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest