Giter Club home page Giter Club logo

hass-animated-scenes's Introduction

Animated Scenes

A custom component for Home Assistant to create neat animated light scenes. These aren't really "scenes" in the sense of Home Assistant scenes, but rather switches to turn on/off to start and end an animation.

Features include:

  • Remember the state of the lights before animation started, and restore lights to prior state after animation is turned off.
  • Automatically disable other scenes when activating another scene.
  • Add additional switches to turn off (such as a Flux or Circadian Light switch) when an animation starts.
  • Scene switches work as expected with Google Assistant.
  • If you turn a light off during an animation, it won't turn it back on. If you turn one on, it will add it to the animation automatically.

Disclaimer

I have only tested this with my own system as of now. I do plan on fixing any bugs identified by others, and would like to hear feedback though.

HACS Installation

  • Add the following custom repository to HACS: https://github.com/chazzu/hass-animated-scenes.git
  • Reload Home Assistant
  • In Home Assistant, go to Settings -> Devices & Services. Click Add Integration
  • Select the "Animated Scenes" integration.

Manual Installation

  • Clone this repository: git clone https://github.com/chazzu/hass-animated-scenes.git
  • If you have not already done so, create a 'custom_components' folder inside the 'config' folder in your Home Assistant installation.
  • Create an 'animated_scenes' folder inside your custom_components folder.
  • Copy the repository files into the animated_scenes folder.
  • In Home Assistant, go to Settings -> Devices & Services. Click Add Integration
  • Select the "Animated Scenes" integration.

Configuration

There are three ways to configure an animation.

  • Configuring automations which call the 'start_animation' and 'stop_animation' services.
  • Using a blueprint to configure the automation quickly.
  • By configuring a switch in your configuration.yaml.

Automation Configuration

First, I would recommend setting up a toggle helper.

  • Go to Settings -> Devices & Services.
  • Click Helpers in the top bar.
  • Choose Create Helper at the bottom right.
  • Select Toggle as your Helper type.
  • Name and configure your Helper.

Now you can set up an automation so that when the toggle is flipped, the animation starts and stops.

  • Go to Settings -> Automations & Scenes
  • Click Create Automation
  • Click Create new Automation
  • Add your toggle as a trigger, from Off to On
  • Add a Call Service action, with "animated_scene: Start Animation" as the service to call.
  • The configuration parameters are pre-filled with descriptions, so configure as you wish.

For configuring colors, you can choose from the following options, see Color Configuration

Switch Configuration

To add scene switches you want to set up through config.yaml:

switch:
- platform: animated_scenes
  name: Red Lights # name of scene
  restore: False # don't restore lights to previous state after scene, defaults to True
  restore_power: True # restore each light's on/off state after scene, defaults to False
  ignore_off: False # if a light in the list is off, turn it on. Defaults to True, meaning lights will be ignored if they are off.
  transition: [1, 2] # take between 1 and 2 seconds to transition; can also just be a number
  change_frequency: [2, 5] # change lights every 2 to 5 seconds; can also just be a number
  change_amount: all # change all lights every time; can also just be a number under 65,535 and under the number of lights in the scene
  change_sequence: True # instead of choosing a color randomly, choose in sequence
  animate_brightness: True # defaults to true to change brightness level
  animate_color: True # defaults to true to change color

  lights: # list of light entities to modify
  - light.hue_color_lamp_1
  
  colors: # See color configuration section for more details
  - color_type: rgb # use rgb colors
    color: [255, 0, 0]
    brightness: 255 # maximum brightness
    weight: 2 # optional; higher number makes a given color more likely to appear. Default is 10, so you can choose lower numbers to be less frequent
    one_change_per_tick: False # optional; defaults to false; only change color OR brightness on each tick, don't do both

Color Configuration

  weight: 10 # The higher the number, the more likely a color is to appear in the animation.
  brightness: [0, 255] # Sets a minimum and maximum brightness for this color group; can also just be a single number
  one_change_per_tick: true # If set to true, only the brightness OR color will change at one time
  nearby_colors: 0 # If set to a number between 1 and 100, we won't pick this color but will instead pick a 'nearby' color. This is useful for selecting, for example, a red and getting a series of lights of various shades of red. The number represents how 'far' from the original we might pick a color. This will only work for RGB, RGBW, and RGBWW

For RGB lights

- color_type: rgb_color
  color:
    - 255 # Red value
    - 0 # Green value
    - 0 # Blue value

