Prosegur Alarms Component

About the images from cameras, unfortunately at this moment there’s no way to know when the image was obtained. The “Last Update” property changes, no matter if the actual retrieved image does.

As a feature request, maybe we could try detecting when the retrieved camera image changed for the last time, so we can have a timestamp of the first time the existing image was retrieved from Prosegur…

What do you think, @dgomes ?

Haven’t found any information in the API about the time the picture was requested.

Since we are working in parallel (the App and HA) it is also not feasible to rely on HA keeping track of the time the last picture was requested… :confused:

If someone finds something in the API, I will gladly change that! The base library is at GitHub - dgomes/pyprosegur: Smart Prosegur Library if someone would like to give it a try.

Yes, I know.

As this feature is not provided by API (nor it’s being shown at the official App), that’s why I proposed doing this exclusively at the HA side, keeping track of the last time the image from the Prosegur API changed.

I don’t care about when the image was requested, but about having a (maybe only) approximate idea about when the image has last changed.

For example, in the HA side we could keep a cached copy of the last image and update the “last updated” property when we receive a different one, overwriting the last cached image…

The camera entity does not have the attribute last_updated :confused:

oh, I understand, as supposedly a camera has moving images :slight_smile:

But we still could have a new entity for this…

Good day. I have not been able to find on the web if the integration works with Movistar Prosegur alarms. Anybody will be willing to confirm? Thank you. Have a good one.

Yes, I confirm it works with Movistar Prosegur alarms as well in Spain.

Appreciated @davefx. Gracias!.

Hi!
Today I’m having problems with the integration in Spain. It’s it working for any of you?

All good, but now or then the website is down (and therefore so is the integration)

I’m afraid there could be something else…
The website is up, but it seems the plugin cannot retrieve contracts from there:

Logger: homeassistant.components.alarm_control_panel
Source: components/prosegur/alarm_control_panel.py:76
Integration: Alarm Control Panel (documentation, issues)
First occurred: 2 de octubre de 2023, 20:25:01 (5 occurrences)
Last logged: 05:12:34

prosegur: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 573, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 936, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/prosegur/alarm_control_panel.py", line 76, in async_update
    self._installation = await Installation.retrieve(self._auth, self.contract)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyprosegur/installation.py", line 109, in retrieve
    raise NotFound(f"Contract {contractId} not found")
pyprosegur.exceptions.NotFound: Contract ******(redacted) not found

Logger: homeassistant.components.camera
Source: components/prosegur/camera.py:37
Integration: Camera (documentation, issues)
First occurred: 2 de octubre de 2023, 20:25:01 (5 occurrences)
Last logged: 05:12:34

Error while setting up prosegur platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/prosegur/camera.py", line 37, in async_setup_entry
    _installation = await Installation.retrieve(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyprosegur/installation.py", line 109, in retrieve
    raise NotFound(f"Contract {contractId} not found")
pyprosegur.exceptions.NotFound: Contract *****(redacted) not found

Give it a try with the CLI tool:

Ok. The Python library worked, so I tried to remove my previous integration and recreat its configuration from scratch…
It seems that my contract ID, according to the API, has changed.

Everything is working now, but I’ve had to reconfigure my setup, changing the IDs for the alarm entities (so I don’t have to change all the automations using it).

Hmmm… this is very interesting, the contract ID changed… it should have been unique…

Thank you! Tested and working on Paraguay by using Argentina as country. One question: had you been able to obtain status of the individual door sensors? I’m planning to get an RF hub and sniff the communication between the alarm controller and sensors. Until know the only thing I know is that the model that prosegur uses here un Paraguay (DC-23) operates either in 433 or 868 MHz, but after looking closely to a sensor, there is no way to know the specific frequency.

Prosegur use different hardware in each country and even inside each country… so hard to tell :confused:

I will add Paraguay country code :slight_smile:

1 Like