First post here so firstly thank you to everyone contributing. After roughly 2 months of discovering HA I’ve managed to get hold of a HP Elitedesk, get my first ever VM set up, and get HA running along with Z2M and a bunch of dimmer/switch modules (Moes Zigbee). There were roadblocks along the way but I’ve managed to Google/Youtube my way through them thankfully.
I’ve currently only got the lights in HA along with some Eufy cameras which I’m not completely in love with, but the reason for the post is I’m finding the lights don’t seem to dim below 20% or above 75% (from what I can tell).
What I’d like to do is have 0% in my frontend (mushroom cards) be 30% on the lights, and show 100% when the light is at 75%.
I’ve seen the following topic (Remapping light brightness) reference remapping lights but I can’t figure out how to get going with Templates. I’ve seen a Youtube video but it doesn’t relate to lights and although I’ve got this far with HA I’m no programmer so I don’t completely understand code/scripting.
I’m hoping someone can chime in here and help me get this sorted as I don’t really like the idea of having to control light brightness between 20% and 75% on the sliders.
Apologies in advance for the stupid question, but how to I go about implementing this? Lets say I’ve got a device named ‘kitchen_lights’, how would I add the above (ideally the 2nd tunable value version you shared) with the kitchen lights?
Then create an automation with a State trigger referencing your input_number.brightness and an Action to call the light.set_brightness with the adjusted number. You can set the trigger up via the UI but you’ll need to use the Edit as YAML function to set up the template in the action.
I’ve just had a go: it’s easiest to create the automation to call the service to set a brightness of e.g. 50%, then switch to Edit as YAML mode (three dots at the top) and adjust to look like this (but with your kitchen lights):
Got that all in place, but what do I use in the dashboard? I’m using Mushroom Cards at the moment but when I use the Mushroom Light Card I’m not able to find the automation/input number? Is it just a case of using the normal light entity?
Apologies again if this is super basic stuff! I’ll get there eventually haha. Thank you for the help so far!
Edited:
Ignore the above, I was being stupid! Got the Mushroom Light Card in place but I’m seeing an error saying “Failed to call service input_number/turn_off. Service not found” when I click it. Any ideas?
EDIT: I should mention that you need to replace light.your_light with whatever your light entity_id is. Make sure to keep the quotes around that entity_id too if it’s wrapped in quotes. Also, you may want to rename truncated_light and Truncated Light to whatever you want to name it. It can’t share the same name as your source light light.your_light.
Thank you. Added, but I won’t know it’s working until the weekend now lol.
I’d need to do this for all the lights that I need to adjust the brightness range for right? Is it a case of copying and pasting the same code and changing the light entity, or simply add in all the other light entity ID’s after the kitchen_lights one?
Why can’t you test it now? Also, what hardware is this? A lot of times hardware has the ability to truncate the dimming starts and stops before it even is exposed to HA.
I won’t be at the property until the weekend, and I can’t tell from the dashboard if it’s working or not, unless there’s a way to test it?
I’m using Moes dimmer modules for the lights, with dimmable spotlights/downlights. As far as I’m aware more traditional rotary dimmers do have something to physically limit the range but with these it’s all software.
Just use the newly created entity. FYI this only affects the entity in HA, this does not modify the actual hardware ranges. If that’s what you’re after, this will not solve that problem. There’s nothing in HA that will solve that problem. That can only be adjusted via the hardware’s firmware.
Another stupid moment. I’ve got it added as a Mushroom card now with a brightness slider and when it turns on it does only turn the light on to 75% which is good news!
But when I go to dim it via the slider it’s showing error “Failed to call service light/turn_on. must contain at least one of entity_id, device_id, area_id.”
Hello,
Sorry to bring this topic again. I used @petro template. Everything works like a charm. However, I receiving an error every time when I turn off the light:
Logger: homeassistant.components.template.light
Source: components/template/light.py:456
Integration: Template (documentation, issues)
First occurred: 21:02:24 (1 occurrences)
Last logged: 21:02:24
Received invalid brightness : -92 for entity light.truncated_light. Expected: 0-255