Update Yale Smart Alarm Client

we are working on making it part of configuration/integrations but as of today you need to add it via your configurations.yaml as shown on the url you posted

1 Like

Sorry to jump late.

As you have seen I added the panic button to the client.

There must be a better way but It was the only way I found to trigger the alarm using the API.

I think this is vital for the integration, apart from arming and disarming the alarm.

The other thing I would say is important is to change the status in HA when the alarm is triggered.
As far as I know, we have not been able to implement that part.

I have seen this working already with the code I was working on. We just need to set the state to “STATE_ALARM_TRIGGERED” after we call the alarm_trigger function.

I would love seeing the panic button added but hopefully it won’t hold things up or cause other issues.

What if the alarm is triggered outside HA?
Would the state change?

Does the api support this ? I would say if the api gives us a state we could add logic around it. The information you get from the alarm seems pretty basic. All I see is support for the armed status nothing else.

So I think the best you could do is have HA change it status when you trigger it from HA. But I might be wrong

thanks! just tried and have this error showing up immediately at startup

Logger: homeassistant.components.alarm_control_panel
Source: components/yale_smart_alarm/alarm_control_panel.py:57 
Integration: Alarm control panel (documentation, issues) 
First occurred: 3:32:39 PM (1 occurrences) 
Last logged: 3:32:39 PM

Error while setting up yale_smart_alarm platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 231, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/yale_smart_alarm/alarm_control_panel.py", line 57, in setup_platform
    client = YaleSmartAlarmClient(username, password, area_id)
  File "/usr/local/lib/python3.8/site-packages/yalesmartalarmclient/client.py", line 53, in __init__
    self._authorize()
  File "/usr/local/lib/python3.8/site-packages/yalesmartalarmclient/client.py", line 181, in _authorize
    _LOGGER.debug("Failed to authenticate with Yale Smart Alarm. Error: %s", data.error_description)
AttributeError: 'dict' object has no attribute 'error_description'

Im running core-2021.5.1

Does not support config_flow right now until my PR’s are coming through. You need to setup using yaml in config file.

Was apperently too late :slight_smile:
Looks from your error as you put in the wrong credentials

1 Like

Thanks so much for doing all this. Really looking forward to the new and improved Yale integration

I got a bit confused now as it seems as you were working on a separate integration e.g. not editing the existing one (which in the end they would not like as one already exist).
As I don’t have all stuff e.g. I only have the lock I will publish a package which someone can run a test through to get the full output as in the current package there is significant limitations from what HA wants.

Btw; See this as it’s problematic when the package is dependant on someone else: Bump yalesmartalarmclient to 0.3.2 by gjohansson-ST · Pull Request #50613 · home-assistant/core · GitHub

I was planning to rename mine before I was done. I sent you a ping on discord by the way going over the backoff update. I was the one who put in the PR I guess it wasn’t good enough. Honestly this is all new to me and it didn’t seem like anyone was working on this so I thought I would give it a go.

Looks like another PR is needed into the yaleapi. As for testing I have all the hardware needed

Cool. I am making a PR right now for the package. I hope domwillcode is active to approve so at least then we can take next steps for HA.

Thanks again I will step away from it lol. I do plan to test your code in my dev env this weekend and I can post feedback. He approved my PR very fast but has been quite on the current open PR. So who knows

thanks for catching it!!! I had a typo!!!

I could be wrong but I think this is how it works (based on how the mobile app works)

The mobile app is constantly calling the Yale API to check the status. If the alarm is triggered, then the state changes in the mobile app.

I have also seen that the HA integration checked the status quite often. Maybe the information we need to change the state of the alarm can be fetched from here.

Does this makes sense?

Looking at the Yale api code myself I don’t see any status beyond arming status which does not cover triggered. Again I can be wrong but if you see a way to do it there is no reason why HA couldn’t support it

I am also happy to arrange a meeting on discord to discuss or test this thing.

I can test the alarm part

1 Like

Done gjohansson is in the discord channel now as well

hi do the YALE API expose information control also on temperature sensors and smart plug/relays?

Has there been any further update on the development of this?

Keen to get this tested myself and hopefully finally implement my Yale Conexis which is linked to the alarm via yale module

There is some work and a PR by gjohansson waiting to be merged.

It is taking a bit of time, if everybody can support this by giving a thumbs up that will be nice