Leeo, a basic b*****s device type

So, I looked everywhere for a decent device handler for the Leeo that could be controllable through IFTTT commands. I didn’t find one that I liked, so I’m working on my own. I am by no means experienced; this is my absolute first shot at creating a device handler. It’s still a work in progress, but as I found that there are several people who are interested in the same thing I am, I thought I would post here.

Currently, triggering smoke, carbon monoxide, and water alerts is possible through ifttt. I know that at least the smoke and carbon monoxide alerts are registered within SHM if you attach this device type as a smoke detector. I have not tested the water.

The triggers work like this:

send command “strobe” to get a smoke alert
send command “siren” to get a carbon monoxide alert.
send command “both” to get a water alert.

I went nuts and added in a bunch of capabilities that I’m beginning to realize are pointless. I was going to use lock/unlock and close/open for the smoke and CO, but that seems slightly more unintuitive than what I described above. I’m considering keeping the lock and unlock commands, because as of right now, I haven’t tested to see if sending the off command to the alarm would also turn off the switch, which is controlled by the bottom tile for lighting. I would think that IFTTT is sending “off” to the alarm functionality, but I have not had a chance to play with that. If anyone would like to report back on that, it would be much appreciated. I’m wondering about this, because I also don’t know if dismissing the alert from SHM that pops up will revert The Leeo DT to deactivated. If it does not, I’m sure most people would like an easier method of doing that, which I assume would make use of IFTTT again.

The switch itself is not attached to anything in particular, but I’m using it, again through IFTTT, to change my Leeo’s color depending on the SHM mode. Placed by the backdoor, I know if I can expect a siren to go off when I let my dog out in the morning. The color changing attribute on this tile was intended to work through the artik cloud service, to send a command to change the leeo to a corresponding color. Every time the command was sent to IFTTT, an issue with the Leeo service was reported. I cannot even get artik to sync devices anymore, so I’ll be looking into using webcore to accomplish that. Again, any help with that is much appreciated.

The last thing, I’ll be needing the most assistance with. When I’ve got the time I definitely research as much as I can to find out how to get humidity and temperature readings to display where the the empty squares are. Sending a command, through webcore, to updateHumidity or updateTemperature, I at least got a preview of how these things will look. The temperature will dictate the background of the temperature display when this is actually working. My lack of understanding is preventing me from getting the information from a webhook to display here. I’ll be contacting more advanced users to see if they can help me with this.

To those of you who said you wanted to test, and to anyone else who is interested, I’m curious about your thoughts.

Colors - are they alright?
Capabilities - leave or remove lock/unlock and open/close (and what these commands should do, if they should do anything related to Leeo, or just function as a lock and a door which could trigger other events?)
Anything I’m missing?

Here’s the link

6 Likes

P.S. I don’t even know how to create a github repository. I’m on a break and typing this all up real fast. Will work out a github integration deal later.

1 Like

Lmao. You are too quick

1 Like

Hi @Andy_Armijo. I have a Leeo as well and would love to find a way to get better integration with ST. I am using the universal DTH currently I believe but can check when I get home. It works ok but isn’t perfect. I have messed around with building something better, ideally that bypasses IFTT, but no luck. Sadly Leeo has zero interest in opening their api it doing any sort of integration. I have gone as far to capture the packets from the app to possibly reverse engineer some of it. They use the pubnub service to get and change data on the device but I have had no luck authenticating to that myself. :confused: I think your goal of a better DTH that utilizes the IFTT stuff is possible, but I don’t think you’ll be able to get temp or humidity values or directly change the color. Hopefully that will change…

2 Likes

The ifttt triggers should be able to handle both those things. An action for leeo is to adjust the color, and passing on the color of the device on the smartthings side should work theoretically. My theory anyway. Also leeo has a trigger for new readings, which posts the humidity and the temp. But yes I was using the same universal device type and it didn’t do quite what I wanted. And I didn’t like the automatic presence sensor being added into my family section. Go ahead and try out this one though. I’d love your feedback, and since you seem to really have a handle on these things that are out of my depths, any help you could offer.

