Thermacell Liv - smart mosquito repellent system

Has anyone been able to go hands on with the thermacell liv, or know where there might be some API documentation? I’m interested, but i’m leery of “cloud-only” solutions, and would love to integrate it with HA via a local API…

3 Likes

Hi there, did you ever end up figuring this out. Would be super handy to have.

Thanks

Hi,

I know this doesn’t address your cloud only solution request, but I ended up incorporating this into HA by setting up a Virtual Switch in HA and creating a routine in Alexa to activate/deactivate the Thermacell Liv unit based on the status of the virtual switch status.

Thanks for the update!

Do you know what the power/cable to the repellers consists of?

IIUC, the hub just switches the repellers on and off. That could be done with a generic (e.g. Zigbee) outdoor switchable outlet. But we’d need to know the voltage and pinout of the cable to the repellers.

And finally, is it possible to set it to always turn on when the power comes on?

Hi,

The cables are circular 4 or 5 pin connectors and the hub both provides the power to the units and also controls the LED lights incorporated into the repellers (color, brightness, etc). I don’t believe there is a way to have the units turn on automatically when powered. They default to off when first powered and doesn’t look like this good be overridden.

1 Like

Appears Thermacell uses the Ayla Networks API.

Extracted from the Android APK:

      "app_id": "Thermacell_Prod-eQ-id",
      "app_secret": "Thermacell_Prod-7W9kUR6I6YyuxttY1JJBAnGIKqU"

As far as developing a custom integration, can probably base it on work done for the Shark Vacuums which uses the same platform. POSTing to the Enable_REPELLERS1 property at apiv1/dsns/{dsn}/properties/{propName}/datapoints.json will turn the hub on/off.

There’s also the ayla-iot-unofficial python library already derived from sharkiq. No time to take on this project right now but hoping this info gives someone else a good start.

Regarding local control on LAN, it looks like it’s all handled with their mobile SDK (via “Local Connect”). Maybe if someone were to reverse engineer this?

I see this thread has gone rather quiet - has anyone made any progress? I am also intereseted in LIV+ integration, but unfortunately the level of programming required is beyond me.

Hello, I was able to get something working, thanks in large part to the hints shared in this forum. My solution is a bit janky since I’m not much of a developer but I can share how I set it up in the hopes that maybe a more official integration comes along. I can say with near 100% certainty that it is possible to create a real integration.

In the meantime, here’s what I did. I’m using Home Assistant in a Docker container on a Synology NAS.

Caveats: I only have one repeller system installed, so my plugin only returns the first repeller if you have multiple. Also, this will require some comfort with the Linux command line.

Since Thermacell LIV uses the same IoT platform (Ayla) as the Shark vac robots, I used the sharkiq python SDK to make a connection to Thermacell using the API secret above.

Download the ‘integration’: iCloud Drive

Inside this zip folder is a file called thermacell_control.py Replace USERNAME and PASSWORD at the top with the credentials you use to log into the Thermacell app

Upload the unzipped ‘thermacell’ folder to your Home Assistant config folder under “scripts” (create this folder if it doesn’t exist).

Log into a command prompt for your docker container (or, I suppose, run the command in whatever environment HA is running in for you) and do:

$ cd path/to/ha/config/scripts/thermacell
$ pip3 install .

Assuming no errors, you should now have the modified sharkiq SDK installed, along with the thermacell_control.py file you modified earlier.

Now open your configuration.yaml file and add the following snippet:

command_line:
  - switch:
      name: Thermacell LIV
      unique_id: thermacell_liv
      command_on: "python3 /config/scripts/sharkiq/thermacell_control.py on"
      command_off: "python3 /config/scripts/sharkiq/thermacell_control.py off"
      command_state: "python3 /config/scripts/sharkiq/thermacell_control.py status"

Note that you should change the absolute path to wherever in your file structure the file lives. In docker /config is the root, so my snippet above reflects that.

Now restart HA and you should have a new entity named “Thermacell LIV”

It reports state (on or off) as well as allows you to switch it on and off.

Hope this helps someone. Wouldn’t be upset if someone used this as inspiration to build a real integration :slight_smile:

1 Like

Fantastic! I only got hung up copy/pasting the provided configuration.yaml without updating the paths. I extracted the folder to ~/HomeAssistant/scripts/thermacell/

Seriously, good job with this, I’ve been hoping for an integration so now I can burn that sweet sweet antimosquito juice easier.

      command_on: "python3 /config/scripts/thermacell/thermacell_control.py on"
      command_off: "python3 /config/scripts/thermacell/thermacell_control.py off"
      command_state: "python3 /config/scripts/thermacell/thermacell_control.py status"

Thanks for working on this. I’m considering purchasing a LIV system, but reviews of the app are terrible. I’m curious if you have found other information available via the API. Specifically, if the API exposes a sensor/indicator for when a unit is low or an insert needs to be replaced. I understand you don’t have time to work on this. I’m not sure I do, but I figured I’d ask how far you’ve gotten.

Thank you for taking the time to do this. I am hopeful someone will be able to turn this into something more. But we you have done here is a HUGE step forward!

It looks like someone has implemented Ayla Local Connect in this plugin GitHub - deiger/AirCon: Scripts for controlling Air Conditioners, e.g. with HiSense modules.. Maybe this could be adapted for Liv local control?

I love this integration with HomeKit, but I am having an issue where it is consistently polling the unit, and setting it to ‘on’, then a few seconds later polls and sets it to ‘off’. Not sure how to set the polling intervals, and maybe tune up the reponse process so it is not incorrectly flagged… Any thoughts?

So I’ve spent some time poking at the Thermacell Liv, and I’ve started to learn a bit about the hardware which I’m hoping will lead to an alternative option for managing them through Home Assistant.

As noted earlier in the thread, the Liv connects through a 4-pin M12 A-coded circular interface, with two of the pins used for +48VDC and GND, and two used for half-duplex RS-485 communication at 19200 bps. Best I can tell the device doesn’t seem to implement any of the typical RS-485 standards (Modbus, etc.) but instead implements a custom protocol where the controller sends 11 byte packets down the line to each of the repellers which can then respond in turn.

Through my experimentation thus far I’ve managed to successfully reverse engineer the full power on, warm up, repel, and shutdown cycles, and have implemented a very simplistic controller emulator that runs on an ESP32 or ESP32-C6. My goal is to clean up the firmware, get some hardware designed, and - hopefully! - get some form of cloud-free alternative to what they provide. I’ve got a PCB order in the works – more to come once it arrives!

I have a the new LIV 2 hub and get an authentication error with this approach. It looks like they have a new app. Does anyone know if the the basic server side end of things is the same with the new system?

Their new API is using ESP RainMaker - it’s well documented here: https://swaggerapis.rainmaker.espressif.com

Base URL is https://api.iot.thermacell.com

I was able to toggle the power and change other settings by using this API call after authenticating, pretty sure the colors and other settings can be manipulated in a similar manner:

PUT /{version}/user/nodes/params

[
  {
    "node_id": "node-id-here",
    "payload": {
      "LIV Hub": {
        "Enable Repellers": false
      }
    }
  }
]

Hey @blink_la any chance you can share more details on what you put together here? I’m trying to get the nodes to find my node id (I’ve also just tried using the system id as the node Id) and I keep running into “Either User Id or User Email needs to be provided” to use /user/nodes and I’ve tried every manner of passing the user email and id but can’t get it to work. So I’m wondering how you put call together?

1 Like

Much appreciated for your documenting this!

I am very much a beginner to all this

I program Control4 systems for a living and am only tangentially connected to Home Assistant for one particular customer who has some custom integrations with third-party products.

Controlling the power toggle on his Thermacell Liv units has been a big ask of his that I have not yet been able to complete

Is there any chance you can send me some guides to get into this integration step by step assuming I am a total idiot?

Huge ask, I know

Much appreciated for any help you can give

Here you go… some vibe coding this morning…

1 Like

thanks so much for your work here!! do you by chance know if your integration will work with the original thermacell LIV version one hub, not the latest hub 2 they sell now? thanks!