Yes. The instructions have already been updated, I just need to merge this release with the master
Yes sorry for the entity name change, but this was necessary to ensure this conforms with HA standards. On the plus side, you will now be able to manually change the entity name to whatever you like, if you want to.
I donāt know if this can be done, but let me look in to it.
Thank you.
Seconds would seem to be the most practical approach all round.
Try and pull the latest beta release from the v0.4 Branch on Github. There is now a new Attribute on the Binary Motion Sensors called event_length. This holds the number of seconds between the Start of the Motion event and the End of the event. Let me know if this helps.
There are a few other changes, so please pull all the files (You can skip the translations directory)
Iāve not used a beta release before and currently Iām installed via HACS, so forgive the following questions if they are stupid.
1. Will stopping HA, overwriting the existing component files with the beta release and restarting be sufficient to upgrade?
2. Will moving to the beta break HACSā knowledge of the component and updating via HACS?
EDIT Just found the answers to my stupid questions.
Anyway, I will release the Beta within the next few days, and then it will be supported through HACS. There are quite a few Breaking Changes, compared to the 0.3.x version, but this is the right way to go, also for me from a support perspective.
I removed the old integration and setup fresh with v0.4-beta-2 per the instructions.
Everything is back as expected, however.
1. Binary sensors now have last_tripped_time which matches the associated camera but no event_length
2. event_score remains null even after an event for all cameras.
I will release the Beta within the next few days, and then it will be supported through HACS.
I missed this bit, Sorry.
My wifeās right - I canāt multitask.
Iāve bungled my way through this (one day Iāll learn how to pull files from github without git installed in an efficient manner) and been able to test the results with my G3 Flex in the garage.
All looks great.
event_length works beautifully and matches the reported clip length in Protect.
I do have one question:
Am I right in thinking that the last_tripped_time has been added to the binary sensor? If so, will this eventually replace the last_tripped_time on the camera entity?
Fantastic, that the event_length is correct
Yes, the last_tripped_time has been added to the binary_sensor, and it is the same value you will see on the Camera. I have no plans of removing it from the Camera, so you can pull it from where you like.
Release 0.5 - Fully Integration based
Sorry for this long Post, but I just want to make sure I have covered all the changes and the upgrade path.
The Beta release 0.4 has been out for a while now, and I belive we are at a stage where I will release it officially, and it will be called Version 0.5.
After the conversion to use all the Async Libraries, it became obvious to also move away from Yaml Configuration, to the fully UI based Integration. As I wrote in the Tester Notes, I know there are some people with strong feelings about this, but I made the decision to make the move, and going forward only to support this way of adding Unifi Protect to Home Assistant.
***** BREAKING CHANGES *****
Once setup, the base functionality will be the same as before, with the addition of a few minor changes. But behind the scene there are many changes in all modules, which also makes this a lot more ready for becoming an official Integration in Home Assistant Core.
I want to send a BIG THANK YOU to @bdraco who has made a lot of code review, and helped me shape this to conform to Home Assistant standards. I learned so much from your suggestions and advice, so thank you!
Here are the Breaking changes:
- Configuration can only be done from the Integration menu on the Configuration tab. So you will have to remove all references to unifiprotect from your configuration files.
- All entities will get the
unifiprotect_
prefix removed from them, so you will have to change automations and scripts where you use these entities. This is done to make sure that entities have a Unique Id and as such can be renamed from the UI as required by Home Assistant. I will give a 99% guarantee, that we do not need to change entity names again.
Upgrading and Installing
If you have not used Unifi Protect before, go to step 4.
If you are already runing a version of Unifi Protect with version 0.3.x or lower:
- Remove the previous installation
- If you have installed through HACS, then go to HACS and remove the Custom Component
- If you manually copied the files to your system, go to the
custom_components
directory and delete theunifiprotect
directory. - Edit
configuration.yaml
and remove all references to unifiprotect. Some have split the setup in to multiple files, so remember to remove references to unifiprotect from these files also. - I recommend to restart Home Assistant at this point, but in theory it should not be necessary.
- Install the new version
- If you use HACS, go there, and add Unifi Protect V0.5 or later.
- If you do it manually, go to Github and copy the files to
custom_components/unifiprotect
. Remember to include thetranslations
directory and the files in here. - Restart Home Assistant
- Now go to the Integration menu on the Configuration tab, and search for Unifi Protect. If it does not show up, try and clear your browser cache, and refresh your browser.
- From there, it should be self explanatory.
I will leave Release 0.3.4 as an option in HACS, so if you want to stick with the Yaml version, feel free to do so, but please note that I will not make any changes to this version going forward.
Hi Bjarne,
Thanks for all your efforts for V0.5, but how does it impact my āunifiprotect2ā. Do you have any recommendations how to deal with this?
Thanks, Johan
If the old entities say āidleā as a status, if you remove them from HomeAssistant - The new ones should get the original name after your next HomeAssistant reboot.
Hi Johan,
I forgot to mention in the Release Notes, but this version should now support more than one instance so it should support your scenario. As I only have one CloudKey I have not been able to test this.
Basically what you do is:
- Remove your old installations, both the unifiprotect and the unifiprotect2, by removing the directories under
custom_components
and removing all the references to them in your configuration files. - Restart Home Assistant
- Install V0.5 either through HACS or manually by copying the files in to
custom_components/unifiprotect
- Restart Home Assistant
- Go to Configuration Tab and then select Integrations from the menu, click the Yellow +Button at the bottom Right and search for Unifi Protect. You might need to refresh your browser or clear the cache for it to show.
- Now you can configure your first Instance
- Once this is setup, you can repeat the process with clicking the +Button and setup your second instance.
- If you have named the Cameras the same in both your setups, entities in your second instance will get _2 added to the end of its name, but you can rename this in the UI if you want to.
NOTE Please do a backup before you try this, as it has not been tested - but in theory it should work.
Hi Bjarne,
Thanks for all the awesome work you have done for Unifi Protect. It works exactly as you wrote and works like a charm! It took me a reboot after adding the second CK to get all cameraās in Lovelace, but now all is good.
Best, Johan
Hi Bjarne, we are using the brand new Protect NVR4 (with 4 hard drives), and the integration works for Camera streams (UDM mode with UnifiOS), but all motion sensors show up as unavailable.
Do you have any idea here?
Thanks!
Chris
Iām fairly new to HA and have a newbie question. I configured HACS and UniFi Protect and HA located my cameras, but cannot figure out how to get the camera feed on my dashboard. What do I need to do?
First enable the stream integration in your configuration.yaml
. Then follow these instructions from the docs.
Example lovelace config:
cards:
- type: picture-entity
entity: camera.uvc_g3_flex
camera_view: live
Hi Chris,
It would not surprise me, if Ubiquiti is introducing yet another way of serving the same software, so there can be changes in the way Events are delivered, and that way they are not found in the Event log, thus never getting a state. But the only way to check if you could dump the raw json that comes out of the NVR4 and post it.
Also try and activate the debug log function, by adding the below to configuration.yaml, and let me know if something shows up here.
logger:
default: error
logs:
custom_components.unifiprotect: debug