Quick workaround that adds transitions support to my TPLink LB120 bulbs in HomeAssistant. It does not create a separate entity, just adds a tpbulb service that can be used in automations. By not creating separate entities, you can use native HomeAssistant tplink component alongside these services.
I still hope for native transitions support in pyHS100 and tplink component.
Use at your own risk.
Clone the repo to your homeassistant/config/custom_components/ directory and initialise it with
tpbulb:
- name: <name you will reference the bulb in automations>
host: <ip>
- name: <bulb name>
host: <ip>
in configuration.yaml.
-
turn_on(
- name - bulb name as defined in configuration.yaml
)
-
turn_off(
- name - bulb name as defined in configuration.yaml
)
-
transition(
- name - bulb name as defined in configuration.yaml
- color_temp - to transition color_temp
- brightness - to transition brightness
- transition_period - in milliseconds
)
Manual transition service, parameters are optional if you want to change color_temp or brightness only.
-
sunrise(
- name - bulb name as defined in configuration.yaml
- transition_period - in milliseconds, default 30 minutes
)
Simulates sunrise in three stages over a default time period of 30 minutes.
-
sundown(
- name - bulb name as defined in configuration.yaml
- transition_period - in milliseconds, default 30 minutes
)
Simulates sundown in two stages over a default time period of 30 minutes.
-
day(
- name - bulb name as defined in configuration.yaml
)
Turn on light to day mode
-
night(
- name - bulb name as defined in configuration.yaml
)
Set light to night mode and turn off
Example automation
automation:
- alias: Weekday wake-up
trigger:
platform: time
at: "05:30:00"
condition:
condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
service: tpbulb.sunrise
data:
name: badroom-corner-light
MIT License