The content URL must be accessible from Home Assistant itself. The ffmpeg command to stream the audio runs directly inside of the HA Core docker container. So, if the file is on disk, you can just use /config/www/doorbell.mp3 or whatever the path to the file is. Using a URL might cause issues if the networking routing is off.
Also, if you have not seen the patch notes yet for 0.11.1, please make sure you are running 0.11.1 and reboot your camera after upgrading.
I am using the docker container and just tried changing the path to “/config/www/doorbell.mp3” (I opened a console session into the container to verify that the file was accessible at that location). However, that didn’t seem to work either. I appreciate the help though!
NOTE: I also tried using /tts/NAME_OF_RECENT_TTS_FILE.mp3 since i know those files played properly, but that also failed to play when calling the service. Do i need to call one of the media player turn-on services or anything else first?
EDIT2: Just to confirm, i am running the latest (0.11.1) and have restarted the camera. TTS commands sent through the home-assistant UI do play, just not the media_player.play_media service
EDIT3: I think I got it! The media content type needs to be set to “music”
Ah, I believe I had to set it to that for the google-cast devices to pick it up, however after testing, it seems like “music” works just fine for both. However, the google-cast needs the URL, not the local path. So, i switched the path to be the URL, the type to be “music” and combined both calls into one (so it lists both the doorbell and the google cast group as the targets) and everything is working now, thanks!!!
As an amendment to the deprecations from 0.11.0, the last_tripped_time is no longer deprecated as last_changed is not a full replacement (#411)
FIX: Bumps version of pyunifiprotect to 1.3.4. This will fix talkback for all cameras that was not working as expected. If you previously tried to use the media player to play audio through your camera (like with TTS), you will need to reboot your camera to “fix” it so it will work again.
With the new version I can no longer see my G3 Flex cameras in HA, the G4 Bullets are working just fine and it all happened when I upgraded this component. I have the same settings for RTSP so not sure what could be wrong. Did anyone else experience the same?
You may also want to check to make sure the camera entities you were using did not get disabled. I tried my best to make sure the same ones stayed enable for 0.10 → 0.11, but it seems like another user has a similar issue. The camera entity they were using in 0.10 did not quite get migrated perfectly and it was disabled in 0.11.
If this does not solve your issue, then yeah, please make a Github issue if you can.
Thank you all for the response regarding my G3’s. They are displayed as “Unavailable”. The log mentions nothing about my G3’s so maybe there isn’t an issue with code itself but with something I have done (wouldn’t be the first time )…
I have to dig deeper to figure out what is going on but just wanted to through some hooks out in case someone else experience the same. Can I reset/restart the integration to these specific cameras somehow?
One of my G3 cameras (Otillgänglig = Unavailable):
I find that any streams that are enabled in the Protect App will show up in the HA integration (although they are initially disabled in the HA integration)
Hi @Lunkobelix
The object detected is not an attribute, but the state of the sensor, so you should use states("sensor.g4_framsidan_detected_object") instead. But please note, the state will reset to none after a short while without detection.
Some more info about my G3’s that isn’t showing the stream anymore, maybe it can help someone to give me an idea what has happened:
Stream is working in the Unifi app
The motion sensor is reporting back motion information to Home Assistant. I can see history of when motion occured.
I can toggle things like status light, overlay information, privacy mode, microphone level
I can not toggle things like IR active, record always, record motion, high FPS
So it looks like it is the stream that is not working, most of the other functions are working. I have enabled all three RTSP quality options (changed that now from only having medium enabled). Removing and reinstalling the integration is my last option but I guess that will cause quite some work since so I would like to avoid it.
Any ideas?
Edit: Turns out that RTSP stream with low quality had to be enabled in the Protect camera settings. Working fine now.
After changing any of the RTSP(S) settings in UniFi Protect, you have to reload the integration or restart Home Assistant. The stream settings/camera entities do not update in real time.
Even if you disable/re-enable the same stream quality level, you have to reload/restart. This is because the RTSP alias changes whenever it is enabled/disabled.