Yale Smart Alarm Binary Sensors

Right i finally managed to get this working,

Here is my custom component for creating binary sensors for each of the door and window contacts on your yale smart alarm system.

full credits go to the original home assistant component authors who i basically modified their code to gain access to the python yale library.

Available here:

Basically add it to your custom components folder and add the binary_sensor config to your configuration.yaml

2 Likes

Updated the code to add some state icons and tidied up a bit

Working great so far no errors

Testing it this morning I’ve noticed there is up to a 30 second delay from it knowing the door is open, is this right?

Yeah you have to poll the Yale api, I was cautious of overloading it so set the delay to 30secs.

If you wanted to try it faster you can just change the timedelta declaration in the custom component from 30 to something else.

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=30)

1 Like

Added binary_sensor(NEW).py, replaces the other binary_sensor component.

Uses raw data instead of relying on the previous api.

This allows more data to be extracted, e.g. Battery Low and Tamper

Have replaced existing sensor with the new version and added a parameter to turn off all but door/window contacts.

Newer code is much better and pulls out additional information about all sensors, e.g. battery state and tamper alarms.

@mattius uick question - do the status of the sensors only change if the alarm is in an armed state? I’ve installed the component and the PIR’s (2) and the door sensors (2) are all detected in HA. However if I look at the history for the devices (having opened both doors and moved around by both motion sensors) there is no indication of any state changes at all.

Cheers :slight_smile:

PIRs don’t work yet can’t get them to register triggers. Only tamper and low battery.

Door sensors should work in all alarm states, ( haven’t gone to latest version myself yet though ), although as the API polls at 30s intervals, you need longer than 30s in a state form them to update.

thanks for the update, nice work BTW :slight_smile:

Have updated the component to include a version in the manifest to stop home assistant moaning in the logs

Amazing work Mattius!!! It works like a charm.

When i was integrating yale against hubbitat the author of the code warned me from polling to often from yale.

https://community.hubitat.com/t/release-yale-smart-alarm/33269/13

What do you guys think?

Yeah that’s why I set it at 30s, if people start hammering their servers every second they will get pissed and shut it down.

I don’t think 30s is unreasonable, I expect the app does the same if you have it open as there is a noticeable delay

1 Like

Is it possible to poll the sensors from yale with a command? In my case i dont need the sensor information until i actually need it.

Not in a binary sensor no, would need to be a full integration to have some interaction with it, as far as I know

I think i formulated my question wrong. Is there a way to poll the yale integration on demand?

If you write your own integration there is no reason why you couldn’t,

Its just calling the api,

All the current ones do it in the background, on a timer

I would say if you sporadically burst your requests though you are more likely to get blocked by their servers as they may identify short fast bursts as DOS attacks.

1 Like

Can anyone help me get this working, it’s the first time I’ve added a custom component and though I think I’ve done everything right I’m getting an error and I’m not sure if it’s due to the general setup or this specific component.

  • I created a folder called custom_components in my config directory
  • In that folder I created a folder called yalebinary
  • Into that folder I download binary_sensor.py
  • In my configuration.yaml file I add the binary sensor details (adding in my username and password.

On restarting Home Assistant I get the error

Platform error binary_sensor.yalebinary - Integration 'yalebinary' not found.
12:07:02 – Home Assistant Supervisor (ERROR)

with further details

Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:420
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 12:07:02 (1 occurrences)
Last logged: 12:07:02

Platform error binary_sensor.yalebinary - Integration 'yalebinary' not found.

Is there anything obvious I’m missing here? Thanks

You need all the files ( excluding the old one ) from the GitHub in your yalebinary folder, most notibly the manifest.json is what that error is moaning about