For RGBW lights

- color_type: rgbw_color
  color:
    - 255 # Red value
    - 0 # Green value
    - 0 # Blue value
    - 0 # Cold white

For RGBWW lights

- color_type: rgbww_color
  color:
    - 255 # Red value
    - 0 # Green value
    - 0 # Blue value
    - 0 # Cold white
    - 0 # Warm white

For XY lights

- color_type: xy_color
  color:
    - 0.3127 # X value
    - 0.3291 # Y value

For HS lights

- color_type: hs_color
  color:
    - 200.0 # Hue value
    - 75.0 # Saturation value

For Color Temp lights

- color_type: color_temp
  color:
    - 450 # Color temperature in mireds

For Color Temp in Kelvin lights

- color_type: color_temp_kelvin
  color:
    - 450 # Color temperature in mireds

Sample Configurations

I did this initially to create an animation that mimics the Haunted House animation for Philips Hue but give me greater control. Here is the setting I settled on:

switch:
- platform: animated_scenes
  name: Spooky Scene
  lights:
  - be sure to list your light entities here

  colors:
  - color_type: rgb_color
    color: [ 247, 95, 28 ]
    one_change_per_tick: True
  - color_type: rgb_color
    color: [ 255, 154, 0 ]
    one_change_per_tick: True
    weight: 5
  - color_type: rgb_color
    color: [ 136, 30, 228 ]
    one_change_per_tick: True
  - color_type: rgb_color
    color: [ 133, 226, 31 ]
    one_change_per_tick: True
  - color_type: rgb_color
    color: [ 148,0,211 ]
    one_change_per_tick: True
  - color_type: rgb_color
    color: [ 200, 10, 10 ]
    one_change_per_tick: True
  - color_type: rgb_color
    color: [ 135, 169, 107 ]
    one_change_per_tick: True
  - color_type: rgb_color
    color: [ 103, 76, 71 ]
    one_change_per_tick: True
    
  transition: [1, 4]
  change_frequency: 5
  change_amount: 6

Usage Tips

Checking running animations

The Activity sensor is set to the number of currently running animations. The attributes are:

  • active: A list of currently running animations.
  • active_lights: A list of lights currently in use by animations.

Note that the sensor does not update immediately, so there may be a few seconds from when an animation is stopped til it is reflected on the sensor.

Here is a simple example script which would stop all currently running animations.

alias: Stop All Animations
sequence:
  - variables:
      animations: "{{ state_attr('sensor.activity', 'active')|list }}"
  - alias: Repeat for each animation
    repeat:
      for_each: "{{ animations }}"
      sequence:
        - alias: Stop animation
          service: animated_scenes.stop_animation
          data:
            name: "{{ repeat.item }}"
mode: single

Freeing up lights

A common use case that I ran into is wanting to animate the whole house for fun. However, we should be able to easily remove lights from an animation in order to control them manually. You can do this using the remove_lights service.

If the animation specifies 'restore_lights' then normally it would set the lights back the state they were in. However, we may not want that to happen. For example, if an animation is running in a room and you hit the light switch to on, you may want the lights to just go to their normal color and brightness and not first get restored back to 'off' first.

alias: Remove Living Room Lights
description: When Living Room light switch is clicked, just turn it on even if it's animated.
trigger:
  - platform: state
    entity_id:
      - sensor.living_room_light_switch_action
    to: up_single
sequence:
  - service: animated_scenes.remove_lights
    data:
      lights:
        - light.living_room_1
        - light.living_room_2
      skip_restore: true
  - service: light.turn_on
    target:
      entity_id:
        - light.living_room_1
        - light.living_room_2
    data:
      kelvin: 2800
      brightness_pct: 100

Adding lights to an animation

Once an animation is running, you can also add additional lights to it using the add_lights_to_animation service.

service: animated_scenes.add_lights_to_animation
data:
  lights:
    - light.living_room_1
  name: Animation ID

hacs_badge

hass-animated-scenes's People

Contributors

bjornsivertsen avatar busywait avatar chazzu avatar d8ahazard avatar thomdietrich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-animated-scenes's Issues

Restore State doesn't restore correct color temp

If my lights were white before starting the animation, restoring it after stopping the animation sets it to the rgb equivalent of the temperature it was at prior, for example if it was at 2700k it "restores" it to 255, 169, 87. I have the automation set to rgbw_color

