Thank you Steve,
But this blinks all the time. I am hoping for a blinking LED that I can turn on/off from the Dashboard UI (for testing but ultimately from Node-RED).
So, I think the question now is; What option do I add to the effects: so that there is only one effect and that is to Strobe when turned on? Or if there has to be minimum of two effects, reverse the order, so that Strobe is the default.
# To control the enable and frequency variables, we create a template number
# and a template switch entry in our YAML. This will create two entities in
# Home Assistant where we can set the values.
# The number.frequency is controlled using the set_value service.
#
number:
- platform: template
name: "Frequency"
id: blink_frequency
optimistic: true
min_value: 0.1
max_value: 100
step: 0.1
restore_value: true
switch:
- platform: template
name: "Enable"
id: blink_enable
optimistic: true
restore_state: true
# When we create a CustomComponent we need to create a code file and register
# the Component in the config YAML. During the registration we can pass
# references to the switch and number inputs:
custom_component:
- lambda: |-
auto myComponent = new AdvancedBlinkComponent(id(blink_enable), id(blink_frequency));
return {myComponent};
I don’t believe there’s a way to remove the ‘none’ effect. However, you could make it switch to the strobe effect automatically every time it turns on using the on_turn_on trigger:
On mobile, so I can’t type up exactly what you’d need.
Edit: Decided to run down to my office to show you an example:
light:
- platform: binary # or any other platform
# ...
on_turn_on:
- light.turn_on:
id: your_light_id
effect: Strobe
With your help, I have now got what I want. For others in the same (confused) state as I was, here is my solution. Firstly the ESPHOME code creatig the entities and driving the LEDs:
This produces a light with 2 modes - None (on steady) and Strobe. Now from Node-RED, I can create an action to Turn OFF, Turn ON (steady) & Turn ON (strobe) like this: