Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimming lights using free@home #76

Open
rernst opened this issue Feb 2, 2025 · 7 comments
Open

Dimming lights using free@home #76

rernst opened this issue Feb 2, 2025 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@rernst
Copy link

rernst commented Feb 2, 2025

Back again with 'free@home weirdness'... Using free@home switches I should be able to perform a dimming action by long pressing up/down. This works however the light 'reset' to the brightness before the dimming action after I release the button. If I look at the bifrost log I indeed see API calls that (in this case) decrease brightness with 10% at a time, and a final call setting brightness back to 100%. See attached log file: bifrost_dimmer.log.

Do you have any clue what is happening? I do not see this behavior when controlling the same light using a original Hue bridge and/or DiyHue.

@chrivers
Copy link
Owner

chrivers commented Feb 4, 2025

Hm, that's a really good question...

According to the log, Bifrost is simply asked to dim the light in exactly the pattern you describe, and so of course, it does that.

Is there any kind of log or debug output available from this "free@home" thing? I'm not familiar with it, but I assume it's some kind of home automation system?

@rernst
Copy link
Author

rernst commented Feb 4, 2025

Yes, Free@Home is a KNX based system from Busch Jaeger (not my choice came with the house, but in general it works). Unfortunately pretty closed down, but I did manage to find a 'debug log' output.

See bellow for a snippet. In this snippet you can view the last 3 steps of a dimming action of 3 lamps, 2 controlled by diyhue (6c2b59fffee5d164), 1 by bifrost (bc2411fffe4339bd). The last 3 commands are the commands send (i think) on release, as you can see they are identical to the second to last for diyhue, but for bifrost it is not (100 brightness, the original brightness before dimming).

You can also see an error, I think Free@Home is unable to parse the response from bifrost?

So, I think what is happening that on release Free@Home sends the last known values for a light (like with a single press, turning a light on). Instead of the last know 'dimming' value this is for the Bifrost controlled light still the original value.

