Verisure integration

integration
alarm
presence

(Anders) #1

I thought I could use my Verisure alarm to handle presence as we always use it when we leave the house. So I sat down to try and write a Smartapp that could poll the status and use that to set the presence.

So I try to do a:

httpGet(uri: "https://mypage.verisure.com")

But this gives a:

java.lang.SecurityException: Endpoint https://mypage.verisure.com is blacklisted.

What am I stumbling into here? Have Verisure been explicitly blacklisted? Why?


[BETA] Verisure Integration
(Anders) #2

Nothing? Do support interact on these forums or do they only respons directly? Just wondering since I’m new here. :slight_smile:

Regardless, I probably won’t spend much more time on this. As it’s not a critical component of my setup I found a work around that depends on some other things. Currently running a setup with Home Assistant -> IFTTT -> Simulated Switch that lets me detect alarm state. Just got it working, but looks like it’s functioning quite nice. Get in touch if you’re interested.

For anyone interested I also found the Home Assistant <-> MQTT <-> Smartthings integration which looks quite good for solving those corner cases where Smartthings just won’t play ball. Adds more dependencies and you need a server, but hey nothing is perfect. :wink: https://home-assistant.io/blog/2016/02/09/Smarter-Smart-Things-with-MQTT-and-Home-Assistant/


(Jason Botello) #3

Try it this way:

def reqParams = [
    uri: "https://mypage.verisure.com"
]
try {
    httpGet(reqParams) { resp ->
        if (resp.status == 200) {
            log.info "successful response"
        } else {
            log.info "${resp.status} response"
        }
} catch (e) {
    log.info "request failed"
}

(Anders) #4

Nope, that still doesn’t work. I did the test in both the US and the EU site to be sure. I’m doing it from the Simulator, does that affect anything? It’ll be a bit hard to develop without the simulator though…


(Jim Anderson) #5

Is the URI you are trying to reach publicly accessible? The example code shows https://mypage.verisure.com, is this just for illustrative purposes? If the URI isn’t publicly accessible you would receive that SecurityException (docs).

In this case, it should be testable from the simulator, but you’re best long-term bet is to self-publish your app and install it on your phone to test.


(Anders) #6

Djeez, it actually turns out I had a typo in the domain. Your comments helped me track it down though. Thanks, and sorry abou that. :slight_smile:

It should have been https://mypages.verisure.com


(Anders) #7

So there is progress. :slight_smile:

I’ve tried a lot of stuff and I now have a smartapp that adds a child device. The child device has a tile that displays the status. :slight_smile:

The smartapp polls periodically and updates the device. Is that the preferred way to do it?

The alarm has three states: armed, armed home or unarmed. I want to use this information in automation routines, and only see two possible ways:

  • Two switches, one for each armed state
  • Two presence devices, for each armed state

I’m leaning towards presence. At least it doesn’t give an impression of being able to turn off or on.

Any thoughts? Are there any options I’m missing?

If there was a way to change the hub mode from a smartapp, I wouldn’t really need any devices. Anyone know if something like that is possible?

Cheers,
Anders


(Tim Slagle) #8

Which mode are you refering to?

SHM or modes in routines?


(Anders) #9

I think the modes in routines? :slight_smile:

It’s the modes found under Locations in the web here: https://graph-eu01-euwest1.api.smartthings.com/location/show/LOCATION_ID

I use them to decide which rules to be active at night, when away, home or on vacation. :slight_smile:


(Anders) #10

Come to think of it I’d be interested in changing both the SHM mode and the mode in routines? Is any one or both of them possible to update from a smartapp?


(Anders) #11

Never mind, think I’ve found what I was looking for.

For anyone else looking: just using the device to show status. Now triggering Routines (which changes mode) from smartapp, and considering updating the status of SHM when the status of the alarm changes.

I’ll post some code when it gets more complete. Let me know if you need it before that.


(Gigafonzie) #12

Hey Anders,

How did you get on with this?

I was hoping to do that same thing…basically get a light routine to trigger when the verisure alarm changes state?

I also noticed that verisure integrates with NEST already…which i have done…do you think there is anyway of triggering the routine Verisure->NEST->Smartthings?

Thanks!


(Sajjad Sarwar) #13

Must be possible to integrate Verisure with Smartthings, especially since it’s possible with Home Automation :slight_smile:


(Anders) #14

It is. :wink:

The docs and error handling aren’t perfect but it’s been working for me for a while. :slight_smile:

If it isn’t working, uninstall as fast as possible. You don’t want it hitting your Verisure account with denied access.


(Sajjad Sarwar) #15

I will give it a try, thanks for your great work! :slight_smile: