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

Group lights have color temperature attribute with 0 value #16

Closed
bartnaaijkens opened this issue Jul 9, 2018 · 19 comments
Closed

Group lights have color temperature attribute with 0 value #16

bartnaaijkens opened this issue Jul 9, 2018 · 19 comments
Assignees
Labels

Comments

@bartnaaijkens
Copy link

Hi,

Recently encountered an issue with HA in combination with Google Assistant and Deconz. I initially registered this issue; home-assistant/core#15295 and did a commit to fix it here home-assistant/core#15305 (with my very limited knowledge of HA and Github)

After digging a bit deeper I found it is being caused because Deconz groups exposed as light can have a color temperature attribute which can be 0 which is not a valid value and causes the ZeroDivisionError. For more details look in the link above.

Hope you can fix it.

@Kane610
Copy link
Owner

Kane610 commented Jul 9, 2018

Rest assured I have this on my to do. But some other things have been higher up on my priority list. Will try to get this done before next rounds of beta begins.

@Kane610 Kane610 self-assigned this Jul 9, 2018
@Kane610 Kane610 added the bug label Jul 9, 2018
@bartnaaijkens
Copy link
Author

Awesome, take your time. Not in a hurry but just wanted to make sure it's on the radar.

@Kane610
Copy link
Owner

Kane610 commented Jul 10, 2018

@bartnaaijkens could you possibly enable component debug logging and give me the json data for your groups?

@Kane610
Copy link
Owner

Kane610 commented Jul 10, 2018

This is entity info, I'd like the raw json data from deconz. It should be printed while hass is starting

@Kane610
Copy link
Owner

Kane610 commented Jul 11, 2018

Yes. Can you give me one good and one bad example?

@bartnaaijkens
Copy link
Author

In the entities overview (as also in the logging posted earlier) I do the following differences;
With all lights switched which works I get the following attributes on the living room group light

min_mireds: 153
max_mireds: 500
friendly_name: Living Room
supported_features: 63

With 1 light on the following;

min_mireds: 153
max_mireds: 500
brightness: 127
color_temp: 0
hs_color: 225.176,100
effect_list: colorloop
rgb_color: 0,63,255
xy_color: 0.137,0.065
friendly_name: Living Room
supported_features: 6

@Kane610
Copy link
Owner

Kane610 commented Aug 1, 2018

@bartnaaijkens would it work as long as ct is greater than 0?

@bartnaaijkens
Copy link
Author

I think it will as it went wrong with a division by zero (return math.floor(1000000 / mired_temperature) in home-assistant/core#15305).

According to the Deconz API ct.state value should be inbetween 153 and 500.

@Kane610
Copy link
Owner

Kane610 commented Aug 2, 2018

@bartnaaijkens would you mind trying this change out if it fixes your problem?

home-assistant/core#15791

@bartnaaijkens
Copy link
Author

I wouldn't know how to, to be honest. Not really a developer/advanced HA user.

@Kane610
Copy link
Owner

Kane610 commented Aug 2, 2018

how do you run your hass?

@bartnaaijkens
Copy link
Author

via hassio... would it be possible to just login via SSH, change the code of the file you committed and restart HA?

@Kane610
Copy link
Owner

Kane610 commented Aug 2, 2018

yes, that would work, if you have access to the file system

@bartnaaijkens
Copy link
Author

would https://developers.home-assistant.io/docs/en/creating_component_loading.html also work? Looks like a better approach...I'll give it a go tonight

@Kane610
Copy link
Owner

Kane610 commented Aug 2, 2018

Without reading it, if you're meaning creating a custom component, might work. But I am not certain since deconz uses configuration entries.

@Kane610
Copy link
Owner

Kane610 commented Aug 2, 2018

The other way would be that you set up a new system by downloading the PR

@bartnaaijkens
Copy link
Author

Managed by creating a custom component (with all *.py files and your customized one).

The fix works like a charm! Google Assistant responds perfect now, no more division errors.

@Kane610
Copy link
Owner

Kane610 commented Aug 2, 2018

Awesome! I will remove the wip tag then. Thanks for your support!

@Kane610
Copy link
Owner

Kane610 commented Aug 3, 2018

It seems that Balloob cherry picked this fix for 0.75 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants