Color Notify: Simplify Showing Multiple Alerts on One Smart Bulb - Design Colorful Event Alerts and Pair Them with Your Smart Lights

It’s easy enough to have a light display a single color notification on a smart bulb (turn red when I am in a meeting), but what if another notification comes in at the same time (pulse blue if it starts to rain and windows are open). How do you share one bulb with multiple notifications?

I have been developing an integration to deal with just this situation: one RGB bulb that can display multiple notifications, while still acting like a normal light.

For a real-world example, I have a light that sets to full brightness when a light switch is ‘on,’ is a blue ‘night light’ when motion is detected after sunset, and is red when I am in a conference call. Without this integration it would be a nightmare to figure out the logic for this. With this app, I just arrange my ‘In Meeting’ notification to be on with my camera, a light switch hooked to the normal ‘light’ entity, and a motion sensor set to trigger the “Night Light” notification (with priorities in that order).

Now, if I’m in a meeting it is Red, no matter what. The Night Light will only show through if I am not in a meeting and the light switch is off. The light switch can turn on and off the light. No dealing with the extra logic, just set priorities and it handles it. Easy!

Color Notify is a new HACS integration that allows you to share a light bulb across multiple notifications. With Color Notify, you can create a “Notification Light” by wrapping an existing light entity. You can then define priority-sorted notifications, including color, animations, and duration, and subscribe specific lights to any subset of these notifications.

The wrapper entity functions like a regular light entity, allowing you to turn it on, off, toggle it, and set colors. Additionally, notifications can be defined as “switch” entities, with the light wrapper managing multiple simultaneous notifications while still allowing the light to be used in its normal function.

Here’s how to configure it:

  • Create a new wrapper light

Once wrapped, you should no longer use the ‘real’ light entity and should only interact with the wrapper light.

You can then create ‘Notification Pools.’ In these pools you can define notifications, which are Switch entities that can be toggled on and off. They can be defined as a solid color or an animated pattern, and can auto-clear after a set duration or can stay active until cleared.

Once you have a light and a notification pool, you can start subscribing your lights to notifications. The light can subscribe to individual notifications, or entire pools at once.

For example, this light is subscribed to 3 entire pools, plus a few notifications from the General Notifications pool:

and here’s the entities in my General Notifications pool:

That’s pretty much it. Wrap a light, define notifications, subscribe the wrapper light to the notifications and everything should just work. No more need to manage lights yourself. Just switch on notifications whenever they are relevant and forget about it!

This is an update to my previous AppDaemon script, rewritten as a Custom Integration. It was way more work than expected converting it to an Integration, so I hope that others find it useful :slight_smile:

6 Likes

Just came across this and its already proving to be an incredibly useful app. Thanks for the work on this. I’m using it with these Matter switches: Inovelli White Series 2-1 Smart Switch • Works With HomeKit • Matter which allow the RGB LED bar to be controlled like a RGB bulb to display notifications.

I’m glad you are finding it useful! Thank you for the comment, it’s always encouraging to hear that someone else is benefiting from the effort put into it (and gives me more motivation to put more effort in)

This is neat and similar to an integration I just created. Inovelli switches are mentioned in this thread, so it may be of interest to someone who has been here or ends up here in the future: Lampie: Notifications on Multiple Inovelli Switches. Hope someone finds it useful!

Hi,

I’m not sure if I’m totally misunderstanding the integration, but basically how do you tie automations in to trigger the pools? So for example, lets say I set up my RGB night light to turn green when the laundry is done (we’ll say priority 1), Blue when a package arrives (Priority 2), and yellow if the door is unlocked for x amount of time (Priority 3), When all three of those events happen around the same time, how can I engage the light display the colors and loop them using the pools? Thanks, this seems like a cool integration, I just happen to have rocks for brains

If you want the light to loop between those three notifications you should set them all to the same priority.

You can define per-light how long it displays each color with the “Auto-cycle between same priority notifications” and “Auto-cycle delay” settings:

If you give them each different priorities like you are doing then it will always show only the highest active priority. The exception to this is that notifications can briefly override higher priority notifications when initially enabled. Per-bulb you can configure the “Duration to temporarily display lower-priority notifications” to pick decide how long an override will display (0s to disable), and per-notification you can configure “Temporarily show on activation, regardless of priority” which lets you specify only specific notifications to briefly display.

If you set all of those notifications to the same priority and activate them all at once, it should cycle between them (every 5s by default).



I do want to (at some point) add a service call to manually cycle them (eg, to trigger cycling all notifications on motion trigger) but just haven’t had the time.

edit:

how do you tie automations in to trigger the pools?

If you were actually just asking “how do you make an automation turn on an notification” then the answer to that is that each defined notification shows up as a ‘switch’ entity, so you just turn it on and off like a switch from the automation.

ahhhh I see now, I was trying to build the automation to trigger a light rather than a switch. Thanks for following up, I’ve been looking for something like this

Hi

Toggle within ESPHome is no longer working with this light - I am guessing a HA change has caused the state to no longer be reported correctly - but just a guess! Any thoughts?

I noticed with my notify light on or off, the state in HA is reported as off… maybe this has always been the case?

I’m not completely sure I understand the exact situation, so I’m going to answer what I think you are asking, but ask again if this doesn’t apply :slight_smile:

If the light in the screenshot is the Color Notify ‘wrapper’ light, and you are saying that it is showing a notification but shows ‘off’ in HA, then that is the correct behavior (unless you turned the wrapper entity light itself on…)

The wrapper presents itself as a normal light and hides anything the notifications are doing. You can look at the ‘real’ entity to see what the light is actually showing, but the wrapper entity should look like it’s just a normal light bulb without any of that hidden notification stuff happening.

edit: Ah, just saw the github issue, let’s move this there.

Thank you, and solved by looking at the HA original light state… thanks for your help!

Love this! Using it with my Inovelli switches. Quick question though as I am still an amateur at Home Assistant, is there a way to set a brightness on this? They default to 100. Should I make a template light that makes 100% actually 50% and just use that or something like that?
I am using a group of lights so the light entity created by this always stays off regardless of the notification switch position being on or off.

Anyway thanks for this!

You should be able to dim the lights, although restoring brightness over reboots doesn’t currently work. However, I’m really not sure how RGB lights are supposed to work :laughing:. All I can say is “it works for me” so knowing the specifics of your situation would definitely help.

Could you fill in some details of your setup?:

  • You have a group of lights? The the ColorNotify wrapper is around the Group? I’ve never tried Groups but this at least sounds like something I can test locally without new lights.
  • Do you use solid color notifications or ‘animations’?
  • When you say brightness doesn’t work, are you manually adjusting the wrapper light or is a notification trying to adjust brightness?

There is a pull request on the github to address the ‘not saving values over reboot’ (Fix startup restore blast + accept external changes when idle by michaelbrawn · Pull Request #8 · cobryan05/ha-color-notify · GitHub) but I need to understand how RGB lights are supposed to work to ensure that I am not designing for quirks of my RGB lights that don’t work for others.

The RGB lights I have take ‘brightness’ and ‘RGB’ value. If I set it to full red #FF0000 or dim red #100000 it is the exact same color. You have to adjust ‘brightness’ to dim it, not just the RGB values.

When I made ColorNotify I made it so that it would adjust the brightness based on the RGB value. Put dim RGB, it lowers the brightness. This has caused issues, such as there not being a terrific way to save brightness value over Home Assistant restarts.

I need to come up with a way to implement brightness and properly restoring over reboots while not breaking existing setups. I could put a checkbox per-light for “RGB controls brightness”

Are my RGB lights are normal. Is it ‘normal’ for #010000 brightness 100 to be the same as #FF0000 brightness 100? Or do other lights take lower RGB values as dimmer lights? If you or anyone could answer that then I could try to get this working properly. I’m worried that I will (or already have) design this thing around a quirk of my lights :laughing:

Well actually you just solved my problem. By adjusting the color brightness to 128 from 255 it did bring it to 50% brightness which is what I was trying to achieve.

I am curious what the main light entity that is created does? The switch for the notification turns on the lights that are part of the group but the light entity made by color notify does not turn on. What does the default color on it do? Also what does the dynamic “on” priority checkbox do? It works fine without it I just didn’t understand the parameter of it? Is that for when this entity itself is turned on it will override notifications?

Anyway thanks again. Appreciate the help.

The created ‘wrapper’ light entity is supposed to act like a normal light bulb and hide all of the notification stuff. Once you create a wrapper light you should no longer directly interact with the ‘real’ light entity. You should only interact with notification switches or the ‘wrapper’ light entity.

The idea is that you treat the wrapper light as a normal light. You can turn it on, you can turn it off, you can change its color. It just transparently shares the ‘real’ light between this fake light and all of the notifications assigned to the light.

Each light has a ‘default on’ priority that you can specify. If multiple notifications are active (or you have the light ‘on’ and have a notification) then the real light will only display the highest priority item. So if you had a notification with priority 1000, and a light with priority 900, then if you switch on the light AND the notification then the notification will show on the real light since it is higher priority than the ‘on’ light.

This is where dynamic priority comes in. If dynamic priority is enabled then when you turn ‘on’ the light its priority will be the greater of the light’s default priority, or if there any notifications active then the lights priority will be just barely above the active notifications priority.

If that’s confusing, consider this scenario:

  • My entryway hallway has an RGB light that has many notifications assigned to it.
  • The light switch in the hallway toggles the ‘wrapper light entity’ when it is switched
  • My wrapper light has priority 1000
  • A notification with priority 2000 is currently being displayed

If I walk into the hallway and flip the light switch, the wrapper light turns on but it is lower priority than the notification, so the notification wins. Nothing happens when I switch the light switch.

With dynamic priority, when I flip the light switch the wrapper light is temporarily given priority 2000.5. I just flipped the light switch, I expect the light to turn on regardless of if there is a notification or not. The light will keep this priority until it is turned off.

1 Like