Sector Alarm

I followed your instructions above and it works so far, thanks!

I also followed this setup from @endor and it works perfect :slight_smile:

As a bonus the key-panel is back! (running version 0.89)

image

Hi.

I have been tryin for a few hours now getting this to work.

Ive rearranged the files, done @endor mod to asyncsector.py, and just tryin to get it to work… but no bueno.

Im getting:
ERROR (MainThread) [homeassistant.setup] Setup failed for sector_alarm: Component failed to initialize.

Here is my config atm:

sector_alarm:
  email: "[email protected]"
  password: !secret sector_alarm_password
  alarm_id: !secret sector_alarm_id
#  code: !secret sector_alarm_pin
  thermometers: true
  alarm_panel: true

secret.yaml

sector_alarm_password: "passwd"
sector_alarm_id: "12345678"
sector_alarm_pin: 123456

Not sure what to try next… ive basically tried everything i can think of.

I got a problem when i updated to 0.93. Got something that was shown as timeout errors.
Although they don’t seem to be actual timeouts… rather some conflict in the threads of hass and the asyncsector code.

Tried to raise the timeout to 20 secs, no improvments, 60 secs and only got alarm status, no thermometrs…

Solved it by commenting out line 34 in
\config\deps\lib\python3.7\site-packages\asyncsector\asyncsector.py

login method now looks like this:

async def login(self):
    """ Tries to Login to Sector Alarm """

# with async_timeout.timeout(10):
response = await self._session.post(
    AsyncSector.Base + AsyncSector.Login, json=self._auth)

if response.status == 200:
    result = await response.text()
    if 'frmLogin' in result:
        return False
    return True

return False

And it works…

I have tried to apply the same fix as mentioned without success but the path @endor is mentioning, is it a rewrite of the path to the custom_components folder?
I am running hass.io on a RPi and I cannot find the \config\deps\lib\python…
I do have asyncsector in my custom_components folder along with sector_alarm but i cannot get it to work again (after updating the other night)
This might be a stupid question but i am grateful for a pointer in the right direction

Same for me. Tried the above fix, but Sector Alarm won’t work for me either on hass.io on RPi3. Something else seems to be broken.

For anyone who has been looking at the code, maybe you can help me verify if i’m correct

I believe that when we I write my alarm code as “1234” (the only way for me to get it to work)
it gets interpreted as a string right?

and at some stage later when the alarm_panel needs to know “code_format” to determine if the keypad should be visible, it sees that the alarm code is a string and doesn’t show the keypad

I know it was a while ago that the instructions on github was udated, but itsays:

alarm_id: <can be found from the url when you login to Sector Alarm, inside “”>
code: <Your pin code to asm/disarm, optional>

so according to this the code should be written as code: 1234

so could the string/integer thing be the reason why the keypad is not visible for me you think?
and that somewhere else in the code is a bug that is incorrectly rectified by making the code a string to begin with?

The second thing i’ve noticed is that since a few weeks i can no longer have temperatures enabled as i get an error saying that “string indices must be integers”, when referring to temperatures. it works fine when i disable the temperatures.

Has anyone experienced this?

@Folian i got the same error, so i downloaded the latest files from github and updated the custom_components files.

However i get the timeout errors again, and i can not find the asyncsector files anymore to remove the timeout…

Thanks for responding @endor, thats been bugging me for the last few hours, my dep folder is empty, and asyncsector is nowhere to be found,

I know there are new changes for asyncsector in mgejkes repo that I havent changed or edited in my install.(Version = ‘v1_1_66’ for example) but i can’t for the life of me find the new location.

Is asyncsector suposed to be downloaded automatically? I think i remember reading that somewhere

Yes the deps are downloaded automatically. So update the files for the custom component and restart hass and it should be updated.

Did your installation download the Asyncsector atomatic?

I now get this error in the log:

