Bosch Solution 2000 / 3000 Alarm Integration

Your right, i can read the history out, but i have no idea where i would actually put that information in home assistant. Any ideas where it could go?

Trying to understand their decompiled code was a pain and a half though haha, and the code to parse the histories is just horrid but it does seem to work.

For the moment, it’s exposed as an attribute on the alarm panel itself, but you cant see this via the UI yet, however it does show up if you look at the state under developer tools

I’m wondering once you have the logs could you make your code output it as a json file maybe? Then HA can read the json file?

I wanted to ask, does the script poll or the alarm/network module pushes to the plugin?

I can get it to home assistant no problem, i just have no idea how you would even display that kind of data in home assistant. In fact with the latest version the history data is in home assistant it just isn’t visible from the GUI at the moment, only if you view the panel state in dev tools

It polls as annoyingly I couldn’t get it to push data.

Do you have a screenshot of it? Sorry I don’t even have a S2/3000 but will be getting one soon because of this integration :slight_smile:


i can format it how i want, but this is what we get

state_attr('alarm_control_panel.1', 'panel_history')

This should display it in lovelace?

Maybe to keep it clean make it output something like this?
2022-03-30 08:00:00 | Example Message 1
2022-03-30 08:00:00 | Example Message 2

Super excited and trying to get my Solution 2000 system integrated, however running into issues.

After adding the integration and configuring, I see the “Successfully authenticated” and config created modal in home assistant. After dismissing this the integration immediately shows an error:

ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for solutions3000
File "/config/custom_components/solutions3000/__init__.py", line 30, in async_setup_entry
File "/config/custom_components/solutions3000/solution3000.py", line 564, in initialise
File "/config/custom_components/solutions3000/solution3000.py", line 401, in _authenticate
custom_components.solutions3000.solution3000.PanelException: Invalid App Passcode

The alink pin must be right otherwise it can’t authenticate, and the automation code is still set at the default and matches what Alink plus is telling me, so I’m not sure what else the “app passcode” is referring to. Any ideas?

Have you possibly got ALink or the RSC+ app open? having either of them open would give you that error as well


your right, made a markdown card and threw that in there and it worked.

type: markdown
content: '{{state_attr(''alarm_control_panel.1'', ''panel_history'')}}'
title: Event History

Awesome! Would it be possible to have the latest events at the top?

already on it, have just flipped it in the version that was just put out

Checked I’m logged out of RSC, Alink is not running, and I’m not logged on into the IP module web interface.

I restarted HA and saw this:

2022-03-30 13:16:30 INFO (MainThread) [homeassistant.setup] Setting up solutions3000
2022-03-30 13:16:30 INFO (MainThread) [homeassistant.setup] Setup of domain solutions3000 took 0.0 seconds
2022-03-30 13:16:58 ERROR (MainThread) [custom_components.solutions3000] Unexpected error fetching solutions3000_panel data: index out of range
File "/config/custom_components/solutions3000/solution3000.py", line 556, in update_status
File "/config/custom_components/solutions3000/solution3000.py", line 424, in _req_history
2022-03-30 13:16:58 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Home' for solutions3000 integration not ready yet: index out of range; Retrying in background
2022-03-30 13:17:03 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for solutions3000
File "/config/custom_components/solutions3000/__init__.py", line 30, in async_setup_entry
File "/config/custom_components/solutions3000/solution3000.py", line 568, in initialise
File "/config/custom_components/solutions3000/solution3000.py", line 401, in _authenticate
custom_components.solutions3000.solution3000.PanelException: Invalid App Passcode

Is there anything I need to enable in the IP module? There are a bunch of options like Legacy TCP Automation Enable (currently off), Port 77EE Configuration Enable (set to no) etc.

Try the new version that i’ve just released - turns out that the automation code isn’t needed and since that was the part you were failing with, maybe the update will fix that.

Just tried it. I can’t add the integration at all now. After entering in the details, it spins and then appears as follows (it blanks out the entries again on error). No modal confirmation and nothing appears in the logs either :thinking:

How long does it spin for?

Also, could you try the pincode you use in rsc+? In theory in using the same authentication as rsc+ now so if that works than so should

Also if you restart home assistant does it finally print something to the logs just before restarting?

By using the normal user code it authenticates but throws an exception.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/solutions3000/solution3000.py", line 561, in update_status
    await self._req_history()
  File "/config/custom_components/solutions3000/solution3000.py", line 429, in _req_history
    year = 2000 + ((section[3] & 0xFC) >> 2)
IndexError: index out of range

I got it to work for now by editing the _req_history function and adding an immediate break on line 420 to bypass the function.

image

Something is off with the way the request history year is parsed (date format/locale issue?)

I wonder the solution 2000 hands data back differently

Is there a way to dump the raw contents of the data variable so you can see? Not familiar with how HA components work but if you give me the source changes, I can apply them and send the raw output received from the panel.

