SwitchBot Energy Usage for Smart Plug Mini (HomeKit)

The SwitchBot integration currently does not support energy usage.

Within the Switch Bot the current and historical data energy consumption data is available.

Would it be possible to collect this data?
Would it require connecting to the plug via WiFi? Or could HomeKit be leveraged?

my esp32 project now supports plug mini and power monitoring if you are interested

https://community.home-assistant.io/t/switchbot-bot-curtain-meter-contact-motion-mqtt-esp32-bridge-local-control/

I appreciate the suggestion but I’d prefer to leverage the existing 2.4GHz WiFi connection / not purchase any additional hardware.

The only other alternative would be to leverage a RPi4-4GB.

Do you have any suggestions meeting that criteria?

sorry no I don’t have a suggestion for wifi. just fyi, the wifi option relies on internet and cloud and is not local

also esp32s are like 5 bucks

I’ll look into getting an ESP32 for tinkering, I wish there was a way to leverage my existing RPi4 instead though. :cry:

FYI:
I’m using the HomeKit controller so the WiFi connection is local.
Additionally, the native Home Assistant integration for SwitchBot now uses local polling.

ok cool. only the newer plug minis support homekit, they had a hardware update. yes all BLE is local. The switchbot integration does not use wifi from my understanding. cheers

At least as of firmware version 1.4.0 this isn’t possible since the energy data isn’t exposed over HomeKit Accessory Protocol.

If they ever update the firmware in the future, it is relatively straitfoward to add support for it if they do it in a sane way.

1 Like

You should be able to use the SwitchBot cloud API to pull data as it is a WiFi connected device. I think you just need to have cloud (web) services enabled in the SwitchBot app.

I did a video on how to integrate with Home Assistant: Integrating SwitchBot with Home Assistant // Detailed Guide - YouTube

For some reason when you poll the device via the API the power consumption is shown as “weight”.

{
    "body": {
        "deviceId": "XXXXXXXX",
        "deviceType": "Plug Mini (US)",
        "electricCurrent": 0,
        "electricityOfDay": 0,
        "hubDeviceId": "XXXXXX",
        "power": "off",
        "voltage": 122.3,
        "weight": 0
    },
    "message": "success",
    "statusCode": 100
}

I should have a video out next week talking about the Plug Minis. I am not an expert on HomeKit devices but using the web API you can do almost anything with them.

1 Like

Unfortunately that API doesn’t provide the Energy (KWh) neither it’s History, while those details are available in the App.
Do someone knows a way to retrieve those?
It would be very useful in order to track costs and usage in a long timeframe.

Regards,