"Quick reload" spikes HA container CPU usage to 100% and requires container restart

So if you create/modify an animated scene and use the "Quick reload" to create/update it the container CPU use goes to 100% and it stays there. It doesn't allow toggling of the switch anymore. It kinda freezes it as a whole.

If you "Restart Home Assistant" it fixes it and things work as intended. I wonder if theres some kind of leak for it in quick reloading the YAML of configurations without restart.

Let me know if theres anything I can do to help debug this.

Heres the scene I created:

- platform: animated_scenes
  name: Tokyo
  lights:
  - light.hue_color_candle_1
  - light.hue_color_candle_2
  - light.hue_color_candle_3
  - light.family_room_lamp_colored_hue
  - light.kitchen_divider_hue_1
  - light.kitchen_divider_hue_2
  - light.kitchen_overhead_hue_1
  - light.kitchen_overhead_hue_2
  - light.kitchen_overhead_hue_3
  - light.kitchen_overhead_hue_4
  - light.kitchen_overhead_hue_5
  - light.dining_room_lightstrip_plus
  - light.dining_room_overhead_hue_1
  - light.dining_room_overhead_hue_2
  - light.garage_entry_hue_1
  - light.garage_entry_hue_2

  # https://convertingcolors.com/
  colors:
  - color_type: rgb_color
    color: [ 255, 43, 120 ] # red
    brightness: 140
    nearby_colors: 3
  - color_type: rgb_color
    color: [ 169, 25, 255 ] # purple
    brightness: 140
    weight: 6
    nearby_colors: 3
  - color_type: rgb_color
    color: [ 61, 144, 255 ] # blue
    brightness: 140
    weight: 2
  - color_type: rgb_color
    color: [ 255, 161, 37 ] # orange
    brightness: 140
  - color_type: rgb_color
    color: [ 92, 8, 255 ] # deep blue
    brightness: 140
    weight: 4
    
  transition: [2, 4]
  change_frequency: [5,10]
  change_amount: 2

HA 2023.8 - Animated scenes won't load and prevents HA from restarting

It was working fine in HA 2023.7.x. After updating to HA 2023.8 it is now giving the errors below and is preventing HA from restarting.

2023-08-02 22:21:37.715 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration animated_scenes which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-02 22:22:06.401 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration animated_scenes: Unable to import component: cannot import name 'RequiredParameterMissing' from 'homeassistant.exceptions' (/usr/src/homeassistant/homeassistant/exceptions.py)
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
File "/config/custom_components/animated_scenes/__init__.py", line 5, in <module>
File "/config/custom_components/animated_scenes/animations.py", line 32, in <module>
2023-08-02_22-32-27 228 2023-08-02_22-32-37 352

.
I am using animated scenes from configuration.yaml

- platform: animated_scenes
  name: "Front Porch Christmas Lights"
  ignore_off: False
  lights:
    - light.lifx_front_porch_light_bulb_1
    - light.lifx_front_porch_light_bulb_2
    - light.lifx_front_porch_light_bulb_3
  brightness: 255
  colors:
    - color_type: rgb_color
      color: [ 255, 0, 0 ]
    - color_type: rgb_color
      color: [ 240, 255, 254 ]
    - color_type: rgb_color
      color: [ 255, 98, 71 ]
    - color_type: rgb_color
      color: [ 255, 214, 0 ]
      weight: 5
    - color_type: rgb_color
      color: [ 125, 255, 0 ]
    - color_type: rgb_color
      color: [ 0, 255, 0 ]
  transition: [2, 6]
  change_frequency: [2, 6]
  change_amount: [1, 3]

- platform: animated_scenes
  name: Front Porch Patriotic Lights
  ignore_off: False
  lights:
    - light.lifx_front_porch_light_bulb_1
    - light.lifx_front_porch_light_bulb_2
    - light.lifx_front_porch_light_bulb_3
  brightness: 255
  colors:
    - color_type: rgb_color
      color: [ 255, 0, 0 ]
    - color_type: rgb_color
      color: [ 255, 255, 255 ]
    - color_type: rgb_color
      color: [ 0, 0, 255 ]
  transition: [2, 6]
  change_frequency: [2, 6]
  change_amount: all

