Introducing a New Add-on Feature using the SwitchBot API for MQTT Integration

Hello — pleased to come across this add-on. I have what is likely going to be a very novice question. The documentation provides quite a bit of YAML, but doesn’t specify where it goes. Is it intended to go in to configuration.yaml?

For instance, the docs provide the following:

SwitchBot:
  ApiKey: >-
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  ApiSecret: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

and

WebhookService:
  UseWebhook: true
  UseNgrok: true
  NgrokAuthToken: _________________ngrokauthtoken__________________
  HostUrl: <Configuration required only when using Webhook without ngrok>

Specifically where should I place that code?

Thank you!

It is not for configuration.yaml. You need to input it on the add-on configuration screen.
If you installed the add-on on HA-OS, it can be accessed via the following url:
http://homeassistant.local:8123/hassio/addon/cafb8c58_switchbot_mqtt/config

If you installed Home Assistant as a Container or Core, you should configure it as /data/Options.json, since you are likely running a Docker image.
(Details are mentioned in the Wiki.)

1 Like

Thank you very much! Appreciate it.

I now have this working. I have sensors for both the Evaporative Humidifier and the Meter Pro CO2 and can also control the Evaporative Humidifier.

However — the Meter Pro CO2 reports “0” or unknown for all sensors while the Evaporative Humidifier seems to be fully functional. The temp reports 32 degrees F.

Pressing “Polling” does not update values.

The Device ID shown is correct.

Has anyone encountered this before? Are there troubleshooting steps I should try?

Thank you!

Might you have any ideas on why the Meter Pro CO2 is not returning correct data, @hsakoh ?

It seems that there was an outage causing the API service to stop during the following period. Did it have any impact on you? From 2024/12/16 06:47:03 (UTC) for about one day.

It should have recovered naturally, but if it is still ongoing, please first check the add-on logs. Set the log level to trace and obtain the response JSON when you press the Polling button. (I also have a MeterProCO2 monitor, and I am able to obtain values without any issues.)

32 degrees F. is zero in Celsius degrees, which may indicate that no MeterPro values were taken (they are all initial values).

Ah, I might have figured it out. The Evaporative Humidifier is WiFi-enabled, so it sends data to SwitchBot on its own. The MeterPro only has Bluetooth, so it won’t send data to SwitchBot unless it’s connected to the Hub. (To obtain values from the API, it needs to be connected to the internet via the Hub.)

This makes complete sense. I am trying to get around having to install yet another hub.

Thank you @hsakoh! Appreciate it.

@Robobo1111
If you want to integrate the Meter Pro CO2 into HomeAssistant without adding a hub, you should use Bluetooth integration.

I’m not sure if the evaporative humidifier is supported, but the Meter Pro CO2 is supported.
The Humidifier (WoHumi) listed in the supported devices is likely the ultrasonic humidifier that was sold in the past (or in Japan).