OK, so I did a bit of testing this evening and you are right, the temp/humidity data is indeed available from IFTT. Additionally, as you said, you can use IFTT to change the color of the light which is nice. The problem is, and you may already know this, that for a cloud connected device like this you actually need a service manager smartapp to due the heavy lifting.

Basically we need to create a smartapp with some REST endpoints that the IFTT maker webhook can call with the temp/humidity payload. Additional, we can add a color picker like the hue bulbs use for example into the DH and when a color is picked it will call a method which will call the service manager method which will call an IFTT maker webhook and change the color. It sounds convoluted, but it should actually be relatively easy to do I think.

I am going to try to play around with it a bit tonight and if I get anything I will get back to you here. Not sure why I never thought of all this before, but I think we can make something pretty decent here.

Nate

YES! I know, it seems like so much just to get these values. I’m messing with the temperature values right now, which I’m fairly sure I can do through webcore. But I suppose a smartapp is more straightforward for most users. And I did add the color picker to mine; it is on the bottom tile, the switch. Also, just to throw this out there as I forgot in my first post. Clicking each individual alert type in the device will clear it. Or activate it.

So literally right after writing my post I did some more thinking and I also think that CoRE is a better option. Setting up a piston is far less work than writing a whole smartapp which is really overkill for what we are trying to do here. Give me a few to mess with it…

3 Likes

I thought this might be of interest:

Ok. There’s a more streamlined UI now. Removed superfluous garage door control. IFTTT still triggers the same. Also, “Lock” will clear a smoke alarm, and “Unlock” will clear a CO alarm. Probably failed to mention you can clear each alarm by pressing it’s respective tile. njschwartz has apparently got the temperature reporting and color picker changing leeo’s color through webcore/ifttt.

https://gist.github.com/andyjkr/a840cb80f7066e94de6825613c1c27ba

Well, all done. First link goes to repository with instructions.

3 Likes

@Andy_Armijo & @njschwartz, first off, I want to thank both of you for your time and effort to create this device type and recipe. I’ve got the device setup in webcore and it seems to be working fine in Smartthings, but I can’t seem to create a ifft recipe to upload the temp & humidity data. Smartthings shows “null” for those values, and I get an error when trying to create the ifft recipe that there is an "Unrecognized Ingredient in action field. I’m a complete noob and this is my first attempt at using webcore and ifft. Wondering if either of you could point me to my errors or post your code/recipes for me to compare?

ifft_err1ifft_err2

Thanks,

Steve

So I’m at work now and I’ll be able to look more later. Everything on core looks good. The ifttt recipe shouldn’t have a value it provides in red. If I remember correctly it should just say temperature? Did you use ifttt’s temperature value which is coming from leeo by pressing +ingredient below body? That should go in the place of the temperature value. Likewise for humidity if you want that value.

Actually, what is the trigger you are using?

Rock on, thanks man. This helped me fix it. In your instructions, you
said to use a trigger of choice, so I just used time of every hour which
didn’t include the Leeo variables. Once I tried using Leeo environment
updates as the trigger, the temp and humidity variables worked. I guess I
should have tried that to begin with, duh. Thanks again for reaching out.

Actually nevermind, after rereading your instructions, it was my failure to
comprehend directions.

Well that’s good to know. I realize now that I have made a few changes to the device type I’m using for this that have a colored background for humidity, reflecting good humidity, dry, and too humid. With a number of other changes specific to my use. But if you’d like that for humidity, let me know. And just to be sure, everything about this is working as expected?

Yes, everything is working as expected, as far as I’ve tested anyways. I
havent actually done any tests for actual alarms yet. Haven’t had any time
without the dog around to go crazy.

I’d certainly take a look at your changes if you care to share.
Improvements are always welcome.

@Andy_Armijo sorry for being so gone for so long. Been crazy busy but I miss my ST tinkering. Lol. Did you get the temp/humidity stuff working? I have it through webCoRE. It has been really reliable and works well. Happy to share it if you guys want to see.

Nate