New Python3 AppleTV indigo Plugin

Posted on
Tue May 09, 2023 2:03 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: New Python3 AppleTV indigo Plugin

Interesting. I’ll have to have a play with that as it’s still doing the same thing for me!


Sent from my iPhone using Tapatalk Pro

Computer says no.

Posted on
Wed Jun 14, 2023 5:37 am
GlennNZ offline
User avatar
Posts: 1572
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

Hi all,

Interesting developments from the clever authors of the main pyatv library - support for all Airplay 2 speakers/devices is coming…

This is yet to be released - but testing going well, and will need some plugin based changes but potentially exposes playback of sounds and control of all airplay2 based devices. (includes Sonos speakers, amongst a whole lot of other devices that we currently find but ignore….)

I would aim to extend the currently supported HomePod play mp3, or speak text command to support all Airplay 2 speakers/devices….


Sent from my iPad using Tapatalk

Posted on
Sat Jun 17, 2023 1:36 am
mundmc offline
User avatar
Posts: 1061
Joined: Sep 14, 2012

Re: New Python3 AppleTV indigo Plugin

Wow, airplay2 functionality from a plug-in is insanely awesome. I am using a non-Sonos music distribution system right now concurrently with Sonos (arylic), and Airplay2 is the bridge between the both of them. I appreciate your work as always!

Posted on
Sat Jun 17, 2023 1:40 am
GlennNZ offline
User avatar
Posts: 1572
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

Hi

Yep - they have just released a couple of hours ago these big updates to the library.

Looks possible to include airplay 2 play file/Text-to-speech for all airplay 2 speakers, including Sonos which have been tested. Remote control play/pause of something else playing not possible yet - but hopefully will come…

Main plugin use - would be able to add airplay 2 speakers to the announcements (currently on HomePods only).

Also quite a few other updates, from working power status for appleTVs, to improvements in audio playback.

I’m just about to head off for a bit, if plane goes… (airline operator thinks going, international FR24 flight delays tells me delayed…), so will look at integrating in a week or so!


Sent from my iPad using Tapatalk

Posted on
Wed Jul 05, 2023 5:11 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: New Python3 AppleTV indigo Plugin

I have a trigger which fires the action "back to main menu" but sometimes it does not work.
How can I debug it?
I see the trigger/action in the log of course

Posted on
Wed Jul 05, 2023 5:28 am
GlennNZ offline
User avatar
Posts: 1572
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

Probably would suggest waiting it out at this stage. Some big pyatv changes (library) currently hopefully making everything a bit more robust. I’m a week or 2 away from integrating these changes into plugin.

It may, may be in your case that relates to the app running whether it allows this command. Would consider if that makes sense in the first instance?

Glenn


Sent from my iPad using Tapatalk

Posted on
Wed Jul 05, 2023 10:46 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: New Python3 AppleTV indigo Plugin

I will try with different app.
As far as I remember with Disney+ app does not work

Posted on
Thu Jul 06, 2023 10:59 pm
GlennNZ offline
User avatar
Posts: 1572
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: New Python3 AppleTV indigo Plugin

May well be a issue with the Disney+ app for this particularly command.

All we do is send the commands, if the app chooses to ignore them then not much that can be done. Should also fail with the remote control - or you may find there is a another similar command with same action that could use instead.

On my testing - seems the Apps themselves are pretty variable. A lot of the probably cheaper/free Live local TV ones here don’t give any media information at all, and don’t report playing status. Seems they have been realised as cheaply and quickly as possible…

Glenn


Sent from my iPad using Tapatalk

Posted on
Mon Jul 10, 2023 9:27 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: New Python3 AppleTV indigo Plugin

GlennNZ wrote:
On my testing - seems the Apps themselves are pretty variable. A lot of the probably cheaper/free Live local TV ones here don’t give any media information at all, and don’t report playing status. Seems they have been realised as cheaply and quickly as possible…