Does this somewhat help? Maybe we should start with unknown owner error?

Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 6c2b59fffee5d164 sending command: {
  "bri":24,
  "on":true,
  "transitiontime":5
}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 6c2b59fffee5d164 sending command: {
  "bri":24,
  "on":true,
  "transitiontime":5
}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 bc2411fffe4339bd sending command: {
  "dimming":
  {
    "brightness":9.448819
  },
  "dynamics":
  {
    "duration":500
  },
  "on":
  {
    "on":true
  }
}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp         927 6c2b59fffee5d164 change successful BEEDB4F8000D
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp         927 6c2b59fffee5d164 change successful BEEDB4F80009
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp         927 bc2411fffe4339bd change successful BEEDC4880007
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridgeapi2.cpp     295 bc2411fffe4339bd event with missing or unknown owner: {  "color":{  "xy":{  "x":0.459,  "y":0.4104}},  "dimming":{  "brightness":9.448819},  "id":"a287ad00-3d6e-5df0-bac6-e10f0d6a8eb4",  "id_v1":"\/lights\/7",  "on":{  "on":true},  "type":"light"}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 6c2b59fffee5d164 sending command: {
  "bri":1,
  "on":true,
  "transitiontime":5
}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 6c2b59fffee5d164 sending command: {
  "bri":1,
  "on":true,
  "transitiontime":5
}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 bc2411fffe4339bd sending command: {
  "dimming":
  {
    "brightness":0.393701
  },
  "dynamics":
  {
    "duration":500
  },
  "on":
  {
    "on":true
  }
}
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp         927 6c2b59fffee5d164 change successful BEEDB4F8000D
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp         927 6c2b59fffee5d164 change successful BEEDB4F80009
Tue Feb 4 21:35:29 2025 mrha_huecontroller | -- hue_bridge.cpp         927 bc2411fffe4339bd change successful BEEDC4880007
Tue Feb 4 21:35:30 2025 mrha_huecontroller | -- hue_bridgeapi2.cpp     295 bc2411fffe4339bd event with missing or unknown owner: {  "color":{  "xy":{  "x":0.459,  "y":0.4104}},  "dimming":{  "brightness":0.393701},  "id":"a287ad00-3d6e-5df0-bac6-e10f0d6a8eb4",  "id_v1":"\/lights\/7",  "on":{  "on":true},  "type":"light"}
Tue Feb 4 21:35:30 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 6c2b59fffee5d164 sending command: {
  "bri":1,
  "on":true,
  "transitiontime":5
}
Tue Feb 4 21:35:30 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 6c2b59fffee5d164 sending command: {
  "bri":1,
  "on":true,
  "transitiontime":5
}
Tue Feb 4 21:35:30 2025 mrha_huecontroller | -- hue_bridge.cpp        1387 bc2411fffe4339bd sending command: {
  "dimming":
  {
    "brightness":100.000000
  },
  "dynamics":
  {
    "duration":500
  },
  "on":
  {
    "on":true
  }

@chrivers
Copy link
Owner

@rernst thank you for the detailed logs. This is indeed pretty strange.

I think there might be some minor difference between the reply from a hue bridge vs. from bifrost.

Your hypothesis that this causes free@home to get confused sounds quite likely.

Do you have a chance to join us on discord? I think that might make it easier to perform some tests, that would help determine the cause of this.

@rernst
Copy link
Author

rernst commented Feb 17, 2025

As discussed on discord two new log files:

Setup:

  • Ikea TRADFRI bulb E14 CWS globe 806lm
  • Hue white ambiance E14

Action: Dimming from full brightness to low. On release of dimmer button the brightness 'jumps' to 100% again for both lights.

@rernst
Copy link
Author

rernst commented Feb 18, 2025

Two more extra log files, with dimming action from 100 down:

  1. Both lights (same as above) via zigbee2mqtt + diyhue
  2. Other light via zha + diyhue

Interesting observation, log 1 shows sort of similar behavior, but instead of jumping back to fill brightness the lights jump back 1 step. (from 75 to 101).

Log files:

  1. free@home_diyhue_zigbee2mqtt.log
  2. free@home_diyhue_zha.log

@chrivers chrivers added bug Something isn't working help wanted Extra attention is needed question Further information is requested labels Mar 16, 2025
@chrivers
Copy link
Owner

@rernst Just a quick update.

I had written a long response to this issue, where I said I didn't really know what was going on, and various ideas for how to try and get to the bottom of this.

But then I took one more at the latest log files you sent, and this time I spotted something.

Two things, actually:

  1. Dynamic

The free@home system uses "dynamics", a feature of the Hue API where things like fade speed and (as far as I remember) certain animation parameters can be specified:

{
  "dimming": {
    "brightness": 89.763779
  },
  "dynamics": {       //
    "duration": 500   // <- these lines
  },                  //
  "on": {
    "on": true
  }
}

Currently, Bifrost only supports these fields enough to ignore them 😛

So that might be a problem, but I don't think it's the main one.

  1. event with missing or unknown owner

This "warning" (it's classified as "info" in the free@home log) comes up like so:

Mon Feb 17 22:09:09 2025 mrha_huecontroller | -- hue_bridgeapi2.cpp     295 bc2411fffe4339bd event with missing or unknown owner: {  "color":{  "xy":{  "x":0.459,  "y":0.4104}},  "dimming":{  "brightness":89.763779},  "id":"a287ad00-3d6e-5df0-bac6-e10f0d6a8eb4",  "id_v1":"\/lights\/7",  "on":{  "on":true},  "type":"light"}

I think this implies the real hue bridge would normally send the owner field in the event stream, for this type of update.

But then again, this log line doesn't include the full event stream line, so it's a bit hard to tell.

At least, there are finally some leads to go on!

After I finish the big outstanding merges, I'll go over all the issues again.

In the meantime, perhaps you can test with the newest version of Bifrost?

Hundreds of commits have gone into the project, since last we talked about this :)

@rernst
Copy link
Author

rernst commented Mar 18, 2025

Hi Christian, thanks for the heads up! I am following the project in the background (here and discord) and was indeed planning to test again with the latest version. I am currently migrating from zha to z2m for all my lights (using diyhue via HomeAssistant for now, this works 'okayish'). As soon as I have finished that (might take a while, need to find a quiet moment at home;)). This will allow me to also test with different lights, etc. I will keep you updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants