Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Subsystem - Main system reflect any subsystem #74

Closed
strakadavid opened this issue Nov 5, 2023 · 6 comments
Closed

Subsystem - Main system reflect any subsystem #74

strakadavid opened this issue Nov 5, 2023 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@strakadavid
Copy link

Environment*:

  • Home Assistant version: 2023.10.5
  • AX PRO integration version: 2.1.0-beta9

Issue Description:
There are two defined areas within the AX PRO setup - one for the house and another for the garage. Each area is represented by its own entity in Home Assistant (alarm_control_panel.garage for the garage and alarm_control_panel.ax_pro for the house). However, when changing the state of one entity (e.g., to 'Away', 'Home', or 'Disabled'), both entities appear to be simultaneously controlled and thus reflect the same state.

Steps to Reproduce:

  1. Define two areas in the AX PRO setup
  2. In Home Assistant, observe the entities alarm_control_panel.second and alarm_control_panel.ax_pro.
  3. Set the alarm_control_panel.second entity to 'Away'.
  4. Notice that the alarm_control_panel.ax_pro entity also shows 'Away', despite not being manually changed.

Expected Behavior:
When an area's state is changed, it should not affect the state of another unrelated area. Each entity should maintain its state independently unless explicitly altered.

Actual Behavior:
Changing the state of one entity (either alarm_control_panel.garage or alarm_control_panel.ax_pro) causes both entities to display the same state in Home Assistant, even if only one area is set to that state.

Additional Information:

  • This behavior is consistent across all states (Away, Home, Disabled).
  • No errors are observed in the Home Assistant logs when the issue occurs.

Please investigate this issue as it prevents correct status reporting and manipulation of the individual areas within the Home Assistant environment.

Thank you for your assistance.

@petrleocompel
Copy link
Owner

What are your settings of the integration? Are you using multiple instances of this integration?

@strakadavid
Copy link
Author

strakadavid commented Nov 6, 2023

What are your settings of the integration? Are you using multiple instances of this integration?

I am using only one instance of this integration.

@petrleocompel
Copy link
Owner

What are your settings of the integration?

@strakadavid
Copy link
Author

What are your settings of the integration?

axpro_config

@petrleocompel petrleocompel self-assigned this Nov 6, 2023
@petrleocompel petrleocompel added the bug Something isn't working label Nov 6, 2023
@petrleocompel petrleocompel added this to the 2.1.0 milestone Nov 6, 2023
@petrleocompel
Copy link
Owner

@strakadavid Ok it is not so easy.

This beahaviour is caused by ISAPI inconsistency a little bit.

        try:
            subsys_resp = SubSystemResponse.from_dict(status_json)
            subsys_arr: list[SubSys] = []
            if subsys_resp is not None and subsys_resp.sub_sys_list is not None:
                subsys_arr = []
                for sublist in subsys_resp.sub_sys_list:
                    subsys_arr.append(sublist.sub_sys)
            func: Callable[[SubSys], bool] = lambda n: n.enabled
            subsys_arr = list(filter(func, subsys_arr))
            self.sub_systems = {}
            for subsys in subsys_arr:
                self.sub_systems[subsys.id] = subsys
                if subsys.alarm:
                    status = STATE_ALARM_TRIGGERED
                elif subsys.arming == Arming.AWAY:
                    status = STATE_ALARM_ARMED_AWAY
                elif subsys.arming == Arming.STAY:
                    status = STATE_ALARM_ARMED_HOME
                elif subsys.arming == Arming.VACATION:
                    status = STATE_ALARM_ARMED_VACATION
            _LOGGER.debug("SubSystem status: %s", subsys_resp)
        except:
            _LOGGER.warning("Error getting status: %s", status_json)
        _LOGGER.debug("Axpro status: %s", status)
        self.state = status

Problem is "ISAPI" does not have "main" system. It is just system ID 1... And nowhere is said it will be like it for ever.

Basically "main" system reflect all other sub systems. And if you do not use "sub-systems" and you accidentally activate one of subsystem (via app for example) it is not visible then.

So only solution is "if subsystems are allowed" it will not be visible in "main" system.

@petrleocompel petrleocompel changed the title AX PRO - Setting State for One Area Affects Both Alarm Entities Subsystem - Main system reflect any subsystem Nov 6, 2023
@petrleocompel
Copy link
Owner

Closed in V2.1.0-beta10

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants