[Integration] Thermacell LIV - Mosquito Repeller Control 🦟

[Integration] Thermacell LIV - Mosquito Repeller Control :mosquito:

Hey Home Assistant community! :wave:

I’m excited to share a brand new custom integration I’ve developed for Thermacell LIV mosquito repellers. This project was made possible through some incredible pair programming sessions with Claude Code - shoutout to Anthropic’s amazing AI coding assistant that helped bring this integration to life! :robot::sparkles:

What is Thermacell LIV?

Thermacell LIV devices are smart mosquito repellers that create a 20-foot zone of protection using heat-activated repellent technology. They feature RGB LED lights and are controlled via a mobile app, but until now, there hasn’t been a way to integrate them with Home Assistant.

Integration Features :rocket:

Core Functionality

  • Multi-device Support: Manage multiple Thermacell LIV hubs from a single integration
  • Cloud API Integration: Direct connection to ESP Rainmaker platform
  • Real-time Updates: 60-second polling with comprehensive device monitoring

Supported Entities

  • :arrows_counterclockwise: Switch: Control mosquito repeller on/off state
  • :bulb: Light: Full RGB LED control with brightness (0-255 HA standard)
  • :bar_chart: Sensors:
    • Refill life monitoring (hours remaining)
    • System status (“Protected”, “Warming Up”, “Off”, “Error”)
    • Current session runtime with human-readable format
    • Firmware version display
  • :radio_button: Button: Reset refill life counter

Advanced Features :zap:

  • Optimistic Updates: Instant UI responsiveness (24x faster than waiting for API)
  • Smart State Management: Automatic rollback on API failures
  • Intelligent LED Logic: LED state automatically tied to hub power + brightness
  • Professional Device Info: Proper model names, serial numbers, firmware versions

Installation :package:

Via HACS (Recommended)

  1. Add custom repository: https://github.com/joyfulhouse/thermacell_liv
  2. Install “Thermacell LIV” integration
  3. Restart Home Assistant
  4. Add integration via Settings → Integrations

Manual Installation

  1. Download integration files to custom_components/thermacell_liv/
  2. Restart Home Assistant
  3. Configure with your Thermacell account credentials

Technical Highlights :wrench:

This integration showcases some interesting technical approaches:

  • JWT Authentication: Secure ESP Rainmaker API integration with automatic token refresh
  • Optimistic State Updates: UI updates immediately while API calls happen in background
  • Color Space Conversion: Accurate HSV ↔ RGB conversion for LED control
  • Complex State Logic: Hub power state affects LED behavior intelligently
  • Comprehensive Error Handling: Retry logic with exponential backoff

Performance Metrics :chart_with_upwards_trend:

  • API Response Time: ~2.5 seconds average
  • Optimistic Update Time: ~0.01 seconds
  • User Experience: Instant feedback, no more waiting for API responses!

Requirements :clipboard:

  • Home Assistant 2023.1.0+
  • Valid Thermacell account with registered LIV devices
  • Internet connectivity (cloud-based API)

Known Limitations :warning:

  • Cloud Dependency: Requires internet for all operations (no local API available)
  • Polling Based: 60-second intervals, not real-time push notifications
  • Refill Reset: Button implementation complete but needs device testing
  • Runtime Display: Shows current session time (not lifetime like mobile app)

Screenshots & Demo :camera_flash:

[Integration will be updated with screenshots once deployed]

Entity examples:

  • switch.thermacell_liv_patio_hub
  • light.thermacell_liv_patio_hub_led
  • sensor.thermacell_liv_patio_hub_refill_life
  • sensor.thermacell_liv_patio_hub_system_status

Future Roadmap :crystal_ball:

  • Enhanced configuration options (custom polling intervals)
  • Signal strength monitoring
  • Historical runtime tracking
  • Maintenance reminders for refill replacement
  • Energy usage estimation

Support & Contributing :handshake:

Testing & Feedback :test_tube:

This is v0.0.1 - the core functionality has been tested with real hardware, but I’d love feedback from the community! If you have Thermacell LIV devices, please give it a try and let me know how it works for you.

Special thanks to:

  • Claude Code for being an amazing pair programming partner :robot:
  • The Home Assistant community for building such an incredible platform
  • Thermacell for creating these awesome mosquito-fighting devices

Ready to take control of your mosquito protection through Home Assistant? Give the integration a try and let me know what you think!

Questions, feedback, and bug reports are all welcome. Looking forward to seeing this integration help fellow HA enthusiasts enjoy their outdoor spaces mosquito-free! :house_with_garden::star2:

1 Like

Absolutely awesome! Thank you! Works flawlessly.

1 Like