Dear all,
I wrote an AppDaemon module to control lights and switches with the IKEA RODRET and STYRBAR remotes.
If the light is a TRADFRI bulb, it will support brightness control via the RODRET remote and colour/colour temperature control via the STYRBAR remote (depending on the lightbulb capabilities). You get smooth colour changes as well as presets for my favourite colours + cold light, day light and warm light.
More lightbulbs may be supported, but I only own TRADFRI bulbs.
Light-remote bindings are set-up via the apps.yaml file (read the comment block in the code).
The code works for me but I recognize it’s pretty terrible. However, if you like it, you are welcome to improve it in any way you see fit. Maybe post it here so I can learn!
I am not a Python programmer, so I used ChatGPT to get info on AppDaemon and get help writing some parts but most of the code is mine.
Features from the comment block:
Features:
a) A remote can be set to control ALL the lights and switches (BOSS mode) as follows:
1. Press the OFF button on the remote you want to set as a BOSS
2. Do it again
3. Within 2 seconds, long press the OFF button.
This delay can be set in the apps.yaml (double_click_delay)
Now the remote controls all the lights and switches. To reassign it to its own group, repeat the procedure
Turning off the lights and switches with a BOSS remote entails a 2 seconds delay
Upon inactivity, a BOSS remote is reverted to it's original status
(set the parameter boss_timer in apps.yaml)
b) On IKEA TRADFRI lamps that support colour or colour temperature changes, such parameters can be set
with a STYRBAR remote.
c) The code attempts to gracefully manage the smart lights that are installed on a relay-controlled socket
by turning on and off the relay together with the light.
You may also want to add an automation that turns ON the light whenever you turn on the relay.
Don’t get mad at me if this breaks your set-up or burns down your house. It works for me, but it’s also my only AppDaemon module.