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

Expose support for Routines and Modes #122

Open
robross0606 opened this issue Jan 12, 2018 · 8 comments
Open

Expose support for Routines and Modes #122

robross0606 opened this issue Jan 12, 2018 · 8 comments

Comments

@robross0606
Copy link

robross0606 commented Jan 12, 2018

All device types seem to be exposed to MQTT, but not routines, scenes or modes. It would be really useful to be able to use MQTT output to trigger routines or scenes (functionally similar to momentary switches or buttons), as well as use MQTT input/output to work with Mode (DYNAMIC_ENUM).

@stjohnjohnson
Copy link
Owner

Hmm, that would be pretty cool. I don't use modes or routines right now, most of my automation is around manipulating devices that only work on SmartThings. If you're interested in contributing it, I'm happy to review a pull-request and give feedback.

@almostserious
Copy link

Somebody already made an extra Smartapp to add Smart Home Monitor modes:
https://ethitter.com/2016/08/smartthings-smart-home-monitor-shm-mqtt-home-assistant/

Maybe this can be used to add it here as well

@mschwartz
Copy link

I wrote my own Home Automation system (github.com:mschwartz/RoboDomo) that interacts with SmartThings via MQTT-Bridge (thanks for this!) and with my TVs (direct/WiFi API) and Nest (directly with Nest.com/API), Harmony Hub/Remote via Harmony servers' API, etc.

I wrote my own macros (scenes/routines, whatever you want to see them as). For example, Macro "Pause TV" (so you can go get a drink or to the restroom) tells Harmony to pause (that will pause any device Harmony knows about) and turns on the kitchen and bathroom lights. A related macro, "resume TV" tells harmony to play and turns off those lights. All my stuff is done via MQTT, similar to this MQTT-Bridge. A macro is simply an array or list of sequential topics/messages to send.

Currently, I can use Alexa to control Harmony or SmartThings because there are already existing skills.

What I'd love to be able to do is to create SmartThings skills that basically do nothing. If I can get MQTT messages that these "nothing" are to be run, I would trigger my own Macros. The amount of work for me would be minimal.

I'd love to be the "help wanted," but I know virtually nothing about SmartThings programming. Given that you already have done this MQTT Bridge, it seems to me it might be a really easy thing to add. The messages are generated and sent to the bridge in the SmartThings cloud. If the activities/scenes messages are identifiable, your IDE program would simply relay to MQTT like a switch or whatever.

@raman325
Copy link

raman325 commented Dec 4, 2019

Not sure how to add routines support to this yet, but I added support for hub modes here: https://github.com/raman325/smartthings-mqtt-bridge (I also added some error handling that will reset the state of a topic in case you attempt to publish an invalid message. The errors are logged in the IDE)

@raman325
Copy link

raman325 commented Dec 4, 2019

Added support for routines as well. The message format for routines is slightly different from typical device states/attributes but I think it helps keep the messages more organized. Check out the new section in the README to see how to use it: https://github.com/raman325/smartthings-mqtt-bridge#routines

@robross0606
Copy link
Author

This was so long ago, I don't remember how I intended to use it! 🤣
Awesome work though. Can't wait to try it... on... something...

@raman325
Copy link

raman325 commented Dec 4, 2019

I needed it myself so that I could experiment with moving some of my automation logic into HA, and I figured it would be a fun challenge 🤷‍♂

@mschwartz
Copy link

A funny thing...

I ended up moving my devices to a Hubitat hub, implemented my own MQTT bridge for it, and now use virtual devices to trigger my custom automations.

The MQTT bridge for Hubitat took me a half hour to implement.

FWIW, Hubitat runs groovy code that’s 99.9% compatible with SmartThings, but I’ve not had to install any custom groovy. The performance is impressive, since there’s no cloud involved. From motion sensor to light on is instant instead of seconds.

I still have a small number of devices on the SmartThings hub, so I still use this bridge. I’m thankful that it exists.

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

No branches or pull requests

5 participants