fwmarcel / home-assistant-divera

This is a custom component that allows to address the Divera 24/7 alarm software from Home Assistant.
48 stars 11 forks source link

divera_alarm sensor not working #8

Closed dabenzel closed 1 year ago

dabenzel commented 1 year ago

Hi, I added your integration to HA. Interestingly, the user_status is working correctly, but the divera_alarm sensor isn't.

I the Logs, I get the following message:

Source: core.py:1624
First occurred: 10:05:22 (2 occurrences)
Last logged: 10:08:59

Unable to remove unknown service divera/set_state

I use divera with two tenants (Einheiten). Is this maybe the Problem? The user status is from one tenant. image

fwmarcel commented 1 year ago

Hello, Indeed, I am not sure about that. But it could have to do with dual membership. I do not have this myself. Do I understand correctly that different statuses can be set for each unit?

Is there any other information in the log?

Greetings

dabenzel commented 1 year ago

Hi, yes.

See attached: Unit1: image Unit 2: image

Thats the whole log, filtered by "divera" image

Added the integration yesterday and re-added it today, nearly 10:00h

fwmarcel commented 1 year ago

In fact, I have not yet considered this possibility. I will have a closer look in the next few days. If necessary, I need feedback if the problem is then solved.

Does the problem only affect the alarms or also the status?

dabenzel commented 1 year ago

Hi, alarm sensor not working at all. Status sensor only shows the status of "unit 2" above (which was my first unit in my account) - but setting status for this works fine.

fwmarcel commented 1 year ago

Hi I have taken a quick look at the situation. It definitely has nothing to do with the fact that multiple units are assigned to you. By default, the unit set in the settings is used. All further units are not supported so far. I could take this up as a feature request. However, I don't yet have a precise and simple idea of how this could be represented in Home Assistant.

The reason why the alarm sensor does not work must therefore be due to another cause. Interesting that you say that the status works. Especially, because in the log messages, it also looks to me rather like there would be connection problems. Therefore the question: Is there currently an alarm in your unit 2 at all? If not, the Unknown status is desired.

dabenzel commented 1 year ago

Hi, after changing my main unit, it works. (Did the test-alarm in unit 2, but my main unit was 1) Status ist btw now from unit 2 too.

image

I think the Problem is on divera site as you don't have an api key per person per unit, but only per person.

fwmarcel commented 1 year ago

hi the integration works with the standard Divera API, which uses the default unit. https://api.divera247.com/?urls.primaryName=api%2Fv2%2Fpull#/Daten/get_api_v2_pull_all I will add an option to select the unit when adding the integration.

dabenzel commented 1 year ago

Nice! Would it also be possible to get the Lat/Lon of the alarm on the ha-map?

fwmarcel commented 1 year ago

Would you be so kind to create a new issue for this? in the best case with a description as detailed as possible, how you imagine the whole thing. i will follow the development at this point and include this as a feature request.

N1c093 commented 1 year ago

Thats the whole log, filtered by "divera" image

I also had the same timeout error some days ago. I noticed, that the configured timeout of the request is only 2 seconds. I expand the timeout to 4 seconds and this solved my problem https://github.com/fwmarcel/home-assistant-divera/blob/9d1aafa253b4cae3ddd64532c82b68a998bd2e45/custom_components/divera/const.py#L17

@fwmarcel Is there any reason why the timeout is only 2 seconds? This seems to be pretty short for me.

fwmarcel commented 1 year ago

Thanks for pointing this out. So far I did not experience the timeout error. I had set the timeout so that it worked for now. Accordingly, I had not thought about it so far. I consider the change soon.