can you try the version i just pushed out?
if that doesn’t give you any history data, change that bit in req_history just after the while True: to

                data = await self._xfer_packet(Commands.GetRawHistoryEventsExtended, 0xFE, [0xff],struct.pack(">i",self.last_history_message))
                count = struct.unpack("<i", data[1:5])[0]
                self.history_messages.append(HistoryMessage(datetime(), str(data), 0, 0, 0))
                if not count or len(data) <= 6:
                    break

and then give me all the information that it puts into the panel_history attribute, it will be the raw information

I had to modify the datetime call a bit to put in a dummy date/time

self.history_messages.append(HistoryMessage(datetime.datetime.now(), str(data), 0, 0, 0))

Here’s the output …

code_format: null
changed_by: null
code_arm_required: true
panel_history: 2022-03-31 14:50:24.423762 | b'\xfe\x14\x00\x00\x15\x11m\xe4zX\x00\x00/\x00\x83\xe5gX\x01\x002\x00\x96\xe5cX\x01\x000\x00\x1f\xeavX\x01\x002\x00\xb0\xeckX\x01\x00/\x00\xad\xedvX\x01\x002\x00\xf5\xed\\X\x00\x000\x00\x1b\xf2DX\x01\x002\x00g\xf3JX\x01\x00/\x00\xef\xf3ZX\x01\x002\x00F\xf4gX\x01\x00/\x00P\xf5RX\x01\x002\x00\xda\xf5IX\x00\x000\x00\xb2\xf9JX\x01\x002\x00\xec\xf9qX\x01\x00/\x00\x1c\xfaIX\x01\x002\x00\xce\xfdeX\x01\x00:\x00\xb7\t\xabX\x01\x002\x00\x99\x0c\x97X\x01\x00/\x00\x04\r\xa2X\x01\x002\x00'
2022-03-31 14:50:22.183665 | b'\xfe\x14\x00\x00\x15\x11m\xe4zX\x00\x00/\x00\x83\xe5gX\x01\x002\x00\x96\xe5cX\x01\x000\x00\x1f\xeavX\x01\x002\x00\xb0\xeckX\x01\x00/\x00\xad\xedvX\x01\x002\x00\xf5\xed\\X\x00\x000\x00\x1b\xf2DX\x01\x002\x00g\xf3JX\x01\x00/\x00\xef\xf3ZX\x01\x002\x00F\xf4gX\x01\x00/\x00P\xf5RX\x01\x002\x00\xda\xf5IX\x00\x000\x00\xb2\xf9JX\x01\x002\x00\xec\xf9qX\x01\x00/\x00\x1c\xfaIX\x01\x002\x00\xce\xfdeX\x01\x00:\x00\xb7\t\xabX\x01\x002\x00\x99\x0c\x97X\x01\x00/\x00\x04\r\xa2X\x01\x002\x00'
2022-03-31 14:50:20.311683 | b'\xfe\x14\x00\x00\x15\x11m\xe4zX\x00\x00/\x00\x83\xe5gX\x01\x002\x00\x96\xe5cX\x01\x000\x00\x1f\xeavX\x01\x002\x00\xb0\xeckX\x01\x00/\x00\xad\xedvX\x01\x002\x00\xf5\xed\\X\x00\x000\x00\x1b\xf2DX\x01\x002\x00g\xf3JX\x01\x00/\x00\xef\xf3ZX\x01\x002\x00F\xf4gX\x01\x00/\x00P\xf5RX\x01\x002\x00\xda\xf5IX\x00\x000\x00\xb2\xf9JX\x01\x002\x00\xec\xf9qX\x01\x00/\x00\x1c\xfaIX\x01\x002\x00\xce\xfdeX\x01\x00:\x00\xb7\t\xabX\x01\x002\x00\x99\x0c\x97X\x01\x00/\x00\x04\r\xa2X\x01\x002\x00'
2022-03-31 14:50:18.429082 | b'\xfe\x14\x00\x00\x15\x11m\xe4zX\x00\x00/\x00\x83\xe5gX\x01\x002\x00\x96\xe5cX\x01\x000\x00\x1f\xeavX\x01\x002\x00\xb0\xeckX\x01\x00/\x00\xad\xedvX\x01\x002\x00\xf5\xed\\X\x00\x000\x00\x1b\xf2DX\x01\x002\x00g\xf3JX\x01\x00/\x00\xef\xf3ZX\x01\x002\x00F\xf4gX\x01\x00/\x00P\xf5RX\x01\x002\x00\xda\xf5IX\x00\x000\x00\xb2\xf9JX\x01\x002\x00\xec\xf9qX\x01\x00/\x00\x1c\xfaIX\x01\x002\x00\xce\xfdeX\x01\x00:\x00\xb7\t\xabX\x01\x002\x00\x99\x0c\x97X\x01\x00/\x00\x04\r\xa2X\x01\x002\x00'

It seems to be pulling every single event so I didn’t paste it all. I have a LOT of events for the past 2 years and it’s still updating. Maybe there needs to be a config option to only fetch the latest X entries too?