Back to overview Guide

Mopeka in Home Assistant: keep an eye on your motorhome gas bottle from anywhere

Reading time: 6 min
CampMatic

This article is also available in: Deutsch · Français · Español · Italiano · Polski · Čeština · Svenska · Nederlands

Mopeka in Home Assistant: keep an eye on your motorhome gas bottle from anywhere

A Mopeka sensor under the gas bottle measures reliably. But if you want the level in Home Assistant, you hit two hurdles: Bluetooth only reaches as far as the radio link. And the sensor does not send a percentage, it sends raw data.

Both can be solved. Here is the route at a glance; every detail and file is in our Home Assistant guide.

The key points

  • The CampMatic box in the vehicle reads the Mopeka over Bluetooth and sends the values via Wi-Fi or 4G over MQTT to your Home Assistant, wherever it runs.
  • In Home Assistant you need the Mosquitto broker app and a short bridge file to our server.
  • The Mopeka sends raw values. Fill height and level come from two template sensors that use the same formulas as the CampMatic app. The finished file is available for download.
  • No subscription: the app and the server are free.

Why go through the CampMatic box?

Home Assistant only reads Bluetooth sensors within range of its own Bluetooth hardware. If your motorhome is in winter storage, on a pitch somewhere or on the road with you, nothing from the gas bottle reaches your home.

So the CampMatic box stays in the vehicle. It reads the Mopeka where it is and delivers the values to your Home Assistant over MQTT. You also see the level in the CampMatic app and in the Telegram bot. And in the app you can set up a notification for the gas level by email or Telegram.

What you need

  • A Mopeka sensor, for example the Pro Check under a steel or aluminium bottle. Sensors are not included with CampMatic.
  • A CampMatic box: CampMatic Guard for any camper, or CampMatic for Truma CP Plus or CampMatic for Truma iNet X if you also want to control the heater by app. All three read the Mopeka.
  • A running Home Assistant that you have admin access to.
  • About half an hour for the whole guide.

The steps at a glance

  1. Pair the sensor in the CampMatic app. Under Settings → Devices → Add device, choose the Mopeka gas sensor. If it does not show up, briefly press the SYNC button on the Mopeka. You set the bottle type directly in CampMatic. Pairing happens in the app, not in Home Assistant (Help: External Devices).
  2. Get the credentials. On your device's Status page in the CampMatic app, the card MQTT Bridge (Home Assistant) shows broker, port, username and password, and the Device Status block shows the Device ID (chapter 2).
  3. Set up Mosquitto. Install Mosquitto broker (Home Assistant now calls add-ons "apps"), create the folder /share/mosquitto first and only then switch on the customize option (chapter 3).
  4. Create the bridge. The file /share/mosquitto/campmatic.conf connects your broker to ours, encrypted on port 8883. Then restart Mosquitto. The log must show Connecting bridge (chapter 4).
  5. Look up the slot number. In the MQTT integration, listen to campmatic/<GERAETE_ID>/+/config. The mopeka/config line shows the slot number (slot) and bottle type (tank_type) of your sensor (chapter 8).
  6. Create the sensors. Add the raw values and the two calculating sensors to the package file, check the configuration, restart Home Assistant (chapter 9).

Which values arrive

The Mopeka measures upwards through the bottom of the bottle using ultrasound. What reaches you is the time of flight of the pulse, not the level. Each value has its own topic following the pattern campmatic/<GERAETE_ID>/mopeka/bottle_<SLOT_MOPEKA>/…:

  • raw_tof: time of flight in microseconds
  • raw_t: temperature byte from 0 to 127; subtract 40 for degrees Celsius
  • battery_raw: sensor battery as a raw byte
  • quality: measurement quality from 0 to 3
  • rssi: signal strength in dBm

You have to look up the slot number: CampMatic counts the slots consecutively across all paired sensor types.

Template sensors: from time of flight to level

A time of flight only becomes a height once temperature is taken into account, because sound travels slower in the cold. And a height only becomes a level once the height of the bottle is known. Neither lives in the sensor. The upside: new bottle types and recalibrations need no firmware update.

In Home Assistant, two template sensors from chapter 9 do this. They use the same formulas as the CampMatic app, so both show the same value. You end up with:

  • sensor.gas_bottle_level_height: fill height in millimetres
  • sensor.gas_bottle_level: level in percent

Plus temperature, sensor battery in volts and measurement quality. In the level formula you enter two numbers for your bottle: empty is always 38 mm, full depends on the type, for example 333 mm for a 6 kg steel bottle and 358 mm for 11 kg steel. The full table is in the guide.

Three pitfalls the guide explains in detail:

  • The fill-height formula needs the temperature byte, not the degrees. Otherwise the values look plausible but are wrong.
  • A misspelt entity name in a formula simply returns an empty value, with no error message. Copy entity names from Developer tools → States rather than typing them.
  • New MQTT sensors only appear after a proper restart of Home Assistant.

The measurement quality should read 2 or 3. At 0 or 1 the sensor is not seated properly. New readings usually arrive only every six minutes and are not buffered, so right after a restart they are unavailable for a few minutes.

Two bottles, dashboard, troubleshooting

With two Mopeka sensors, you add the block a second time with the second slot number and different names. Each box pairs up to eight Bluetooth sensors, of which up to four battery monitors. You can mix gas sensors, for example one bottle with a Truma Level Control and one with a Mopeka.

For the display, the guide includes a ready-made dashboard that only uses cards Home Assistant ships with. The gas gauge shows green from 40 and yellow from 20 percent, and you can change the thresholds (chapter 14). If something does not work, see chapter 15, troubleshooting.

Truma Level Control or Mopeka?

With a Truma Level Control under the bottle, the route into Home Assistant is shorter. It delivers level, remaining amount and days left ready-calculated, so you need no template sensors. How that works is in Truma Level Control in Home Assistant. The Mopeka, on the other hand, also suits fixed tanks and US bottle sizes.

What it costs

  • CampMatic Guard WiFi: €89. Uses an existing Wi-Fi network, such as a mobile hotspot.
  • CampMatic Guard 4G: €129. Needs no Wi-Fi but its own SIM card (not included), such as an IoT SIM from about €2 a month.
  • App and server: free, no subscription.

Which Mopeka models CampMatic reads is listed on the Integrations page.

→ CampMatic Guard WiFi — €89

→ CampMatic Guard 4G — €129

Further reading: