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

Feature request: Smoke Detector 2 trigger Intrusion Alarm Button #174

Open
UnleashedMors opened this issue Mar 25, 2024 · 0 comments
Open

Comments

@UnleashedMors
Copy link

UnleashedMors commented Mar 25, 2024

Is there any way to add a button to trigger the smoke alarm or the intrusion alarm.

I want to use the smoke detector as siren for my security system via home assistant.

I think should be possible because you can set the alarmstate via mqtt but not via integration.

ps. Sorry for wrong format, it is my first issue/feature request.

I have made tests for alarm states INTRUSION_ALARM, IDLE_OFF, SECONDARY_ALARM, PRIMARY_ALARM but all give the same error results.

UPDATE_1: 01.04.2024

`Logger: homeassistant.components.websocket_api.http.connection
Quelle: custom_components/bosch_shc/binary_sensor.py:369
Integration: Home Assistant WebSocket API (Dokumentation, Probleme)
Erstmals aufgetreten: 19:16:04 (2 Vorkommnisse)
Zuletzt protokolliert: 19:24:39

[547446350272] Error handling message: Unknown error (unknown_error) Steffen from 192.168.178.119 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36)
[546184390464] Error handling message: Unknown error (unknown_error) Steffen from fe80::834f:cde5:a1dd:6e5b (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 795, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1600, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 435, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 487, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 512, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 485, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 723, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/bosch_shc/binary_sensor.py", line 374, in async_request_alarmstate
await self._hass.async_add_executor_job(set_alarmstate, self._device, command)
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/bosch_shc/binary_sensor.py", line 369, in set_alarmstate
device.alarmstate = command
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/boschshcpy/models_impl.py", line 221, in alarmstate
self._alarm_service.put_state_element("value", state)
File "/usr/local/lib/python3.12/site-packages/boschshcpy/device_service.py", line 58, in put_state_element
self.put_state({key: value})
File "/usr/local/lib/python3.12/site-packages/boschshcpy/device_service.py", line 51, in put_state
self._api.put_device_service_state(
File "/usr/local/lib/python3.12/site-packages/boschshcpy/api.py", line 184, in put_device_service_state
self._put_api_or_fail(api_url, state_update)
File "/usr/local/lib/python3.12/site-packages/boschshcpy/api.py", line 102, in _put_api_or_fail
self._process_nok_result(result)
File "/usr/local/lib/python3.12/site-packages/boschshcpy/api.py", line 123, in _process_nok_result
raise SHCSessionError(
boschshcpy.exceptions.SHCSessionError: SHC Error (message: API call returned non-OK result (code 422)!: b'{"@type":"JsonRestExceptionResponseEntity","errorCode":"JSON_MAPPING_FAILED","statusCode":422}')
`

I have found the tested states in the boschpy library under
https://github.com/tschamm/boschshcpy/blob/master/boschshcpy/services_impl.py Class AlarmService()

I dont know if this error is related in the boschshc or in the bosch python library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant