Coder Social home page Coder Social logo

fwmarcel / home-assistant-divera Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 11.0 379 KB

This is a custom component that allows to address the Divera 24/7 alarm software from Home Assistant.

Python 95.79% Shell 0.66% JavaScript 3.54%
divera divera247 hacs home-assistant homeassistant integration

home-assistant-divera's People

Contributors

dabenzel avatar dependabot[bot] avatar fwmarcel avatar n1c093 avatar renovate[bot] avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

home-assistant-divera's Issues

Frage

Hallo Marcel, kurze frage wie kann man die restlichen Infos, die von einem Alarm übertragen werden, auslesen? Wenn ich den Sensor auf das Dashboard lege sehe ich nur das Stichwort.
mit freundlichen Gruß
Paul

Divera Alarm Sensor not available

This sensor is shown in home assistant as not provided by the Integration.
It only worked one time, when I reinstalled the integration.

This error is visible:

`Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.helpers.entity
Source: custom_components/divera/connector.py:118
Integration: Divera 24/7 (documentation, issues)
First occurred: 15. April 2023 um 09:23:56 (4375 occurrences)
Last logged: 21:51:33

Update for select.divera_user_status fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 755, in async_device_update
raise exc
File "/config/custom_components/divera/select.py", line 56, in async_update
await self._coordinator.async_request_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 200, in async_request_refresh
await self._debounced_refresh.async_call()
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 89, in async_call
await task
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 226, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 341, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 142, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 568, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 635, in _async_write_ha_state
attr.update(self.extra_state_attributes or {})
File "/config/custom_components/divera/sensor.py", line 66, in extra_state_attributes
return self._connector.get_last_alarm_attributes()
File "/config/custom_components/divera/connector.py", line 98, in get_last_alarm_attributes
"groups": list(groups),
File "/config/custom_components/divera/connector.py", line 118, in __search_group
group = self.data["data"]["cluster"]["group"][str(group_id)]
KeyError: '23636'
`

Docker-Image für HA-Core

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Nicht vorhandener Addon store bei nutzung von homeassistant-core

Describe the solution you'd like

Moin, gäbe es die möglichkeit ein das du deine intigration auch als Docker image/compose config anbietest?
Wäre für die die homeassistant-core nutzen bestimmt sehr praktisch.

liebe grüße.

Describe alternatives you've considered

No response

Additional context

No response

divera_alarm sensor not working

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

[Feature]: Option to enter custom DIVERA_URL and DIVERA_STATUS_URL for own instances seperated from the central divera247.com

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

For Divera Instances that are not hosted directly at divera247.com but at an own Instance at app.[cityname].divera247.de it is not possible to use the Integration without manual changes to const.py.

I have to adjust these lines:
DIVERA_URL: str = "https://www.divera247.com/api/v2/pull/all"
DIVERA_STATUS_URL: str = "https://www.divera247.com/api/v2/statusgeber/set-status"

to:
const.py:DIVERA_URL: str = "https://app.[cityname].divera247.de/api/v2/pull/all"
const.py:DIVERA_STATUS_URL: str = "https://app.[cityname].divera247.de/api/v2/statusgeber/set-status"

Describe the solution you'd like

As updates always reset the custom changes to const.py I would be happy to see an option to enter custom DIVERA_URL and DIVERA_STATUS_URL in the GUI and have them preserved through future updates.

Describe alternatives you've considered

No response

Additional context

For reasons our city decided to get its own instance hosted at a custom URL at divera247.de in the form of https://app.[cityname].divera247.de. Maybe there are other cities and communities that do this and it would be very helpful for ease of use to enter the custom URL during setup in the GUI.

Anyway thanks for the already very great integration!

Abort keyword is not optional in blueprint

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

left "(optional) Abort keyword" blank

Expected Behavior

no keyword necessary to save the blueprint

Steps To Reproduce

download blueprint, configure without optional abord keyword, try to save, see error-message: "Message malformed: Missing input abort_keyword"

Context

YAML state

Environment

- HA Version:
- Mushroom:

Anything else?

No response

[Bug]: Only getting "alarm" and "user_status" entities

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

I only get the entities "alarm" and "user_status", even after a alarm there was no change to that.

Expected Behavior

As described in the documentation here on GitHub:

You can enable the ones you like in HA UI under "Configuration" → "Entities" → click on the filter icon on the right → Check "Show diabled entities" → Check the ones you like to enable → Click "ENABLE SELECTED" at the top → Confirm the next dialog

The sensor values will be set when the next update is scheduled by Home Assistant. This is done every minute.

