Open mcrummett opened 8 months ago
Changed
if "bri" in self.state: result["dimming"] = { "brightness": round(self.state["bri"] / 2.54, 2), "min_dim_level": 0.10000000149011612 }
to
if "bri" in self.state:
bri_value = self.state["bri"]
if bri_value is None or bri_value == "null":
bri_value = 1
result["dimming"] = {
"brightness": round(float(bri_value) / 2.54, 2),
"min_dim_level": 0.1 # Adjust this value as needed
}
seems to be checking for null values and changing to 1 if not. Sort of fixed it?
i also had to change
if "bri" in state: v2State["dimming"] = { "brightness": round(state["bri"] / 2.54, 2)} v2State["dimming_delta"] = {}
to
if "bri" in state: bri_value = state["bri"] if bri_value is None or bri_value == "null": bri_value = 1 v2State["dimming"] = { "brightness": round(float(bri_value) / 2.54, 2) } v2State["dimming_delta"] = {}
from my understanding this was due to me adding scenes to my configuration and it loading the light values differently.
Hi,
Can you create a PR with your changes?
If I can work out how too, then yes haha
Mark Crummett
From: Motea Marius @.> Sent: Thursday, November 9, 2023 2:33:12 PM To: diyhue/diyHue @.> Cc: mcrummett @.>; Author @.> Subject: Re: [diyhue/diyHue] Brightness value set to "null" causes DiyHue to fail to start (Issue #948)
Hi,
Can you create a PR with your changes?
— Reply to this email directly, view it on GitHubhttps://github.com/diyhue/diyHue/issues/948#issuecomment-1803945001, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD35N6SMNMYLALILLBURNSLYDTSSRAVCNFSM6AAAAAA7BRHTLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTHE2DKMBQGE. You are receiving this because you authored the thread.Message ID: @.***>
Create a fork of this repo, commit your changes in your fork, then use the pull request button to create a pull request in the main repo. I think there is plenty youtube videos with these steps...
Top dollar. will do it over the weekend, cheers!
Hey, I have this problem, too, using the official add-on in HA. @mcrummett Could you create the PR please?
Sorry yes. I’ll try and do it tonight. Been rather ill this last week so not had a chance
Mark Crummett
From: Jan Wrage @.> Sent: Thursday, November 16, 2023 12:30:47 PM To: diyhue/diyHue @.> Cc: mcrummett @.>; Mention @.> Subject: Re: [diyhue/diyHue] Brightness value set to "null" causes DiyHue to fail to start (Issue #948)
Hey, I have this problem, too, using the official add-on in HA. @mcrummetthttps://github.com/mcrummett Could you create the PR please?
— Reply to this email directly, view it on GitHubhttps://github.com/diyhue/diyHue/issues/948#issuecomment-1814350377, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD35N6V6LNI5ZFY532VSFS3YEYBPPAVCNFSM6AAAAAA7BRHTLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUGM2TAMZXG4. You are receiving this because you were mentioned.Message ID: @.***>
I did as per above and removed the bri: null from the lights.yaml and started fine. I forked but can't understand what has been updated by @mcrummett as one is commented out in main branch anyway and other code looks as per main. Workaround is to just edit the lights.yaml to not have bri: null (set to 0 for example).
The values will go back to null next time the lights are turned off. My changes make it so that if null is found it changes it to 0 and thus doesn’t error
Mark Crummett
From: sini180 @.> Sent: Friday, December 15, 2023 11:27:02 AM To: diyhue/diyHue @.> Cc: mcrummett @.>; Mention @.> Subject: Re: [diyhue/diyHue] Brightness value set to "null" causes DiyHue to fail to start (Issue #948)
I did as per above and removed the bri: null from the lights.yaml and started fine. I forked but can't understand what has been updated by @mcrummetthttps://github.com/mcrummett as one is commented out in main branch anyway and other code looks as per main. Workaround is to just edit the lights.yaml to not have bri: null (set to 0 for example).
— Reply to this email directly, view it on GitHubhttps://github.com/diyhue/diyHue/issues/948#issuecomment-1857722495, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD35N6TJIERSKRU75HWNZZTYJQXYNAVCNFSM6AAAAAA7BRHTLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXG4ZDENBZGU. You are receiving this because you were mentioned.Message ID: @.***>
I know, just couldn't figure out what you've done. Hopefully you have time to create the PR. If not I'll have a look when I get some time :)
All the best Mark @mcrummett
👋 Yeah, still waiting for the PR but no pressure..
Have a nice day!
Oh. Did my original PR not work?
Mark Crummett
From: Jan Wrage @.> Sent: Friday, December 15, 2023 12:51:15 PM To: diyhue/diyHue @.> Cc: mcrummett @.>; Mention @.> Subject: Re: [diyhue/diyHue] Brightness value set to "null" causes DiyHue to fail to start (Issue #948)
👋 Yeah, still waiting for the PR but no pressure..
Have a nice day!
— Reply to this email directly, view it on GitHubhttps://github.com/diyhue/diyHue/issues/948#issuecomment-1857835928, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD35N6QW5EAFQ4JIUINQIMTYJRBUHAVCNFSM6AAAAAA7BRHTLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJXHAZTKOJSHA. You are receiving this because you were mentioned.Message ID: @.***>
seems to be related to https://github.com/diyhue/diyHue/issues/961
New commit was made to fix this issue.
Issue does not already exist?
I have searched and found no existing issue
Select Environment
Install Script
Home Assistant related?
No
Description
Both with the HA addon and standard host install, the app will fail to restart with the below error
If i go into the lights.yaml and ensure that any bri values are set to 0 rather than "null" it starts fine. However i am unsure what is causing the null values rather than 0-255.
Errorlog:
Steps to reproduce
Unsure when/why brightness values for random lights will get set to null but doing so manually would allow the issue to be reproduced
Please enter your operating system details here
Ubuntu 22.04. However the HA addon has the same issue
What DiyHue version(branch) are you using?
master (latest)