Link Hue dimmer to Govee striplights


#1

1) Give a description of the problem
I’m new to webcore, lol

2) What is the expected behaviour?
Tap On = on, tap Brighten = add 20% to level, hold Brighten = slow level increase, tap Dim = subtract 20% from level, hold Dim = slow level decrease, tap Off = off.

3) What is happening/not happening?
I’m learning? So far I have the Dimmer using the edge handler from here and the lights using this handler.

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING


#2

Most is possible here in webCoRE, but I would re-think these two:

  • hold Brighten = slow level increase
  • hold Dim = slow level decrease

A “hold” is seen as a single event.
(and “fades” are a slippery subject)


Perhaps a slight modification:

  • Tap On = on,
  • tap Brighten = add 15% to level,
  • hold Brighten = add 30% to level,
  • tap Dim = subtract 15% from level,
  • hold Dim = subtract 30% from level,
  • Off = off.

#3

Hmmm, k. I assumed that the dimmer could function the same as it does when connected to the Hue hub. For whatever reason it can’t, so I have to reassess how I want it to function before coming up with some code. I’m figuring under one second per tap and 10 seconds to fully dim or brighten. That seems to be faster than the Govee handler responds so I’ll probably have to include a way to cache the taps and space them out. I also want greater precision at the darker end which increases complexity. Maybe 1, 2, 4, 6, 8, 10, 15, 20, 25, 30, 40, 50, 60, 80, 100? I think I can figure this out, so I just need to learn how to enter it into webcore in a workable way.


#4

For reliability, I would avoid “spamming” the hub with commands…

I would consider letting your taps adjust a Simulated Dimmer Switch (which adjusts instantly)… and then 2 seconds after the SimSwitch starts moving, then send a single command to the striplights to set the new level. (repeat if necessary)


#5

Agreed, but this is a dimmer. If hold to adjust won’t work and tapping is the alternative, people are going to load it with as many taps as they think is necessary. I’ve seen this on other laggy remotes (and am guilty of it myself). So that brings my next question: What happens when a rule is triggered again while still processing a prior occurrence?

I’ll look into that, thanks.


#6

The piston code starts over again at the top…
(what actually happens depends on the code you write)


In my household, (to help circumvent spam), I have “trained” everyone to pause in between piston executions.

Generally speaking, I try to never trigger any piston more than once per 10 seconds. If I must allow for faster execution, then that code will be SUPER slim and barebones, (with no WAITS, or fades etc.)

We want the piston to start and stop faster than your fastest expected input.


#7

OK, so somehow I’ll set the piston to not run simultaneous with itself. Why can’t I set a loop to increase/decrease the dimmer level until the most recent button press is over two seconds old? (I’ve decided against using a simulated switch as a buffer because the visual feedback needs to have as little lag as possible.)


#8

I think I should “tap-out” on this one.

When it comes to loops, fades, and spamming triggers… I try to avoid them all… but I would never put all three into a single piston.

Honestly, the choices you are making will create lag (and unreliability).


Fresh Perspective:

I would be tempted to try to teach your house a bit of AI… For example, in the morning, let webCoRE automatically set the level to W. When you come home from work, it can set the level to X. When you are watching TV, set level to Y, Before bed, set level to Z etc.

I admit, this requires a bit more thinking ahead of time, but it reduces the need to constantly fiddle with levels. (and actually makes your house smart)

On that note, I would likely pick 4 alternative levels (not automated) and fall back on:

  • hold Brighten = Set level to 80%,
  • tap Brighten = Set level to 60% (or her fav)
  • tap Dim = Set level to 30%, (or his fav)
  • hold Dim = Set level to 10%,

This gives you the power to over-ride your pre-configured levels, while avoiding loops, fades and spam.

Just my two cents.


#9

Note that if you go this route, it opens up infinite possibilities back in webCoRE.

Here’s an example using a Nested IF:

IF tap Brighten
Then
   IF Time is between X & Y
   Then
      Do something fancy
   Else
      Do Set level to 60% (default action)
   END IF
END IF

This can allow the same button press (tap Brighten) to do different actions based on other criteria. (Time, who is home, day of week etc)


Note that “something fancy” will be limited if that trigger is spammed


#10

I’m trying this just to learn and as a starting point. Naturally it isn’t working.