I just started working with HA assistant and could make the setups for a couple or devices I have on my setup.
I am trying to control this LED Strip using the send command feature, I managed to do this calling the service “send command” from the wed UI. But I think that what would be more useful is to have this light appears as a Light/Switch on the web UI. I guess that I need to do the following:
Have a Logical Light component on the wed UI.
Generate an automation that would use the Send command service to toggle the light on/off.
I need some help adding this “not fisical component”.
Well you should be able to make a switch pretty easily using template switch, but it would only be on/off.
Can it change colors/brightness with IR commands as well? and are you looking to do that too?
edit: I am sort of thinking now template switch may not help, might just have to do a binary switch. I think this because the state of the light probably isn’t reported in any sensor or similar since its IR based. What this means is if you turn on the light using something other than the switch you make in home assistant, the light will be on but the switch will still be off.
The Strip is an RGB Strip but for now I would like to only start with on/off.
I might try to also control the RGB Feature, but for that I need to get used to HA.
it doe not matter if HA is out of sync regarding the on/off Status on the light I just want to control it from HA. I guess that eventually I could use a DYI Sensor to report the status back, but I get this is way more complicated that what I really need right now.
I did check the template before, but I was not sure it would be useful because I thought templates were only used to group more than one component into only one component in the web UI.
The difference with just a binary sensor and template sensor is template sensor can turn on/off based on the state of a sensor or such. Like, if my tv is on I have a sensor that knows that and it can update the switch to turn on automatically.
But for your problem I would simply have an input boolean (which shows as a switch on front end)
input_boolean:
light_strip:
name: Controls LED Light
initial: off
And then have an automation that is triggered when the input boolean changes value, which will turn on or off the light however it is that you are sending that command:
automation:
- alias: Turn light strip on or off
trigger:
platform: state
entity_id: input_boolean.light_strip
action:
(if it turned on, turn light on, else if it turned off turn the light off)
I am not to sure how specifically you are turning your light on or off thru a service call, but if you want help with the action part lemme know how you are doing that
Alternative Simpler Option It may be a better idea just to write a script that toggles the light on and off if you only have a power toggle command. Then it just shows up as a button you press on the dashboard. The script would be very basic
The IR controller is this one “SUPERNIGHT IR Remote Controller 44 Keys for RGB LED Light Strip” and the LED Strip is this one “WenTop Led Strip Lights” but I guess that any Chinese LED Strip should work.