Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alarm_control_panel/alarm_arm_away. 'NoneType' object has no attribute 'replace' -> Alarm get's activated even without sensor bypassing user confirmation #923

Open
apfelklaus opened this issue Apr 9, 2024 · 1 comment
Labels
bug Something isn't working waiting for user input

Comments

@apfelklaus
Copy link

Alarmo Version

v1.9.15

HA Version

2024.4.2

Bug description

Error is shown in logs and UI that object has no attribute 'replace'
Alarmo responds, that alarm cannot be turned on because of e.g. an open window. BUT alarms get's activated in the background. UI still shows deactivated. Sensors like motion sensor are triggering the alarm and then UI afterwards shows correct state that alarm was triggered because of reason xyz.

Problem for the user:

  • Alarms get's activated even if bypassed sensor was not confirmed
  • system is active but UI shows inactive until triggered

Core
2024.4.2
Supervisor
2024.04.0
Operating System
12.1
Frontend
20240404.1

Steps to reproduce

Turning alarm on with a sensor that needs to be bypassed (e.g. open window)

Relevant log output

2024-04-09 19:44:54.041 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139696254310592] 'NoneType' object has no attribute 'replace'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 472, in async_alarm_arm_away
    await self.async_handle_arm_request(STATE_ALARM_ARMED_AWAY, code=code, skip_code=skip_code, bypass_open_sensors=bypass_open_sensors, skip_delay=skip_delay)
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 462, in async_handle_arm_request
    await self.async_arm(
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 1035, in async_arm
    await self.async_arm_failure(open_sensors, context_id=context_id)
  File "/config/custom_components/alarmo/alarm_control_panel.py", line 1059, in async_arm_failure
    command = self._target_state.replace("armed", "arm")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'
@apfelklaus apfelklaus added the bug Something isn't working label Apr 9, 2024
@apfelklaus apfelklaus changed the title alarm_control_panel/alarm_arm_away. 'NoneType' object has no attribute 'replace' alarm_control_panel/alarm_arm_away. 'NoneType' object has no attribute 'replace' -> Alarm get's activated even without sensor bypassing user confirmation Apr 9, 2024
@nielsfaber
Copy link
Owner

I'm unable to reproduce this issue.
If I arm alarm while a sensor is open, I see that the arming fails (alarm returns to disarmed state) and no errors are shown in the logs.
Could you provide more information for me to be able to see the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for user input
Projects
None yet
Development

No branches or pull requests

2 participants