[APP][Pro] Chronograph - Adds precise timer, stopwatch and transition functionality to Homey

I am looking for a simpler solution for the problem described below:

I want to start a dim transition with a wall switch, connected to a Shelly 1L.
But I want the duration of the transition to be adjusted to the dim level of the lamp. For example, if the dim level is 1.0, the transition should have a duration of 10 seconds and 20 steps. If the dim level is 0.5, the transition duration should be 5 seconds and be done in 10 steps.

Because you can use tags in the transition flows, but can’t do math with the tags, I created a flow to calculate the duration and step level.
See below:

Ik know I can leave out the first logic variable called Woonkamer Plafondlamp Dinwaarde, because this is just the dim level from the lamp. I just made this variable so I can see it changes during the transition in my list of variables.

With the variables, I created the transition flow:

I had to disable the first flow, because otherwise Homey disables that flow because it gets triggered too much.

I was hoping I could somehow make the flows easier or use less variables, because I’ve got to program a lot of flows and variables for a lot of lamps…
Are there ways to incorporate or calculate dim duration and number of steps without using the first flow?

This is probably better done by a routine in HomeyScript.

I’m not really familiar with writing scripts in HomeyScript. Do you have an idea how to do that?

Start by reading and understanding the examples and try to make changes, and for specific problems, ask for assistance here, but not for complete solutions.

@TheFops: I didn’t read the whole story, but it looks like you are using Chronograph (very useful app by the way) to recreate something that [APP] Splines does way better, maybe you should look there.

Thanks for the suggestion, but to me it seems that splines is more useful for times during the day. But I just want to start a transition with a wall switch…Or am I wrong?

How you want to start a transition is not that important, but what you want isn’t a lineair function. Transitions are lineair, splines are not, so that is why I think they are a much better fit.

I do not know the shelly device that well, but if the button is also directly controlling the bulb that you want to apply the transition to then that is a challenge in its own, regardless of the kind of transition you use. Then you are bound have the bulp start in the wrong brightness and also at risk of ending up in an infinite loop.

Reading up un your example again, your needs are lineair. But your problem is that the the transition is determined by the thing you want to transition, so you are looking at the infinite loop trouble too. The trigger MUST be something else then the dim value. You can use the the dim value in the then part of the trigger to calculate the transition though, as long as you calculate all the things you need then.

The Shelly device is not connected to the lamp. I just use the Shelly’s as a wall switch input, they don’t have an output (they are linked to the light bulb, but the switch doesn’t switch the bulb on or off. It just acts as an event action).

I’m not sure that I understand the second part of your reoonse correctly, but from what I see is that my transition is linear, only the starting point and therefor the duration is different each time.It would be nice to use some simple math in the transition values, but from what I see, that isn’t an option.

Usinf splines won’t solve my problem either, because X would then be dim level and Y as well, so I’m not sure how that would help me.

PS: maybe I should start a espérate topic for my problem? Because maybe it’s not only related to the Chronograph app…

If you calculate the values using logic cards in the flow that is triggered by the shelly, you could use the variables with the calculation when starting your transition.

I guess there has to be a 1 second delay for starting the transition after calculating the values, right?

Due to Homey doing things asynchronously yes. It could be prevented I guess if you trigger on the change if the variable, but that would involve daisychaining multiple flows for each variable and resetting the variable afterwards.

A better option could be to calculate the values in an and condition using Homeyscript. That is always evaluated before then. You can set local tags from Homeyscript I believe.

Anyone having trouble with the delay option currently?
My 10 minute delays currently fail with [object Object] error somehow…
@BobKersten zou je eens een blik kunnen werpen? Vertraging van 60 seconden werkt wel maar bij 120 seconden geeft hij al bovenstaande error. Het is ook op andere homeys getest op het Facebook forum.

I thought there was a bug, but I just misspelled my timers. All’s good.

Very nice app! Thanks @BobKersten

1 Like

@BobKersten

Hi all,

A few posts back I read the differences between this app and the countdown app. One difference was mentioned as a pro function in the Countdown app:

  • The timer is available as a variable and can be read at any time, not only when the timer has stopped (Chronograph)

Is it possible to use the Chronograph app in a easy way to get the current value of a running timer?

Add it as a device.

Will do and test! Thanks.

1 Like

Having issues step ignoring Chronograph transition.
My flows exists of two flows

Flow one

.
Flow two

When I start flow one it gives me information about step level timeline.
The problem is that most of the time I’m missing a step.
Homey CPU is not overloaded at the running time.
Timeline is not the issue because “paperline Log” is running parralel with timeline and swows the same missing step.
Anyone can help me?


-=-=- Log Cleared from Settings page 20210822191255] -=-=-
2021-08-22 19:13.15 Test 0 0 true false
2021-08-22 19:15.15 Test 120 2 false false
2021-08-22 19:16.15 Test 180 3 false false
2021-08-22 19:17.15 Test 240 4 false false
2021-08-22 19:18.15 Test 300 5 false false
2021-08-22 19:19.15 Test 360 6 false false
2021-08-22 19:20.15 Test 420 7 false false
2021-08-22 19:21.15 Test 480 8 false false
2021-08-22 19:22.15 Test 540 9 false false
2021-08-22 19:23.15 Test 600 10 false true

I’ve created a flow to start the transition, and another flow triggered on the transition reaching a value. When the second flow runs, it doesn’t seem to apply the transition value in an action to Dim to that value. I can use the TransitionValue ina notification but the dim action doesn’t work. Am I missing something in the workflow?

Most likely is that the transition value is not in the proper range for dimming. The UI speaks of percentages but the actual value is 0 to 1 and not 0 to 100.

Thanks for that, it’s working perfectly now!

1 Like