- platform: animated_scenes
  name: Front Porch Valentines Lights
  ignore_off: False
  lights:
    - light.lifx_front_porch_light_bulb_1
    - light.lifx_front_porch_light_bulb_2
    - light.lifx_front_porch_light_bulb_3
  brightness: [100, 255]
  colors:
    - color_type: rgb_color
      color: [ 255, 0, 0 ]
    - color_type: rgb_color
      color: [ 255, 255, 255 ]
    - color_type: rgb_color
      color: [ 220, 20, 60 ]
    - color_type: rgb_color
      color: [ 255, 250, 250 ]
    - color_type: rgb_color
      color: [ 255, 20, 147 ]
    - color_type: rgb_color
      color: [ 255, 105, 180 ]
  transition: [2, 6]
  change_frequency: [2, 6]
  change_amount: [1, 3]

- platform: animated_scenes
  name: Front Porch NYE Lights
  ignore_off: False
  lights:
    - light.lifx_front_porch_light_bulb_1
    - light.lifx_front_porch_light_bulb_2
    - light.lifx_front_porch_light_bulb_3
  brightness: 255
  colors:
    - color_type: rgb_color
      color: [ 0,0,128 ]
    - color_type: rgb_color
      color: [ 64,224,208 ]
    - color_type: rgb_color
      color: [ 255, 255, 255 ]
    - color_type: rgb_color
      color: [ 192,192,192 ]
    - color_type: rgb_color
      color: [ 72,61,139 ]
    - color_type: rgb_color
      color: [ 0,0,255 ]
  transition: [2, 6]
  change_frequency: [2, 6]
  change_amount: all

- platform: animated_scenes
  name: Front Porch Easter Lights
  ignore_off: False
  lights:
    - light.lifx_front_porch_light_bulb_1
    - light.lifx_front_porch_light_bulb_2
    - light.lifx_front_porch_light_bulb_3
  brightness: [100, 255]
  colors:
    - color_type: rgb_color
      color: [ 255,255,0 ]
    - color_type: rgb_color
      color: [ 0,250,154 ]
    - color_type: rgb_color
      color: [ 64,224,208 ]
    - color_type: rgb_color
      color: [ 255,192,203 ]
    - color_type: rgb_color
      color: [ 255,250,205 ]
    - color_type: rgb_color
      color: [ 230,230,250 ]
  transition: [2, 6]
  change_frequency: [2, 6]
  change_amount: [1, 3]

- platform: animated_scenes
  name: "Front Porch Halloween Lights"
  ignore_off: False
  lights:
    - light.lifx_front_porch_light_bulb_1
    - light.lifx_front_porch_light_bulb_2
    - light.lifx_front_porch_light_bulb_3
  brightness: 255
  colors:
    - color_type: rgb_color
      color: [ 255, 195, 0 ]
    - color_type: rgb_color
      color: [ 255, 208, 114 ]
    - color_type: rgb_color
      color: [ 255, 169, 0 ]
    - color_type: rgb_color
      color: [ 255, 54, 6 ]
    - color_type: rgb_color
      color: [ 255, 140, 0 ]
  transition: [2, 6]
  change_frequency: [2, 6]
  change_amount: [1, 3]

- platform: animated_scenes
  name: As Bedroom Rainbow Sequence
  ignore_off: False
  restore: True
  restore_power: True
  animate_brightness: True
  animate_color: True
  lights:
    - light.localtuya_as_bedroom_light_bulb_1
    - light.localtuya_as_bedroom_light_bulb_2
    - light.localtuya_as_bedroom_light_bulb_3
    - light.localtuya_as_bedroom_light_bulb_4
  colors:
    - color_type: rgb_color
      color: [ 255, 0, 0 ]
    - color_type: rgb_color
      color: [ 255, 153, 0 ]
    - color_type: rgb_color
      color: [ 255, 255, 0 ]
    - color_type: rgb_color
      color: [ 0, 255, 0 ]
    - color_type: rgb_color
      color: [ 0, 0, 255 ]
    - color_type: rgb_color
      color: [ 0, 255, 255 ]
    - color_type: rgb_color
      color: [ 153, 51, 255 ]
    - color_type: rgb_color
      color: [ 255, 153, 255 ]
  transition: 1
  brightness: [128, 217]
  change_sequence: False
  change_frequency: [2, 5]
  change_amount: [1, 4]

Feature request - sensor where state is count of running animations and has attributes with details about the running ones

I think it could be really useful to have a sensor added to home assistant that shows the number of Animated Scenes running, and container an attribute with a dictionary/array of the names of the Animated Scenes and the lights they're working with.