Steps To Reproduce

  1. install home-assistant-divera via HACS
  2. add it under "integration" with my Divera24/7 API Code

Context

No response

Environment

- HA Version: 2024.3.3
- Divera Version: 1.0.1

Anything else?

No response

can't find it in hacs

The Divera Repo can't be found in hacs actually

image

also the button in the readme doesn't work an directs to a 404 error page

image

Dir not find the Integration

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Hi,

I now have opened a new issue.
HA ist complete new for me.

Cloud you please tell me how to geht the Integration?

Thanks ans best regards
Tobi

Expected Behavior

No response

Steps To Reproduce

No response

Context

YAML state

Environment

- HA Version:
- Mushroom:

Anything else?

No response

[Feature]: Response to alarm Attribute / Sensor

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

I use this integration to start automations that trigger light or notifications, when I get a new alarm. But sometimes I can't leave home, so I respond with "Nicht einsatzbereit" to the alarm. Then all automations still go on, because there is no attribute / sensor to use my response as an condition to stop it.

Describe the solution you'd like

I don't know if the Divera API features something like this, but it would be great to have the response to the alarm as an attribute to the alarm sensor.

Describe alternatives you've considered

No response

Additional context

No response

Unable to change user satus in pre-releese 0.0.8

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

If I change the user status, I get the error:
Failed to call service select/select_option. 'DiveraData' object has no attribute 'get_state_if_from_name'

Expected Behavior

User status should change.

Steps To Reproduce

Install version 0.0.8 and attempt to change the user status.

Context

No response

Environment

- Core: 2024.2.2
- Supervisor: 2024.01.1
- Operating System: 11.5
- Divera Version: 0.0.8

Anything else?

Changing back to version 0.0.7 fixed the issue for me.

[Bug]: Setup no longer possible

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

When I click on "add integration" or "add a new entity", I get a popup that just says

Config flow could not be loaded: {"message":"Invalid handler specified"} 

Expected Behavior

No response

Edit: I had it running before, so it should work as far as I am concerned...

Steps To Reproduce

No response

Context

Log:

Logger: homeassistant.config_entries
Source: config_entries.py:865
First occurred: 7:14:15 PM (5 occurrences)
Last logged: 7:21:01 PM

Error occurred loading flow for integration divera: cannot import name 'ConfigFlowResult' from 'homeassistant.config_entries' (/usr/src/homeassistant/homeassistant/config_entries.py)

Environment

- HA Version: Home Assistant 2023.8.1
- Divera Integration Version: 1.2.1

Anything else?

No response

[Feature]: Add Alarm-Number to Alarm-Sensor in HA

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Describe the solution you'd like

When having placed an automation on the Alarm-Sensor in HomeAssistant and the Keyword changes/increases (FEU -> FEU 2 -> ...) the automation always fires because the alarm gets updated in Divera.
When the trigger is something stable like the Divera Alarm-Number, you can avoid the automation always firing

Describe alternatives you've considered

No response

Additional context

No response

[Bug]: Untereinheiten werden nicht erkannt.

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Wenn man in mehreren Untereinheiten ist wir immer nur die Haupteinheit (Masteraccount) ausgelesen.

Expected Behavior

Es müssten mehrere Untereinheiten mit der selben ID abgefragt werden können.

Steps To Reproduce

No response

Context

YAML state

Environment

- HA Version:
- Mushroom:

Anything else?

Moin,
ich arbeite in einer Leitstelle. Mein Kollege hat mit Divera gesprochen und es gibt eine undokumentierte API Abfrage dafür.
Er hat das für i.O. Broker implementiert.
Wenn Interesse besteht bitte melden dann würde mein Kollege Dir gerne Zeigen was gemacht werden muss.
[email protected]

[Bug]: Can't setup integration after update to 1.0.1

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

I just updated from 0.07 to version 1.0.1. Now the integration doesn't start successfully. I get the following error in the log:

2024-03-27 20:03:07.423 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry (my Name) for divera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/divera/__init__.py", line 50, in async_setup_entry
    cluster_name: str = clusters[str(ucr_id)]
                        ~~~~~~~~^^^^^^^^^^^^^
KeyError: '(my ID)'

I already tried to delete my configuration and restarted the setup flow, sadly the issue still exists.

Was I too quick with the update and you are already aware of this bug?

Expected Behavior

No response

Steps To Reproduce

No response

Context

YAML state

Environment

- HA Version: 2024.3.3
- Divera Version: 1.0.1

Anything else?

No response

Warning - "device_state_attributes" deprecated

Hello,

in my log I get the following warning:

