hawky358 / hass_ids_hyyp

Home Assistant integration for IDS Hyyp
GNU General Public License v3.0
12 stars 3 forks source link

Two IDS -Hyyp Sites #2

Closed Owewolf closed 1 year ago

Owewolf commented 1 year ago

@hawky358 Thank you for looking into this. I have two sites (two separate alarms two different locations) both accessible through the IDS app. Both sites have one partition and a stay profile. This is the error I log. ##

KeyError: 1638155 2023-05-28 10:11:03.465 ERROR (MainThread) [custom_components.ids_hyyp.coordinator] Unexpected error fetching ids_hyyp data: 1638155 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/ids_hyyp/coordinator.py", line 35, in _async_update_data return await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/pyhyypapihawkmod/client.py", line 138, in load_alarm_infos return HyypAlarmInfos(self).status() File "/usr/local/lib/python3.10/site-packages/pyhyypapihawkmod/alarm_info.py", line 124, in status formatted_data: dict[Any, Any] = self._format_data() File "/usr/local/lib/python3.10/site-packages/pyhyypapihawkmod/alarm_info.py", line 79, in _format_data site_ids[site]["partitions"][partition]["zones"] = { File "/usr/local/lib/python3.10/site-packages/pyhyypapihawkmod/alarm_info.py", line 82, in if key in site_ids[site]["partitions"][partition]["zoneIds"] KeyError: 1638155

Any help would be appreciated if needed I'm willing to share my login privately if it would help.

hawky358 commented 1 year ago

@Owewolf

Sharing the credentials would definitely help. I don't really like having this information however, since it opens us both up to risk. If you want to do this, I'd probably need it for an hour or so then you can change your password.

Alternatively I've created a build of the API which can dump the ids information I likely need to a .log file. In order to get me this file you'd need to install python and run a few commands.

See below: Let me know how you'd like to proceed. I'm fine with either method.

1 Download Python (https://www.python.org/ftp/python/3.11.3/python-3.11.3-amd64.exe) 2 Install Python (Be sure to tick "Add Python to environment variables") 3 Once installed open a Powershell terminal (Goto Run > "powershell") 4 Copy and paste the following command and run it:

pip install pyhyypapihawkmod==0.0.0.6.dev1

  1. It should run through and download the API as well as the dependencies. It may ask you Y/N to install (Yes obviously)
  2. Once done and back at the terminal, type the following command and run it

py

  1. This will open the python command line
  2. Paste the following commands hitting enter after each one (Note that there is a place for you to put in your email and password) I recommend copying the commands into notepad adding the email and password then pasting it into powershell again
import pyhyypapihawkmod
client = pyhyypapihawkmod.HyypClient(email="",password="",pkg=pyhyypapihawkmod.HyypPkg.IDS_HYYP_GENERIC)
client.login()
client.debug_dump()
  1. There should now be a file on your desktop "idslog.log". Please send me that file on Github
Owewolf commented 1 year ago

@hawky358 I would be happy to share my details as i run home assistant OS and adding other packages are a nightmare for me is there a way i can private message you

hawky358 commented 1 year ago

@Owewolf

Ok, Github has no built in PM / DM.

You can drop me an email on [redacted] . I want to prevent spam so I'd rather not share my main mailbox on a public forum.

Alternatively I've created a temporary discord server which has a private channel. If you join there I'll give you access to the private channel so the details aren't public https://discord.com/invite/Z83GQ7b3

hawky358 commented 1 year ago

@Owewolf

I've deployed a fix. I've tested on my side. Seems to work, though I haven't tried arming/disarming/bypass etc. Please test on your side.

You'll need to download version 1.0.1-b2 from HACS. It's a "beta" version. Check the discord for a quick video if you don't know how to get the beta.

I will be deleting all info of your u/n & p/w, but please change to be safe.

Owewolf commented 1 year ago

@hawky358 It works like a charm, don't know how to thank you, appreciate your time and honesty. both sites work

hawky358 commented 1 year ago

Glad to hear it. Hope you enjoy further integrating in Home assistant.

I'll deploy this version on the main release in the next week or so then close the issue. I just want to give you some time to discover any bugs/problems with multiple sites. Let me know if you experience anything odd.

Owewolf commented 1 year ago

What i have noticed is that the first site/device shows both controls and sensors. The controls being the zones, arm/disarm etc. The sensors - imei haspin etc on the second site/device only the sensors are visible, no zones , I do see zones for both sites on the IDS app. It could be that when I integrated the sites the one was armed and the other not. Will try reintegrate tomorrow when both are disarmed.

hawky358 commented 1 year ago

I saw that when testing. I don't know why it's not showing on the actual device card. It may be something inside the integration or how home assistant handles it. That being said, the "controls" i.e. bypass switch entities all exist in home assistant and are linked to the site. They are just not showing on that card for some reason.

You can see them under developer tools > states. So if you create an entity card you'll be able to list all of the relevant switches as a new card and put that card wherever you need the bypasses.

The switch names however don't have the site name linked to them only the zone name so you'll need to know which zones belong to which site. (You can filter by area for a device as well) This is unfortunately one of the things that's part of the original code. Having a more descriptive name would have been better when you have multiple sites e.g. ., not just . I don't really want to change that now since it will break everyone else's integrations since the names change.

I've also noticed in the code that the integration only supports 1 "Home" arm mode. Whichever is the 1st one on the list will be your "Home" / "Stay" arm.

I may or may not look into this, depends if I feel like spending more time with this.

For now I just wanted to get the 2 sites working via the API so you can at least use the integration.

Owewolf commented 1 year ago

@hawky358 Thanks once again your time is much appreciated

hawky358 commented 1 year ago

What i have noticed is that the first site/device shows both controls and sensors. The controls being the zones, arm/disarm etc. The sensors - imei haspin etc on the second site/device only the sensors are visible, no zones , I do see zones for both sites on the IDS app. It could be that when I integrated the sites the one was armed and the other not. Will try reintegrate tomorrow when both are disarmed.

This point has been moved to a new issue.

This specific issue is for the "crash" that occurred when trying to add more than one site.

hawky358 commented 1 year ago

This has been fixed and incorporated into version 1.0.1, officially published with version 1.1.0