This could come in handle for a couple things:

  • When running a "goodnight" or "end of day refresh" script, this could be used to make sure all Animated Scenes are stopped
  • There are some automations that I (and I'm sure others) have created to sync light switch status LED bars to the brightness of hue or other lights. (useful for Inovelli Blue switches which have an LED bar to show light brightness. We could use this to know which ones to temporarily ignore since the brightness could be constantly changing and don't want to flood the zigbee network or overload HA with constant changes

Failed to switch on after updating on 2024.1.6+ HA versions.

Hello. I got an issue with ~ Feb-March update of HA. When I try to switch on animated scenes switch (configured in HA conf file) the error is "Failed to call the service switch/turn_on. 'NoneType' object has no attribute 'cancel'.
I tried add this attribute by hand, but integration didn't run because it is "wrong config sample" etc.
image
I revert my HA back to 2024.1.6 and animated scenes works again.
How can I have an updated HA and working scenes?
Thank you

Doesn't seem to work with LocalTuya lights

Hello,

I've installed and configured the Animated Scenes custom component. Below is my config. The two lights are using the LocalTuya integration. The Animated Scenes switch does turn the lights on, but doesn't seem to be passing the colour values to them - the only thing the lights do is go through the colours set in the Tuya Smart Life app.

switch:
  - platform: animated_scenes
    name: Neon
    restore: False 
    ignore_off: False
    restore_power: True
    lights:
      - light.desk_left_light
      - light.desk_right_light
    brightness: [100, 255]
    colors:
      - color_type: rgb_color
        color: [ 253, 197, 245 ]
        one_change_per_tick: True
      - color_type: rgb_color
        color: [ 247, 174, 248 ]
        one_change_per_tick: True
        weight: 5
      - color_type: rgb_color
        color: [ 179, 136, 235 ]
        one_change_per_tick: True
      - color_type: rgb_color
        color: [ 128, 147, 241 ]
        one_change_per_tick: True
      - color_type: rgb_color
        color: [ 114, 221, 247 ]
        one_change_per_tick: True
    transition: [1, 5]
    change_frequency: 5
    change_amount: 6

Is there anything I could do to help you figure out what's wrong?

Thanks!

Have multiple animations active at same time

Hello.... just installed this into HASS and I really like how it works. Right now it seems like it basically supports changing a set of lights through a series of color/brightness steps. Very useful but it would be great if I could also:

  1. have the ability to set different lights to different color/brightness scenes within the same animation.... so like light A = red, light B = blue etc where red and blue are separate queues of color rotation
  2. have the ability to have multiple animations running at once. Right now when I turn on one, it deactivates the last one. Is there any way to have them act independently? (if so then that might actually solve #1)

Let me know if there is a way to do this please. Thanks!!

Share some more example scenes

Does anyone have some more example scenes to share? Maybe even efforts to imitate some of the dynamic Philips Hue scenes? Would be very interested in seeing what you have created and would also help me getting started.

Found the tip to use scripts and parameters for rooms shared in issue #34 very helpful! Would probably help a lot of people adding that to the documentation.

Configuration typo causes vague "'NoneType' object has no attribute 'state'" error

Hi, I just ran across an issue, arising from my own mistake, I thought I'd document for anyone else who might run across it.

I have a Tuya light called 'kitchen_light'. In my localtuya integration, I accidentally called it 'kitchen light' (no underscore). Everywhere else, I used the underscore.

Somehow the configuration checks didn't catch this. Using this light in an animation caused the animation to fail with a homeassistant.components.websocket_api.http.connection error "'NoneType' object has no attribute 'state'", an extremely vague and difficult-to-troubleshoot error message.

So, if you get this error when you try to trigger an animation, check that all your friendly names are consistent everywhere.

To @chazzu, I don't know if this is a HomeAssistant issue or a hass-animated-scenes issue, but if possible maybe it would be nice if it told the user when it had found an unrecognized light name somewhere along the way, and said exactly what it was, rather than the animation simply failing with a very unspecific error.

Thanks!

Problem with Example

Just wanted to drop a note that I had a lot of problems with the example, and Googling led to others with the same issue. It seems the problems are in your example with the line:

change_amount: 6

It really needs to be:

change_amount: all

Python DeprecationWarning for randrange()

The new version of Python is throwing the following error with this addon. Hopefully it's an easy fix as this addon is a must have for the upcoming holiday season!

/config/custom_components/animated_scenes/animations.py:297: DeprecationWarning: non-integer arguments to randrange() have been deprecated since Python 3.10 and will be removed in a subsequent version return randrange(value[0], value[1], step)

not looping

Hi. i am trying to set up this script. but i am unable to get it to run a loop.

if i set it up in automations on a time pattern for 5seconds (example). i have to use toggle. in order for it to change color. if i just activate the switch. it just selects a color and stays on that color.

if i create a lovelace szitch button. it stays on that color.

what am i doing wrong ?

Features Request - Sync lights and quick animation times

Hi,
Not really an issue, but some things that would be nice to have ๐Ÿ‘

  • Animate all lights at once in sync. When I animate, each light has its animation, but I would like to animate all the lights in sync with the same brightness/color for all of them.
  • Set animation times in milliseconds to allow for quick changes.

Both above features would for instance allow to make an animation such as "blinking red lights" for an alarm.
All lights should blink white and red all at the same time, and they should do it quickier than they actually do (less than a second).

Cheers and thanks again for this !

What changed in v1.0.1? Not working

I've been using your integration and have really liked it. I updated to v1.0.1 from an earlier version (f1d6151 I believe) by HACS and now it isn't working. It appears you moved from setting the animations in a switch to doing it in a service call now? Any documentation on the new syntax? The readme still shows the switch setup.

Happy to update my animations, I just want to confirm I'm doing it correctly as I've been using the switches heavily and moving to service calls will involve significant modification to my current setup for my lights.

Also, it would have been helpful if this was noted as a breaking change in the release notes of the update so we could be aware/prepared. Thanks :-)

Restoring state does not turn off lights that where off before launching animation

Hi,
All is said in the title :-)

