Zigbee2MQTT and Smartthings Devices - Temperature and Battery Levels?

Hi Folks,

I’m really very new to Zigbee2MQTT and I’m (slowly) migrating my Smarthings devices off my Smartthings Hub. One thing that doesn’t seem to get picked up is the temperature sensors and battery levels and I’m not sure how to get those to work (no values are displaying).

Can someone direct me to a simple “idiots guide” to getting these to work? I pretty need a step-by-step guide as I’m not really into the inner workings of HASSIO. I’m more of a casual tinker, but I really want to get myself weened off the cloud based options.

I’m assuming you turned on mqtt auto discovery?

Each of these sensors will be on a different MQTT topic under the single device_id. For example, I have a SmartThings motion sensor on my zigbee2mqtt. It created 5 separate sensors.

If you click on config -> integrations -> MQTT, you should see each device listed here. If I click on that motion sensor device, I can see the 5 individual sensors. I renamed my device here so instead of sensor.0x1234123412341234_occupancy, they instead used the name I gave it.

So, yeah. You are probably used to them being attributes under a single sensor. Now they are each their own sensor.

Using MQTT Explorer, I can see the device id and the topic for each individual sensor it will create.
image

I have. The devices work … kind of. I have two functioning buttons and one sensor and they operate with my automations.

Temperature and battery attributes are displayed … kind of. The sensor picked them up almost immediately but doesn’t display value for them. The button I configured last night didn’t display the temperature then but it does now, and there’s still no value for battery.

Just typing this now, I have to wonder … is it that the value doesn’t appear until the value changes on hte device? If the temperature value changes, is it then that the sensor reports it? That may explain why the battery isn’t reporting yet as battery drain is so slow. If that’s the case, is there a way to force it to report the value?

Do you have MQTT explorer? Or some way to look at the mqtt topics?

If you look at /zigbee2mqtt/<device_id>, you should see all of the values there.

{
  "battery":20,
  "battery_low":false,
  "linkquality":73,
  "occupancy":false,
  "tamper":false,
  "temperature":22.11,
  "voltage":2600
}

The rest of the crap in the /homeassistant/xxxx MQTT topics just tells home assistant where and how to find the values…but they all probably live in one topic.

I’m not sure what kind of sensor would report empty values. If something changes, it should send a state update with all of the values. If I trigger a motion event, it sent the full update for all sensors with the payload. So I got an occupancy set to true and an updated temperature.

If the values here are empty, there is an issue with zigbee2mqtt.

If the values here are not empty, there is an issue in home assistant.

Ok … that’s odd. I have a devices.yaml, but not one for each individual device.

Edit: I’m just downloading MQTT Explorer right now.

Ok … after installing MQTT Explorer, I now get what you’re talking about.

This is my sensor:

   "battery_low": false,
   "linkquality": 120,
   "occupancy": false,
   "occupancy": true,
   "tamper": false,
   "temperature": 21.88

And my Button shows

  "action": "",
  "click": "",
  "linkquality": 81,
  "temperature": 20.42

So temperature is registering now on both devices. There is still no battery value displayed. Very curious.

Yeah, its odd that there is no ‘battery’ value here.

What brand of device is it exactly?

Just an update … it took about 12 hours, but the values did appear.

I suspect it is as I said before, that the values only appear when they change … so because the battery charge changes so slowly, the value doesn’t appear until the value drops. I wonder if this a bug in Zigbee2MQTT.

I’ve recently installed the zigbee2mqtt dongle and managed to add an IKEA tradfri and a Xiaomi remote. Using the add-on integration for HA and after many button pressed they were eventually recognised. A couple of days later I thought I’d try some old (2016) smartthings sensors and plugs however I’ve had no success at all. Any ideas?
Perhaps I’m not resetting then properly. For example with the motion sensor hold down button while inserting battery and the plug hold side button in while plugging in. In each case I get flashing blue lights. Neither of these products have any markings on to identify model. Also they have no problems connecting to smartthings.

I think I have the same 2016 motion sensor.

The problem I had was a dead battery. But there is no indication. I remove the battery, hold down the button, insert batter, blue lights flash. I assumed it was working…but would never connect.

Took the battery out and decided to measure it. Wasn’t even close to the right voltage lol.

I used to have it connected to smart things…but didn’t try to re-add it there. So who knows if it would have still worked on smart things.

I read that battery shape is important as some don’t work. These were cheap eBay batteries and I will check voltage however each does connect to the smartthings hub. Which presumes all is ok. They are on the zigbee2mqtt supported list (these ones released in 2015). Are you using the HA plug in to discover?

I restarted the node where the dongle was on and added a USB extension lead. Whilst I got lots of error messages this time it found my devices easily. Thanks for help.