Going slightly off topic for a moment.. this really narks me.. I hate that Apple have allowed such low effort apps through onto the App Store, especially on the TV front. I especially hate that they've allowed custom players for video that cause me headaches, especially with my parents where I want everything to use a universal user interface for video like how it was back when the Apple TV 4 launched. End rant.

I'm excited by these changes for the plugin though, I still have 4 APEX2's for speakers around the house and being able to send audio to them too will be most handy!

Computer says no.

Posted on
Mon Jul 10, 2023 5:21 pm
GlennNZ offline
User avatar
Posts: 1572
Joined: Dec 07, 2014
Location: Central Coast, Australia

New Python3 AppleTV indigo Plugin

Hi

I have added the changes to version 1.1.3 which is committed and uploaded. Just no release - can download using code button and install.

As per startup messaging will need to upgrade pyatv in a terminal. Will give you a message to do so.

The commit has another pip3 command can run if interested in testing the now fixed (but not quite released) play_url command. This pip3 installs the fork with this unreleased library upgrade. Once released (probably soon) the standard command will work - hence haven’t changed. This is only used for play_url fix.

Adds playback support for Airplay2 devices.

In my testing works well for Sonos devices - can push TTS or mp4 to them without problem. Seems to stop current playback que, play annoucement, then que returns just doesn’t restart playback.

Play_URL fix - works really well for m3u8 streams, and mp4 - just can’t get it working for BlueIris camera streams for the life of me as yet…

Question will be whether finds all airplay2 devices…. Will need force Discovery on. In my case finds and create devices for Amplifier, sonos speakers, appleTv’s - so hopefully that will mean rest okay?

&
As per commit
No playback control of these Airplay2 devices (as yet - should come)
Primary usage is for announcements across these speakers presently.

Thanks


Sent from my iPad using Tapatalk

Posted on
Wed Aug 02, 2023 5:41 am
danieljmorel offline
Posts: 42
Joined: Dec 11, 2016

Re: New Python3 AppleTV indigo Plugin

in response to dtich's post:
File "plugin.py", line 144, in <module>
type: name 'pyatv' is not defined

pyatv would not install for me either. After 3 days of trying to get it to work, I stumbled on this, my terminal kept defaulting to a venv directory for python and I could not get it out of there. everytime I ran 'pip3 install pyatv' it returned "requirement already satified". Finally I opened a scripting shell from the Indigo/Plugins menu. I noticed that the Python version was 3.10.2. So just because I was out of options, I tried 'pip3.10 install pyatv' in a terminal window and I'll be if it didn't install. Plugin is working now. Honestly, I tried so many things in an effort to get this plugin installed that I can't promise this will work for everyone or that I have all the correct steps listed here. All I know is that it did for me. Hope maybe that it will save somebody else 3 days of frustration.

Posted on
Wed Oct 11, 2023 2:39 pm
Wizard Sleeve offline
Posts: 64
Joined: Feb 11, 2008
Location: Berkshire, United Kingdom

Re: New Python3 AppleTV indigo Plugin

Hi.

Been using your plugin for months now with great success. Im only using it at the moment to announce things that are happening around the house to some HomePods.

So I today went and purchased another HomePod from the Apple Store as my mum couldn't hear the one in Hall when she is in the kitchen and I missing the doorbell notifications. Anyway I can't get it to pair.

So the setup....

The HomePods are on a different VLAN to all my automation stuff but I have a AVAHI Reflector setup and is working perfectly to bridge the mDNS addresses.

If I scan the network it finds the HomePod perfectly and I have tested this by manually forcing a different (DHCP Reservation) address and see if it updates in the plugin when I rescan for them.
Then If I go in to Edit>Edit Device Settings it'll tell me all the info at the bottom of the device and it all seems correct.

If I click "Start Connection" the Log Says "Scanning for all AppleTVs" followed by "The Device wasn't found. Try power cycling and try again"

I have tried power cycling with no effect. The only thing I can see is different is this HomePod (Mini) came with IOS 17 and I'm guessing the older ones were on a version of 16 at the point of adding them.

Ive just checked the others and they are all now on 17 and they still work perfectly.

The only thing I haven't tried is factory reseting the new HomePod and starting from scratch. It works like normal to send audio from my iPhone if I'm connected to either of my the VLANS (Main/Automation)

Any help would be much appreciated

Any suggestions

Posted on
Wed Oct 11, 2023 3:07 pm
GlennNZ offline
User avatar
Posts: 1572
Joined: Dec 07, 2014
Location: Central Coast, Australia

New Python3 AppleTV indigo Plugin

Hi

Few things come to mind

1. Unlikely to be OS17, given your current devices are on it, I'm on it - and presume everyone else is as HomePods update automatically.
But as you correctly state not sure we have paired devices with OS17 as yet...

[Additional]
Have checked and pairing, find devices work fine and within <1 second for me on OS17 and HomePod
So, not an OS17 thing.

2. On restart of Plugin all the devices have to be reconnected, so if just one device thing something else is up

3. To be clear - the plugin finds and creates the Homepod device, but when you press StartConnection it doesn't pair?
Is it already connected?
Are you sure the IP address is correct?

[Additional]
No harm deleting the device from Indgio, go to PluginConfig scan single IP address for this device which should be found and recreated
Try start Connection again.

The startConnection button hands off the scanning of Homepod to the pyatv library - this is the same scan that previously found it, it would seem. (if device created)
There is a 15 second timeout here - perhaps that needs to be longer?

[Additional]
Have uploaded version 1.2.2 which increases this timeout to 90 seconds
On mine (and tested a few times now) OS17 Homepod - StartConnection connects and pairs within a second it would seem.
If taking more than 15 seconds - perhaps there are some network issues here?

4. Some of the menu options, show atv's etc may give more information about atv.

{Additional]
Particular the Log atv info (from Plugin Config menu)
Select the unpaired Homepod and 'Run Scan and Display Info on Device'

5. Avahi is a okay option, Pfsense UDP Broadcaster (if on Pfsense) on new version seems much better. Was just reading about it just yesterday, deals with specific devices that had issues with avahi (like Google casts) Avahi often fails with various devices - and potentially is source of if not problem, then perhaps delays leading to timeout?

BUT if device created - then the same scan that is running after the startConnection button has run before and been successful.

6. Some debug logging after Start Connection button pressed may tell us what is going on.

Posted on
Thu Oct 12, 2023 9:32 am
Wizard Sleeve offline
Posts: 64
Joined: Feb 11, 2008
Location: Berkshire, United Kingdom

Re: New Python3 AppleTV indigo Plugin

Ok so just starting to mess with this. So if i delete the device and scan for "all" it will find and create the device and it will show the correct IP but it says it needs paring. If I delete the created Device again and scan for it directly on its IP it wont find it.

My next thing im going to try is moving it to my automation VLAN (Thinking about it the Homepods could be on this network as they are only used for announcements. Ill report back if that makes it pair. If it does ill move my other 3 over to this network to reduce complication.

Posted on
Thu Oct 12, 2023 10:20 am
Wizard Sleeve offline
Posts: 64
Joined: Feb 11, 2008
Location: Berkshire, United Kingdom

Re: New Python3 AppleTV indigo Plugin

OK got this working correctly now.

Added the Homepod to the Automation VLAN and found/paired it in indigo.

Factory Reset the Homepod and then added it to the Main Network

It remains paired in indigo and works across the VLANS just fine.

I have realised the other Homepods were paired before I split the VLANs and everything was on a single network.

So for anyone else doing this Add to local network to indigo>pair>move Homepod to VLAN of choice (You will still probably need some sort of mDNS bridging to make it work but not sure as it has its direct ip)

Thanks for the info

Who is online

Users browsing this forum: No registered users and 5 guests