Profile
Back to NewsBack
GitHub Trending 7 min
Reader Mode
eigger/hass-magic-caster-wand: Magic Caster Wand Home Assistant Integration

eigger/hass-magic-caster-wand: Magic Caster Wand Home Assistant Integration

12 hours ago

Magic Caster Wand

Cast Lumos to turn on a room light, or Nox to turn it off. This HACS custom integration connects Harry Potter Magic Caster Wands and their boxes to Home Assistant over Bluetooth, turning spells and button presses into automation triggers and letting Home Assistant send LED and vibration effects back to the wand.

English | 한국어

Release</a> HACS Default</a> Home Assistant minimum</a> Tests</a> Validate</a> License</a> Downloads</a>

Magic Caster Wand in Home Assistant
Wand controlling a device
Control a device with a spell
Wand turning on a light
Turn on a light with your wand

What you can do

Connect the wand → perform a built-in gesture → its Spell sensor reports the spell → your automation controls a light or another HA device. The wand recognizes its built-in gestures itself; this basic route does not require a TFLite server or model.

| Feature | How it works in Home Assistant | |---|---| | Spell automations | The Spell sensor reports names such as Lumos and Nox; use them to trigger your own actions. | | Buttons and device status | Wand button binary sensors and battery sensors let you build other triggers and monitor the device. | | Wand effects | Send predefined effects, set LED colors, clear LEDs, vibrate, or compose a macro. | | Optional movement tracking | Spell Tracking streams the wand's IMU data for Spell Canvas and server-based recognition; it needs separate setup below. | | Magic Caster Box | Monitor lid, USB and wand-presence status, battery and connection; control its single TIP LED. It has no vibration motor or wand IMU. Add the box separately from the wand. |

Supported devices and requirements

Installation

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.</a>

  1. In HACS, search for Magic Caster Wand and download it, or use the button above. It is included in the HACS default repository list. For manual installation, copy only custom_components/magic_caster_wand into your configuration's custom_components directory.
  2. Restart Home Assistant. Open Settings → Devices & services → Add integration → Magic Caster Wand, or confirm its Bluetooth discovery.
  3. Select your awake wand or box. On its device page, turn on Connect before receiving spells or sending effects. Finding a Bluetooth advertisement alone does not confirm a working connection.
For your first check, leave Spell Tracking off, confirm Connected is on, and cast a built-in gesture below using the wand's normal casting grip. Open the Spell entity and check that its value changes. If it does not, check the connection and button states before adding an automation. The spell value can remain visible after a disconnect, so a previously displayed spell is not proof of a current connection.

Try the built-in gestures

These are the wand's native gesture reference and two examples to start with. Follow the arrows and the wand's normal casting instructions.

Built-in Magic Caster Wand gesture reference
Lumos
Lumos gesture
Nox
Nox gesture

The full gesture gallery preserves the remaining reference images. A reference image alone does not mean that every listed gesture is recognized by the wand's native firmware or an available external model.

Make Lumos turn a light on and Nox turn it off

Create an automation in Home Assistant and use this YAML, replacing every occurrence of sensor.mcw_example_spell and the light IDs with yours. Find the actual Spell entity on the wand's device page. You can replace the light actions with actions for another HA device.

alias: Wand — Lumos and Nox
triggers:
  - trigger: state
    entity_id: sensor.mcw_example_spell
    attribute: last_updated
actions:
  - choose:
      - conditions: "{{ trigger.to_state.state | lower == 'lumos' }}"
        sequence:
          - action: light.turn_on
            target:
              entity_id: light.example
      - conditions: "{{ trigger.to_state.state | lower == 'nox' }}"
        sequence:
          - action: light.turn_off
            target:
              entity_id: light.example
mode: single

The conditions normalize spell names to lowercase, so Lumos and lumos both match. The trigger watches the last_updated attribute, so casting Lumos twice can trigger twice even when the spell name stays the same. In integration options, Spell Timeout resets the reported spell to awaiting after the configured seconds; 0 (the default) keeps the last spell until the next update. The example ignores awaiting because it only acts on Lumos or Nox.

Send effects back to the wand

Use Developer tools → Actions or an automation to call these actions with a target entity belonging to the intended wand or box:

| Action | Purpose | |---|---| | magic_caster_wand.play_spell | Play a predefined LED/vibration effect such as lumos or incendio. This plays an effect; it does not cast a gesture into your automation. | | magic_caster_wand.set_led | Set group, rgb_color and optional duration for a wand LED group. | | magic_caster_wand.clear_leds | Turn off LEDs. | | magic_caster_wand.vibrate | Vibrate the wand; one command produces about 800 ms regardless of requested duration. | | magic_caster_wand.send_macro | Combine LED changes, delays, buzzes and loops in a custom sequence. |

For example, play the Lumos effect on the wand (replace the target entity):

action: magic_caster_wand.play_spell
target:
  entity_id: sensor.mcw_example_spell
data:
  spell: lumos

The box has only the TIP LED group and ignores vibration macro commands. See the action reference for the longer descriptions.

Spell Canvas and optional server recognition

Spell Canvas is a camera entity showing the path of a cast, its drawing state and the recognized spell. It is an optional route beyond the wand's built-in spell reports.

Spell Canvas displaying a wand movement trail
  1. Set up a compatible hass-tflite server and load a compatible model.tflite through its web UI. Set TFLite Server URL in the integration's options to a URL reachable from HA. The model is not publicly provided by this project.
  2. Connect the wand, then enable Spell Tracking. In the current implementation it starts IMU streaming after the remote detector initializes; a missing/unreachable server or model can prevent tracking from starting. Do not assume a model-free drawing fallback.
  3. Open the wand's Spell Canvas camera. To keep it on a dashboard, edit the dashboard, add a Picture entity card and select that camera entity.
  4. Hold all four wand button/touch sensors together, then move the wand to draw. The canvas shows TRACKING while all four are held. Release any one of them to finish the stroke and request recognition; it returns to READY. A successful result updates the same Spell sensor used by your automations.
  5. Check the actual Spell Tracking switch and the canvas status if no path appears. SERVER OK records a successful server check during initialization; it does not guarantee recognition of every gesture. Check tracking again after reconnecting.
TFLite server web interface

Server screenshots and the original Spell Canvas walkthrough remain available. Built-in wand spell automations remain the starting point when you do not have the external model.

Connection help and documentation

Bluetooth discovery, connection and successful command execution are separate stages. If the wand disconnects, wake it and turn Connect on again; check proxy slots, distance and other connected apps. Hardware and firmware combinations vary; see troubleshooting and diagnostic entities.

The Downloads badge counts GitHub release asset downloads across all releases, not active installations.

Support

  • Issues: Report bugs or request features.
  • Discussions: Ask questions and share your experience.

License

Released under the MIT License.

Chat with me