Sector Alarm

This Component may also Work:

@endor No real reason for the timeout, mostly a precaution.

I haven’t been very active with this lately, had some issues with sector and so on. But since I removed the thermometers from the config it seem to work quite well.

Also, I just pushed an update to the plugin so that the version string can be set from the config, this way it will be much easier to handle non-breaking version changes from Sector.

Noob question: is it possible to connect to Sector alarm using Hassio? Or does this require usage of another installation of HA?

All right, I think I got it installed now, but the log claims that the version is invalid…

Log Details (ERROR)
Thu Nov 21 2019 19:16:10 GMT+0100 (centraleuropeisk normaltid)
Error during setup of component sector_alarm
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 172, in _async_setup_component
hass, processed_config
File “/config/custom_components/sector_alarm/init.py”, line 71, in async_setup
await sector_data.update()
File “/config/custom_components/sector_alarm/init.py”, line 130, in update
*[task() for task in self._update_tasks])
File “/config/custom_components/sector_alarm/init.py”, line 153, in _update_temperatures
temperatures = await self._async_sector.get_temperatures()
File “/usr/local/lib/python3.7/site-packages/asyncsector/asyncsector.py”, line 76, in get_temperatures
return await get_json(request)
File “/usr/local/lib/python3.7/site-packages/asyncsector/util.py”, line 19, in get_json
raise Exception(“Error from api: %s” % result)
Exception: Error from api: "INVALID_VERSION

Try version: 'v1_1_76'
Works for me.

thanks! Now it works fine!

There is now another problem…
something seems to be wrong in the init.py-file
log:
“Sector Alarm failed previous update, trying to login again”

Did it start working again?
I think the Sector web is unreliable. I get WARNING (MainThread) [homeassistant.helpers.entity] Update of alarm_control_panel.sector_alarm_123456789 is taking over 10 seconds all the time.

Yes, it is now finally up running correctly.

Upgraded to 0.103.0 today and Sector Alarm didn’t work afterwards. (Running hass.io). Tryed the non-async version but didn’t work-
Reverted back to 102 and it works again.

And since I really like it I will stay on 102 and hope it will be fixed soon :slight_smile:

2019-12-12 18:53:06 ERROR (MainThread) [homeassistant.components.alarm_control_panel] Error while setting up platform sector_alarm
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/config/custom_components/sector_alarm/alarm_control_panel.py", line 25, in async_setup_platform
    async_add_entities([SectorAlarmPanel(sector_hub, code, code_format)])
TypeError: Can't instantiate abstract class SectorAlarmPanel with abstract methods supported_features
1 Like

Hi!
I’ve created a PR for the hass-sectoralarm to work with new service calls in v0.103
See if it works for you https://github.com/mgejke/hass-sectoralarm/pull/27
Replace the alarm_control_panel.py file and restart.

2 Likes

Worked like a charm, thanks!

@mgejke I hope all is well with you.
There are two PR’s waiting to be merged in to the git repo.
Can you please merge these?

I am running 0.103.6 with Hassio, and the version of code on Github with the latest commit bdeff61.
The alarm panel works as intended, but the temp sensors are not created.
The log file shows that the temperature is fetched from all devices, but I can´t find a way to display them. I do, of course, have thermometers: true in the config. I have also tried a complete host reboot, and not just Hassio restart.

2020-01-13 10:11:26 DEBUG (MainThread) [custom_components.sector_alarm] Fetched temperatures: [{'Id': None, 'Label': 'Sovrum', 'SerialNo': '24901275A35', 'Temprature': '22', 'DeviceId': None}, {'Id': None, 'Label': 'KÜk', 'SerialNo': '24401272F01', 'Temprature': '20', 'DeviceId': None}, {'Id': None, 'Label': 'Källare', 'SerialNo': '24101274D53', 'Temprature': '19', 'DeviceId': None}]

EDIT: Solved it. In line 70 of init.py i changed thermometers = config[DOMAIN].get(CONF_THERMOMETERS, False) to True, and it works like a charm!

Hi!

New here, really enjoy the Sector Alarm, working like a charm!

I wounder if there is a way to fetch the door sensor’s some way? Would be great so i dont need to buy some more of these…

Hello @endor, I get this error. Timeout every time. On my HASS install I had to manually run the “pip install asyncsector” because it dit not install it by itself (like I get the impression it should). Anyways I was wondering how I can force sector_alarm to use the asyncsector from the gitrep? I tried putting the asyncsector in a subfolder of sector_alarm but still it uses the pip installed version.

I had to change the timeout to get it to work. I just changed the default 10 to 90 and then it works perfectly. But every upgrade of hass or asyncsector I have to connect to the docker container and change the .py file (until pip installs a version without the timeout). Any pointers? Thanks!

Hi @corvy I have no problem without the thermometers now.

But when i want to use asyncsector locally in a subfolder /sector_alarm/asyncsector i change the import of asyncsector to be with a dot like this in sector_alarm/__init__.py:

from .asyncsector import AsyncSector

1 Like

Thanks alot @endor. I did exactly this and it works perfect!

2020-02-17 10:41:00 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for sector_alarm which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.

2020-02-17 10:41:11 INFO (MainThread) [homeassistant.setup] Setting up sector_alarm

2020-02-17 10:41:21 WARNING (MainThread) [homeassistant.setup] Setup of sector_alarm is taking over 10 seconds.

2020-02-17 10:41:24 INFO (MainThread) [homeassistant.setup] Setup of domain sector_alarm took 13.0 seconds.

2020-02-17 10:41:33 INFO (MainThread) [homeassistant.components.alarm_control_panel] Setting up alarm_control_panel.sector_alarm

Just if someone else ends up reading this thread I made a new custom component. Also available through HACS.

2 Likes

Thanks @gjohansson! I Found this in HACS a while ago and have been running it for almost 2 months now. Working great so far.