gjohansson-ST / sector

Integration to Sector Alarm for Home Assistant
35 stars 16 forks source link

No devices detected #93

Open einarsi opened 2 years ago

einarsi commented 2 years ago

Having no previous experience with the Sector integration, I don’t know what to expect in terms of functionality. But I would think that there should be more devices than the Hub and the alarm panel, which are the only two devices that are detected during setup. Or…?

The alarm panel is by far the most important since I’ll use it as a «house is empty» sensor to trigger e.g. vacuuming, but it would be nice to get the other various sensors too.

Using 0.3.5-beta10.

gjohansson-ST commented 2 years ago

It would add locks and smartplugs if it detects that you have them. It will add temp sensors if you enabled them during the configuration during setup of the integration. They are disabled by default as they are heavy to get status from the api.

From the info you sent earlier it seems you have no smartplugs or locks so therefore there is nothing of such. temp sensors can be added if you remove the integration and add it again and choose to enable them.

I could not verify the endpoints you sent for smoke alarms nor door/window sensors. You wrote https://mypagesapi.sectoralarm.net/api/housecheck/doorsandwindows in your e-mail which gives a 404 so maybe you can verify the endpoints again for those two and we can see if we can get them added.

einarsi commented 2 years ago

I just logged on again with developer mode active, and I can confirm the endpoints (copy-paste, so 100% accurate): https://mypagesapi.sectoralarm.net/api/housecheck/doorsandwindows https://mypagesapi.sectoralarm.net/api/housecheck/smokedetectors https://mypagesapi.sectoralarm.net/api/v2/housecheck/temperatures

Yes, it looks kinda funny that only the last one contains "v2". But perhaps it's a more efficient way to obtain temperatures than the endpoint you are currently using?

The payload for all three is {panelId: "MASKED"}. The return formats are as in the email I sent you.

gjohansson-ST commented 2 years ago

If I paste it into the browser I get this below which my first interpretation was that it's 404 but that might not be the case. I will probably compose a test-file so you can run it and see if we get a good response (same as you get from their website)

<Error>
<Message>No HTTP resource was found that matches the request URI 'http://mypagesapi-dp.sectoralarm.net/api/v2/housecheck'.</Message>
</Error>
gjohansson-ST commented 2 years ago

Hi. Give the new version a try and give some feedback if you get devices or not. I assume you still won't get any and thereby Sector has two different sets here for a old vs. new setup. Should be able to bake it into the same integration.

roux-jerome commented 5 months ago

Hello, I'm new in home assistant. First, big thank for your integration. It was very cool !

Could it be possible to get door and window shock sensor status ? I try the code below and it work well :

import asyncio

# get the auth token and panel id from previous request 

json_panelId = {
    "panelId": PANELID
}
async with session.post(API_URL + "/housecheck/doorsandwindows",
                       headers=message_headers,json=json_panelId) as response:
    if response.status != 200:
        _LOGGER.debug("Sector: Failed to get doorsandwindows: %d", response.status)
    else:
        DoorsAndWindows = await response.json()

print("DoorsAndWindows")
print(DoorsAndWindows)