Getting the device by its id takes a long time

It might be that we’re talking about this issue to further our understanding of HomeyScript, for which I absolutely support that. However, if we’re concretely discussing how to relatively dim some lights based on input, it feels better to just use flow cards?

1 Like

Hi Articate,

In normal cases your card would probably be fine. Since this is about two plafonds with three lamps each my dimming ‘algorithm’ needs to do more than a simple fixed value dimming. The 20% I used was more of a testing value and not evident in my test code above.

Good call though.

So you’re going to scale a max dim for each individual plafond or something? Like, that some plafond can go to 100%, but others only to 70%? and then if you dim 20% from 100% that’s 80%, but 20% from 70% would be 56% instead of 50%, is that what you want to achieve?

I need to experiment a bit to see where I will land with how the dimming algorithm will work in the end.

Since each plafond has 3 ikea lamps there is lots of room for how to execute the dimming. In my last dimming step only one of the 3 lamps is lit 5% (ikea lamps turns off lower than that) and that is a perfect level for movie nights or similar where only a guide light is necessary. On the other hand the 3 lamps in the plafond at 100% each serves its purpose as well. Everything between those levels and number of lamps will take some time to figure out since I only want to deal with no more than 4-6 levels to work with.

I have two of these plafonds in my living room but only one is ‘smart’ at the moment and since they each cover half of the room I want to come up with something smart in the end. I’m also considering replacing one of the lamps with its rgbw version to get a bit more variety at night. Time will tell…

Hi @Joka
I just thought of the fact the Papertrails app, can log time in ms;
so no stopwatch or timestamp-script-cards are needed for measuring flowcards or scripts :upside_down_face:

.
log:

2022-07-14 16:04.43.430		TurnLightOn start (script-monitor)
2022-07-14 16:04.43.937		TurnLightOn_FilterDevices - runtime (script-monitor )
2022-07-14 16:04.45.053		TurnLightOn_LoopOverDevices - runtime  (script-monitor )

That’s true but especially for this case I like to get a notification directly with the calculated runtime.

1 Like