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…
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.
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
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?