homeassistant-powercalc icon indicating copy to clipboard operation
homeassistant-powercalc copied to clipboard

calculation_enabled_condition in GUI ?

Open chertvl opened this issue 1 year ago • 6 comments

Hello, my question is very simple, can we add calculation_enabled_condition: feature to GUI mode? Thanks!

chertvl avatar Sep 13 '22 20:09 chertvl

I did not add it on purpose because I want to keep the GUI simple and not too cluttered with options. Only added the imo most used options to the config flow. Maybe I will add an advanced section to the GUI for this option, but need to give this a more thorough thought.

bramstroker avatar Sep 14 '22 21:09 bramstroker

Implemented with #1110

After setting the basic configuration options a separate step is shown where the advanced options can be set. Currently I have only added the calculation_enabled_condition, but we can add more in the future.

Screenshot 2022-09-22 at 11 33 31

bramstroker avatar Sep 22 '22 09:09 bramstroker

You may test this by installing the master branch.

bramstroker avatar Sep 22 '22 09:09 bramstroker

You may test this by installing the master branch.

Works perfectrly! Now I can split yeelight-nightling and main mode for my ceiling lamp, when I calculate power from brightness. Thank you!

chertvl avatar Sep 22 '22 09:09 chertvl

Works perfectrly! Now I can split yeelight-nightling and main mode for my ceiling lamp, when I calculate power from brightness. Thank you!

Could you elaborate more on this? Can also be helpful for others.

bramstroker avatar Sep 22 '22 10:09 bramstroker

Could you elaborate more on this? Can also be helpful for others.

Many Yeelight ceiling lights have Nightlight mode. Thats mode, when yellow-white leds using as low as possible power, for example in full darkness round lamps looks like moon. But when we using Yeelight integration we have only one light.* entity (and additional second light.* _ambilight for models with rgb-backlight). Main light.* can be turned on or off, and it will to turn on last mode (main cold-warm light up to max brightness, or nightlight mode). You can enable nightlight mode with services.

The only way to check if nightlight mode is on - take a look at main light.* entity attributes, or look at the binary_sensor.*_nightlight at the device page.

Previously, when I dont use calculation enabled condition Powercalc always calculate power from brightness up to 60W even if nightlight mode is on (nightlight mode have brightness and can change brightness too).

So: 1 light entity, 1 brightness attr of it, but 2 modes, and I need to template condition to separate them.

chertvl avatar Sep 22 '22 10:09 chertvl

Thanks for the extra information. I am closing this issue.

bramstroker avatar Sep 23 '22 14:09 bramstroker