2019-07-03 07:52:59 ERROR (SyncWorker_6) [homeassistant.util.package] Unable to install package asyncsector>=0.1.7: ERROR: Could not find a version that satisfies the requirement asyncsector>=0.1.7 (from versions: 0.0.1, 0.0.2, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5)
ERROR: No matching distribution found for asyncsector>=0.1.7
2019-07-03 07:52:59 ERROR (MainThread) [homeassistant.requirements] Not initializing sector_alarm because could not install requirement asyncsector>=0.1.7
2019-07-03 07:52:59 ERROR (MainThread) [homeassistant.setup] Setup failed for sector_alarm: Could not install all requirements.

Does anyone know anything about this?

Trying to add the sector_alarm addon with no success.
Have the latest files in my custom_components/sector_alarm folder.
Can’t see any \config\deps\lib\python3.7\site-packages folder.

Getting a timeout error:
Error during setup of component sector_alarm
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/asyncsector/asyncsector.py”, line 39, in login
AsyncSector.Base + AsyncSector.Login, json=self._auth)
File “/usr/local/lib/python3.7/site-packages/aiohttp/client.py”, line 497, in _request
await resp.start(conn)
File “/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py”, line 844, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File “/usr/local/lib/python3.7/site-packages/aiohttp/streams.py”, line 588, in read
await self._waiter
concurrent.futures._base.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 153, in _async_setup_component
hass, processed_config)
File “/config/custom_components/sector_alarm/init.py”, line 58, in async_setup
if not await async_sector.login():
File “/usr/local/lib/python3.7/site-packages/asyncsector/asyncsector.py”, line 45, in login
return True
File “/usr/local/lib/python3.7/site-packages/async_timeout/init.py”, line 45, in exit
self._do_exit(exc_type)
File “/usr/local/lib/python3.7/site-packages/async_timeout/init.py”, line 92, in _do_exit
raise asyncio.TimeoutError
concurrent.futures._base.TimeoutError

Yep, i also have the timeout error…
I have an open issue in asyncsector repo:

@mgejke is there a reason for having the timeout in asyncsector.py?
line 37:
with async_timeout.timeout(10):

@hehrsson
I have published my workaround version below, which holds the asyncsector in a subfolder of the sector_alarm folder. I have removed the timeout from asyncsector and changed the way it is importing asyncsector from sector_alarm.
This way it will use this custom version of asyncsector instead of trying to download asyncsector from pypi and placing it inside hass container…

Try to remove your old one and replace with this and see if it works for you.
For me i get alarm and temp sensors with this setup…

2 Likes

Using your repo works perfectly fine with latest (0.97.1) home assistant. Tried @mgejke version first but ran into the timeout that you have fixed.

Yep, this works for me too. thermometers and all,
Thank you Endor!

Some issues for me:

  • Got it working with the timeout workaround but no thermometer.
  • Still says is not armed if I activate the shield. Havent checked status if alarm is compleately armed.
  • Don’t get any notifications to my phone (arm/disarm) after I activated the component. Removing the compoinent will reactivate notifications to phone again.
    Need the notifications, so unfortunately I can’t use the component now :frowning:

I got this as well.

I wonder if it’s actually faulty logins or just that it’s more logins than they expect.
I think the latter, which makes me think this is something that can happen from time to time :frowning:

Same here today, worst case they try to prevent third party like HA with some detection. I had similar issues with my Blink cameras that I’m now forced to use via IFTTT instead of direct access (since they detect and lock you out of your own hardware).

I guess it’s better to have your own alarm, and camera solution instead. Sigh.

I’m getting the following in my log…
using Home Assistant 0.97.2
and the files from: https://github.com/endor-force/hass-sectoralarm

2019-08-29 14:20:16 ERROR (MainThread) [homeassistant.setup] Error during setup of component sector_alarm
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py”, line 168, in _async_setup_component
hass, processed_config
File “/home/homeassistant/.homeassistant/custom_components/sector_alarm/init.py”, line 66, in async_setup
await sector_data.update()
File “/home/homeassistant/.homeassistant/custom_components/sector_alarm/init.py”, line 125, in update
*[task() for task in self._update_tasks])
File “/home/homeassistant/.homeassistant/custom_components/sector_alarm/init.py”, line 154, in _update_temperatures
for temperature in temperatures
File “/home/homeassistant/.homeassistant/custom_components/sector_alarm/init.py”, line 154, in
for temperature in temperatures
TypeError: string indices must be integers