I have a ‘star heaven’ fiberlight. I bought this years ago, and 2 years ago I swapped the light source with a new box, that has an RF remote to it.
The remote looks like this
It’s a rather simple remote, but as it’s RF there is no feedback to the sender of the state.
I’ve created a lght that can be turned on / off with a Broadlink RM4 pro, and I’ve learned the codes from the remote into HA.
To have a ‘state’ for the light, I created a boolean, but I’m not sure if that is necessary.
But how do I get all the other buttons into it. I don’t have a color wheel, but I can set specific colors, like, red, green, blue, yellow, cyan and purple. I can adjust the levels on the arrow buttons, but that seems like overkill, so I would just settle with the preset ‘discrete’ colors.
And how do I get the effects added to the light as well?
Did you ever figure this out? I’m trying to do something similar with IR-controlled ceiling lights. I’ve been using scripts to send the signals signals, which works, but isn’t represented in the light template, so things like blueprints can’t use those as part of the light entity.
I suspect “effects” are the right way, but I can’t find any examples of using effects in this way.
If you plan on adding alot of colors, the if/elif can be cumbersome to copy/paste… this might fit better. Keep in mind it will default to [255, 255, 255] when the color doesn’t exist in the rgb_color template. (.i.e. you made a spelling or clerical error).
I didn’t test your code exactly, but my code loosely based on your works perfectly. It was your use of the input_select helper and expanded use of the effect variable which gave me the a-ha moment I needed. This would certainly be helpful in the Template Light documentation for those trying to use effects.
I’m trying to work my way through this, but I’m a bit at a loss as to what I’ve misunderstood
As I originally described, the light has certain set values, which is defined on the remote, I’ve learned all of them into HA.
There are a lot more buttons, but I think this is the smallest amount, and it just shows more errors.
So it complains that I have a service call under
Doing a syntax check I get a lot of messages:
Invalid config for [light.template]: extra keys not allowed @ data['lights']['set_effect']['data']. Got OrderedDict([('rgb_color', "{% if effect == 'Rød' %}\n service: remote.send_command\n data:\n entity_id: remote.livingroom_sender_remote\n device: stairslight\n command: Red\n{% else %}\n - service: remote.send_command\n data:\n entity_id: remote.livingroom_sender_remote\n device: stairslight\n command: White\n{% endif %}\n")])
extra keys not allowed @ data['lights']['set_effect']['service']. Got 'light.turn_on'
extra keys not allowed @ data['lights']['set_effect']['target']. Got OrderedDict([('entity_id', 'light.stars')])
required key not provided @ data['lights']['set_effect']['turn_off']. Got None
required key not provided @ data['lights']['set_effect']['turn_on']. Got None
some but not all values in the same group of inclusion 'effect' @ data['lights']['stars'][<effect>]. Got None. (See ?, line ?).
So I guess it doesn’t want a service call under the data:
But how do I then accomplish this?