I was trying to lock my front door without using the "are you sure" modal, so I added a Link tile that requested the MakerAPI "lock" command. It works but since its a link it actually browses to that api route in the browser, where I'd like it to just make the api request and stay in the dashboard. Is this possible? Am I missing something simple? I'm new to HE but not new to programming so I feel kinda dumb for not being able to figure this out.
I'm not sure how to avoid that with a link tile, but it seems like using Maker API might be more than you need for this scenario anyway. Why not create a virtual button device along with a Button Controller (or Rule, or any app that can do this) automation that will unlock the door in response to the button push? You can add that button to the dashboard using the "Button" template and choose the button number to (virtually) "push" when that Dashboard tile is tapped.
Perfect! Thank you, I have not yet jumped into the Rules engine yet but your suggestion gave me a crash course. It worked perfectly for locking the door, I'll have to figure out something for lock vs unlock...looks like the Rule Machine could be pretty fun to play around with. I was thinking two options to have a virtual button lock vs unlock:
- is it possible to setup a button controller so that like:
if (lock.status == 'unlocked') trigger 'lock'
else trigger 'unlock'
- i could create separate virtual buttons (on for lock and one for unlock) and show/hide the buttons via css (haven't looked at the DOM yet, not sure if there was some class that will indicate the current lock status)
Yes, that is very much doable and you’ve already got the logic right. In Rule Machine, just select Conditional actions and then you’ll find your IF logic in there.
Edit: Just don’t use “simple conditional action”
Excellent, got it setup and working perfectly. Originally i was using a button controller but it seems to be a lot more powerful using the rule machine. Thanks for the help.
I’m sorry, I should have read your question more closely. You did after all ask if it could be done in button controller. Button Controller (the app) is very powerful in itself and it works like RM. However, only a subset of RM’s feature set is available in Button Controller, and as you’ve noticed, IF logic is not part of that feature set.
All good, I’ve been meaning to explore RM and I’m glad I found a need to. I’m a recent Wink2 convert and the level of customization is pretty exciting.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.