Page 1 of 1

Android Wear widget / overlay question

Posted: 23 Dec 2015 20:20
by rtenklooster
Hi there,
Just bought my first smartwatch, first thing was buying this great app ;)

I have been playing around with custom widgets for a couple of hours now, and i'm wondering if anyone can advise me on this problem:
- I created two custom widgets: 1 shows the actual room setpoint for my HVAC. It does a http request, decodes the json and shows the room setpoint.
- On the first information widget i can swipe left to close, swipe right to open another widget:
- The second widget contains 4 rounded squares with 16 - 18 - 20 - 21, it has 4 "clickable points"
- I added a swipe left and right action to all four squares with the action: hide overlay.

So far so good, i can open the first widget, close it or swipe to navigate to the next widget. I can close the second widget by swiping.

The problem however is the following: i also added a http request action on click at all 4 squares. This allows me to remotely set the room setpoint.
What i would like - and i don't know if i'm missing something - but when i click, i want to a. do the http request AND b. hide the overlay AND c. show another overlay with something like: remote setpoint sent.

Now i click, i don't know if it worked, and i have to swipe to close the window.

Should i make a new Flow with those combined actions or something? It would be great to be able to execute multiple actions by one click.

Hope anyone can help me with this. I'm willing to share my flows as soon as i have this working. I know a lot of people of the domoticz ( big dominica forum ) are intererrested in such handy things :)

Update:
I have managed to accomplish this by adding a new flow, added the tasks and executed the flow when clicking on a setpoint.
I have the feeling it's a little bit of a workaround. Maybe the developers can find a way to simplify those processes so you don't have to make several widgets and flows for this (simple) task.
I made a little demo video:
https://youtu.be/g8dilKkIJjg

Re: Android Wear widget / overlay question

Posted: 29 Dec 2015 20:11
by Martin
Hi,

When you want to execute more than one action in a clickable widget you can add all actions to a flow and use action Execute Flows to execute the flow you want (you could also execute multiple flows, not sure if this helps in this case).
For your use case you could also use one flow for several of the buttons and use the variables provided by the widget to determine what HTTP request to execute.
Variables of interest might be gesture, swipe_velocity_x, swipe_velocity_y, widget_cell_x, widget_cell_y. I recommend to create a flow with one condition Debug Dialog and execute this flow for click/swipe so you can see the actual provided variables and values.

Regards,
Martin