2022-03-02 10:55:40 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.divera_state (<class 'custom_components.divera.sensor.DiveraSensor'>) implements device_state_attributes. Please report it to the custom component author.

Thank you.
Nico

Continuous error - Task exception was never retrieved

Hello,

when there is currently no active alarm, I get the following error every minute:

2022-03-02 11:43:41 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in _stringify_state
    if (state := self.state) is None:
  File "/config/custom_components/divera/sensor.py", line 133, in state
    result = self._connector.get_last_alarm()
  File "/config/custom_components/divera/connector.py", line 96, in get_last_alarm
    last_alarm_id = self.data["data"]["alarm"]["sorting"][0]
IndexError: list index out of range

I think, it try to parse through the index, but without any active alarm, there isn't any index 0.

Thank you in advance.

Prüfintervall

Hi, ist es möglich den Intervall wo der die Alarme testet zu verringern?
Glaube derzeit liegt der bei 60 sec.
Da ich aber damit auch die Beleuchtung steuern möchte im Einsatzfall sind 60 sec sehr lang wenn der nicht zufällig kurz nach Alarm prüft.

Mfg
EasySIX

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/lint.yml
  • actions/checkout v3.5.3
  • actions/setup-python v4.7.0
.github/workflows/release.yml
  • actions/checkout v3.5.3
  • softprops/action-gh-release v0.1.15
.github/workflows/validate.yml
  • actions/checkout v3.5.3
  • actions/checkout v3.5.3
pip_requirements
requirements.txt
  • colorlog ==6.7.0
  • homeassistant ==2023.2.0
  • ruff ==0.0.284
  • pip >=21.0,<23.3
  • black ==23.7.0

  • Check this box to trigger a request for Renovate to run again on this repository

[Bug]: Alarm Answer "Not answered"

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Seit neustem zeigt die Integration nur noch "Not answered" beim Attribut "Answered" an, obwohl ich auf den letzten Alarm geantwortet habe.

Expected Behavior

No response

Steps To Reproduce

No response

Context

YAML state

Environment

- HA Version: 2024.5.2
- Divera: 1.1.1

Anything else?

No response

[Feature]: Sensor for vehicle status

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

Do you think it might be interesting to have the vehicle status as sensors inside home assistant? For myself I don't really need it, but maybe some other users have a need for it.

I noticed that the vehicle status can also be pulled from this api endpoint https://app.divera247.com/api/v2/pull/all
In this JSON path you can see the status data.cluster.vehicle.XXXXX.fmsstatus_id
The XXXXX have to be replaced by the real ID.

Describe alternatives you've considered

No response

Additional context

Maybe I could also try to implement it. I'm not really familiar with programming, but I could give it a try.
But first I would like to have you opinion to this kind of sensor.

Alarm schon bei closed = true nicht mehr anzeigen

Moin!
Ich habe bei mir das "Problem", dass bei mir ein geschlossener Alarm noch weiterhin angezeigt wird. In der Divera App ist der beendet.
Siehe:
image

Der Sensor ist jedoch weiterhin aktiv.
Könnte man eine Option einbauen, dass ein geschlossener Alarm den Sensor schon wieder auf "nicht verfügbar" stellt?


Erklärung:
Wir können die Alarme in Divera frühestens nach 24h Archivieren (das würde den Sensor ja wieder ändern), da die LST bei jeder Aktualisierung des Alarms (Status, Nachalarmierung, etc) den Divera-Alarm aktualisiert.
Wenn wir den Alarm vorzeitig archivieren würden, würde eine neualarmierung stattfinden, was nicht gewollt ist.

[Feature]: Extend the automation Template for Groups in Alarm

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

I am an Admin of our Brigade in Divera. There are different Groups which are alarmed for different RICs.
My User is in one of these groups. Because I am an Admin, I can see the Alarm in the App (but I dont get a notification).

Problem: Also in Divera the Sensor is in "Alarm"-State and my automation runs. Even if the alarmed Group is not one of which I am member of.

Describe the solution you'd like

Extend the Automation Template so it is possible to also filter on Groups (Maybeo not really good, because the Name can change)

Describe alternatives you've considered

Enrich the Automation with Group-Checks

Additional context

Maybe not easy since HomeAssistant doesn't know the Groups I am part of. So a DropDown isn't possible, only String-Matching

[Bug]: Blueprint has an error

Requirements

  • I have updated Divera Integration to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

When installing the blueprint it returns an unknown error

Expected Behavior

No response

Steps To Reproduce

No response

Context

YAML state

Environment

- HA Version:
- Mushroom:

Anything else?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.