If I have lights that are OFF before animating (they turn ON and animate if I set ignore_off: False), when I stop the animation they stay ON when they should logically return to their original OFF state.
Restore works for restoring state of already lit lights before an animation.

Anyway, I wanted to say thank you for this custom component.

Animation lag with multiple lights

I kinda noticed this before I added more lights to my setup, but I've now added 8 more kasa bulbs for a total of 24. when i start the animation after a few seconds theres extreme lag, wont change in order, and some bulbs take a while to change. wasnt as big of an issue before I added the 8 more, still did it but took like 2 minutes or so before it started to lag. now its a few seconds.
I really want to have some animaitons all over the house, but I just cant as of now. Set to animate 1 light group that contains all 24 lights.

Any idea how to remedy this? I dont see it maxing the cpu or ram of the homeassistant

Thanks!

Introductory example outdated

Hello,

first I would like to thank you for providing this scene animation module.

I have some trouble to get it to work properly here, this may be due because your code has evolved faster than the provided example code.

switch
- platform: animated_scenes
  name: Red Lights # name of scene
  restore: False # don't restore lights to previous state after scene, defaults to True
  ignore_off: False # if a light in the list is off, turn it on. Defaults to True, meaning lights will be ignored if they are off.
  lights: # list of light entities to modify
  - light.hue_color_lamp_1
  - colors:
    color_type: rgb # use rgb colors
    color: [255, 0, 0]
    brightness: 255 # maximum brightness
    weight: 2 # optional; higher number makes a given color more likely to appear. Default is 10, so you can choose some numbers to be less frequent
    one_change_per_tick: False # optional; defaults to false; only change color OR brightness on each tick, don't do both
  - colors:
    color_type: ct # color temperature colors
    color: 500 # number in mireds
  transition: 2 # take 2 seconds to transition
  change_frequency: 15 # change lights every 15 seconds
  change_amount: all # change all lights every time
  animate_brightness: True # defaults to true to change brightness level
  animate_color: True # defaults to true to change color

First it seems to me that this '- colors:' fails to feed the expected list of colors
Second thing is color type ct does not seem to exist anymore.
Third color: 500 is not allowed by the input verification.
I think its should be more like:

    colors:
      - color_type: rgb_color # use rgb colors
        color: [255, 0, 0]
        brightness: 255 # maximum brightness
        weight: 2 # optional; higher number makes a given color more likely to appear. Default is 10, so you can choose some numbers to be less frequent
        one_change_per_tick: False # optional; defaults to false; only change color OR brightness on each tick, don't do both
      - color_type: color_temp # color temperature colors
        color: 250 # number in mireds

Unfortunately even with these changes that get me past input verification, it seems to only do one transition for me.

Could you please verify/update the example code and make sure it works as expected on your side?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.