Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

question - apple home integration #31

Open
BeaconVista opened this issue Jan 15, 2024 · 7 comments
Open

question - apple home integration #31

BeaconVista opened this issue Jan 15, 2024 · 7 comments

Comments

@BeaconVista
Copy link

hi guys - this is absolutely brilliant, I have managed to setup the integration however am now stuck with trying to display something via apple home that I can interact with? Any suggestions here? Much appreciated

@caronc
Copy link
Owner

caronc commented Jan 15, 2024

This is based on this code here. You could see if it works with your system first; some of the newer ones aren't supported.

If it does work, then all you need is something to tie it with your apple home system like this repository does for Home Assistant.

The last thing I'd say is unfortunately this project is kind of archived now at this point. It does what it was intended to do. There isn't really much more that can be added to it. If Apple integration was even possible, it would happen in a separate github project leveraging the link i shared above.

@phyco1991
Copy link

There is an option to create a HomeKit bridge in Home Assistant which can expose 'Alarm Control Panel' devices to be added in HomeKit. The problem is the UltraSync integration doesn't create any 'devices' in Home Assistant (only entities). @caronc I know this was touched on briefly at one point here - https://community.home-assistant.io/t/interlogix-ultrasync/51464/119

Were you ever able to work out how to create a 'device' for the integration in Home Assistant at all?

@caronc
Copy link
Owner

caronc commented Feb 22, 2024

I'm out of town right now. The problem is that i haven't been able to devote as much time to this and other fun open source projects i have going due to job, responsibilities, etc.

I can't honestly promise you I'll be able to look into it anytime soon. But we'll leave the ticket open for those who see it and are up for the challenge.

@BeaconVista
Copy link
Author

BeaconVista commented Feb 22, 2024 via email

@phyco1991
Copy link

Actually I think i solved the problem. the ha-ultrasync addon is brilliant as it adds the required services that need to be called with automation. I added the HA custom alarm component and then exposed that via homekit I then added a bunch of automations (sync) to call the services when homekit makes a state change

Thanks for the suggestion. I managed to achieve this by following the video here - https://www.youtube.com/watch?v=qRYFIuC6WEM

The information at these links was also useful:
https://www.home-assistant.io/integrations/alarm_control_panel.template
https://www.home-assistant.io/integrations/manual

Here is the entry in Configuration.yaml for reference:

# Alarm Config to Allow Homekit Integration
alarm_control_panel:
  - platform: manual
    name: ultrasync_alarm_ghost
    code_arm_required: false
    arming_time: 0
    delay_time: 0
    trigger_time: 300
    disarmed:
      trigger_time: 0
    armed_away:
      arming_time: 30
      delay_time: 20
    armed_home:
      arming_time: 15
      delay_time: 10
  - platform: template
    panels:
      ultrasync_alarm:
        value_template: "{{ states('alarm_control_panel.ultrasync_alarm_ghost') }}"
        arm_away:
          service: alarm_control_panel.alarm_arm_away
          target:
            entity_id: alarm_control_panel.ultrasync_alarm_ghost
        arm_home:
          service: alarm_control_panel.alarm_arm_home
          target:
            entity_id: alarm_control_panel.ultrasync_alarm_ghost
        disarm:
          service: alarm_control_panel.alarm_disarm
          target:
            entity_id: alarm_control_panel.ultrasync_alarm_ghost

And three automations to allow triggering of the armed away, armed stay, and disarmed states.

alias: Alarm - Disarm
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - alarm_control_panel.ultrasync_alarm_ghost
    to: disarmed
condition: []
action:
  - service: ultrasync.disarm
    data: {}
mode: single

alias: Alarm Arming - Away
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - alarm_control_panel.ultrasync_alarm_ghost
    to: disarmed
condition: []
action:
  - service: ultrasync.away
    data: {}
mode: single

alias: Alarm Arming - Stay
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - alarm_control_panel.ultrasync_alarm_ghost
    to: disarmed
condition: []
action:
  - service: ultrasync.stay
    data: {}
mode: single

The only thing I still would like to implement is some sort of logic to update the status in HomeKit to reflect the current state of the system. Right now if I trigger arming/disarming from within HomeKit, the toggle updates accordingly. But HomeKit does not yet 'know' if I arm/disarm the system from elsewhere (i.e. the physical panel or in Home Assistant), so the toggle doesn't update as it wasn't the source of the state change and doesn't have any direct communication to the alarm system to know what the state should be.

@phyco1991
Copy link

phyco1991 commented Feb 25, 2024

Here are the remaining 3 pieces of Automation to sync the alarm state to HomeKit, it uses the change in value of the area state sensor to update the 'ghost' panel that HomeKit uses to control the other entities. You may wish to create others for if the alarm is triggered but this was enough to cover what I was after.

alias: Updates HomeKit Alarm Status to Armed - Away
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - sensor.ultrasync_area1state
    from: null
    to: Armed Away
condition: []
action:
  - service: alarm_control_panel.alarm_arm_away
    metadata: {}
    data: {}
    target:
      entity_id: alarm_control_panel.ultrasync_alarm_ghost
mode: single

alias: Updates HomeKit Alarm Status to Armed - Stay
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - sensor.ultrasync_area1state
    from: null
    to: Armed Stay
condition: []
action:
  - service: alarm_control_panel.alarm_arm_home
    target:
      entity_id:
        - alarm_control_panel.ultrasync_alarm_ghost
    data: {}
mode: single

alias: Updates HomeKit Alarm Status to Disarmed
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - sensor.ultrasync_area1state
    to: Ready
    from:
      - Sensor Bypass
      - Armed Away
condition: []
action:
  - service: alarm_control_panel.alarm_disarm
    target:
      entity_id:
        - alarm_control_panel.ultrasync_alarm_ghost
    data: {}
mode: single

I think we have achieved what was set out to be done here, even if it's not part of the integration itself as such. @caronc When you have some time, do you want to close this issue out and add the info into documentation? Or whatever you prefer :)

@anthonytsavdaridis
Copy link

alias: Updates HomeKit Alarm Status to Armed - Away
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - sensor.ultrasync_area1state
    from: null
    to: Armed Away
condition: []
action:
  - service: alarm_control_panel.alarm_arm_away
    metadata: {}
    data: {}
    target:
      entity_id: alarm_control_panel.ultrasync_alarm_ghost
mode: single

alias: Updates HomeKit Alarm Status to Armed - Stay
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - sensor.ultrasync_area1state
    from: null
    to: Armed Stay
condition: []
action:
  - service: alarm_control_panel.alarm_arm_home
    target:
      entity_id:
        - alarm_control_panel.ultrasync_alarm_ghost
    data: {}
mode: single

alias: Updates HomeKit Alarm Status to Disarmed
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id:
      - sensor.ultrasync_area1state
    to: Ready
    from:
      - Sensor Bypass
      - Armed Away
condition: []
action:
  - service: alarm_control_panel.alarm_disarm
    target:
      entity_id:
        - alarm_control_panel.ultrasync_alarm_ghost
    data: {}
mode: single

this is really cool! just a minor fix in the second and third automation

alias: Alarm Arming - Away
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id: alarm_control_panel.ultrasync_alarm_ghost
    to: armed_away  # Adjusted trigger condition
condition: []
action:
  - service: ultrasync.away
    data: {}
mode: single

alias: Alarm Arming - Stay
description: Used by HomeKit Alarm Integration
trigger:
  - platform: state
    entity_id: alarm_control_panel.ultrasync_alarm_ghost
    to: armed_home  # Adjusted trigger condition
condition: []
action:
  - service: ultrasync.stay
    data: {}
mode: single

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants