Files
home-assistant/morse-code-blinker
..
2025-12-31 11:22:57 +01:00
2025-12-31 12:17:34 +01:00

Morse Code Blinker

A Home Assistant custom integration that blinks lights in morse code.

Installation

HACS Installation

⚠️ Important Note: HACS does not natively support integrations located in subfolders of a repository. Since this integration is in the morse-code-blinker subfolder of the home-assistant repository, HACS may not automatically detect it.

Option 1: Try HACS (may not work)

  1. Open HACS in Home Assistant
  2. Go to "Integrations"
  3. Click the three dots menu (⋮) in the top right
  4. Select "Custom repositories"
  5. Add this repository URL: https://git.falkvinge.net/rick/home-assistant
  6. Select "Integration" as the category
  7. Click "Add"
  8. If HACS finds it, click "Download" and restart Home Assistant
  9. If HACS doesn't find it, use Manual Installation below

Option 2: Manual Installation (Recommended for subfolder structure)

Since this integration is in a subfolder, manual installation is the most reliable method:

  1. Clone or download the repository:

    git clone https://git.falkvinge.net/rick/home-assistant.git
    cd home-assistant/morse-code-blinker
    
  2. Copy the custom_components/morse_code_blinker folder to your Home Assistant custom_components directory:

    cp -r custom_components/morse_code_blinker /config/custom_components/
    
  3. Restart Home Assistant

Alternative: You can also download just the morse-code-blinker subfolder from the web interface at: https://git.falkvinge.net/rick/home-assistant/src/branch/master/morse-code-blinker

Usage

After installation, the integration provides a service morse_code_blinker.blink that can be used to blink any light entity in morse code.

Service Parameters

  • entity_id (required): The entity ID of the light to blink (e.g., light.living_room)
  • message (required): The text message to convert to morse code
  • dot_duration (optional): Duration of a dot in seconds (default: 0.2)
  • dash_duration (optional): Duration of a dash in seconds (default: 0.6)
  • element_gap (optional): Gap between dots/dashes within a letter in seconds (default: 0.2)
  • letter_gap (optional): Gap between letters in seconds (default: 0.6)
  • word_gap (optional): Gap between words in seconds (default: 1.4)

Examples

Using the Developer Tools

  1. Go to Developer Tools > Services
  2. Select morse_code_blinker.blink
  3. Enter the following YAML:
entity_id: light.living_room
message: "SOS"

Using Automations

automation:
  - alias: "Blink SOS on doorbell"
    trigger:
      - platform: state
        entity_id: binary_sensor.doorbell
        to: "on"
    action:
      - service: morse_code_blinker.blink
        data:
          entity_id: light.front_porch
          message: "SOS"

Using Scripts

script:
  blink_hello:
    alias: "Blink Hello"
    sequence:
      - service: morse_code_blinker.blink
        data:
          entity_id: light.bedroom
          message: "Hello World"

Custom Timing

service: morse_code_blinker.blink
data:
  entity_id: light.kitchen
  message: "FAST"
  dot_duration: 0.1
  dash_duration: 0.3
  element_gap: 0.1
  letter_gap: 0.3
  word_gap: 0.7

Supported Characters

The integration supports:

  • Letters (A-Z)
  • Numbers (0-9)
  • Common punctuation: . , ? ' ! / ( ) & : ; = + - _ " $ @
  • Spaces (for word separation)

Notes

  • The light will be turned on and off automatically during the morse code sequence
  • The service is non-blocking but will take time to complete based on the message length
  • Make sure the light entity supports turn_on and turn_off services