Mqtt smartthings to home assistant and visonic MCT-340E door/window sensor

Hi

i tryde to use a usb zigbee stick to use this sensors, now i have given up on this and will use my smartthings hub v2 instedd using mqtt.
The problem i have is that i can’t get the sensor integrated to home-assistant.
in home assistant it states “Unavailable”
im using this config, can someone point me in the rightway?

binary_sensor:

  • platform: mqtt
    name: “Fönster Tvättstuga”
    state_topic: “smartthings/Fönster Tvättstuga/contact”
    payload_on: “ON”
    payload_off: “OFF”
    availability_topic: “smartthings/Fönster Tvättstuga/availability”
    payload_available: “online”
    payload_not_available: “offline”
    qos: 0
    device_class: opening
    value_template: ‘{{ value.x }}’

mqtt can see the sensor when im looking in the logg

//Regards

What stick did you use? I have about 7 or 8 of these and they seem to work now with the HUSBZB stick. Temperatures don’t always show up, but I do get binary_sensor updates OK.

hi

i tryde 2 usb sticks: telegesis ETRX357USB-LRS+8M and ConBee USB Zigbee-controller.

i finally managed to get the sensor configured using mqtt, so now it shows, open/close and temp, but im having trouble getting the battery state to show.
in the logs it send the battery state but i can’t figure out how to ade it.
and is it a way to make al 3 things to be in one icon instead of three separate ones, for example , i like to see “window bedroom” closed,temp 34C,battery 55%

my conf nu:

  • platform: mqtt
    name: “test”
    state_topic: “smartthings/test/temperature/state”
    qos: 0
    device_class: temperature
    unit_of_measurement: “°C”

  • platform: mqtt
    name: “test2”
    state_topic: “smartthings/test/test”
    device_class: “battery”
    unit_of_measurement: “%”

binary_sensor:

  • platform: mqtt
    name: “test”
    state_topic: “smartthings/test/contact/state”
    payload_on: “open”
    payload_off: “closed”
    qos: 0
    device_class: door

I have the same Visonics on ST going into HA and my MQTT looks like this:

  - platform: mqtt
    name: "Living Room Window Left"
    state_topic: "smartthings/Living Room Window Left/contact"
    device_class: window
    payload_on: "open"
    payload_off: "closed"
    payload_available: "ONLINE"
    payload_not_available: "OFFLINE"
    retain: 'true'
    qos: '1'

Might just need to change up some of the wording and possibly Capitalization. Also, make sure that the ST MQTT Bridge on ST’s End has the sensor added in the SmartApp.

But can you see: open/close, battery and temperature in home assistant?
it’s only battery i can’t see

//Regards

Gotta create a “sensor” (not a “binary_sensor”) for it:

- platform: mqtt  
    name: "Living Room Window Left Battery"
    state_topic: "smartthings/Living Room Window Left/battery"
    unit_of_measurement: "%"
    device_class: battery
    force_update: 'true'
    retain: 'true'
    qos: '1'

Then you can view the battery. It might (read: will) take some time for battery to actually come through. It’s an issue with the amount of Data MQTT can push through. It realistically needs to come through on its own update. It usually takes me a few days to weeks to get battery states in since it actually has to update to push to HA. ST will send out a battery low notification through their app once it hits somewhere below 20%. So unless you’re dangerously close to that, it should update your end before then.

Since I did a complete tear down and redo of my system, I have a lot of "Unknown"s for my batteries from ST.

hmm ok i tryde that, but as you say it shows unknown.
i tryde binary_sensor for batteri then i get a batterie logga and it states: status normal.
but im guessing it only notify if the battery is bad?
it is a bitt stange it dosent update, if i look in the logg i does state i receiving battery status but nothing changes

my temp are also crazy wrong. its 21-22c in the room, but it stats 34c
EDIT: never mind found how to change the temp :wink: (it’s done in the smartthings app if anyone else is looking for it)

why do you have qos: 1? what qos stand for? (i have it on 0)

two more question: i have it as door open/close (window did not display correct)
but is it possible to make the icon go red for example if the contact is open? today it just a open door. (getting lost in all my other sensors)

is it possible to group things in rooms? for example, i really liked how smartthings using roms with all things so i can have: living room, sensors,contacts, lights and so on in one tab.
most awesome would be if i could get tabs markt with the different rooms and in every tab you could have the sensors in one row, lights in one and so on.

/Regards

I see it too. But the issue is still about the amount of data MQTT can push from ST. https://github.com/stjohnjohnson/smartthings-mqtt-bridge/pull/71
It’s really weird and I don’t have a good answer unfortunately. :man_shrugging:

In reality, you don’t need QoS for sensors since we’re receiving data, not sending it out. QoS is typically for sending out data, like if you were sending to the MQTT Bridge for switches, outlets, etc. Here’s a great breakdown of QoS for MQTT: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels

What does the sensor show in ST? HA should just be grabbing statuses from ST and publishing them. If the device itself in ST is reporting 34C, you can tweak it in the ST App if you’re using their native SmartSense Multi Sensor DTH or the Visonic DTH.
(I see you found out how to tweak it. Leaving it in just in case.)

Grouping would be done in HA itself. https://www.home-assistant.io/components/group/
I have my Rooms grouped and then views for Batteries itself.

You can check out my (very old) HA config here: https://github.com/techwithjake/home-assistant-config

i figured it out, (stupid easy) now it displays battery % correctly and updates it, you need to ad it with “/battery/state” for it to work like this (namn of my device is “test”)
im putting my mqtt conf here if others looking for this later.

mqtt:
broker: localhost
port: 1883
protocol: 3.1
keepalive: 60
client_id: smartthings
username: My User
password: My password

sensor:

  • platform: yr

  • platform: mqtt
    name: “test”
    state_topic: “smartthings/test/temperature/state”
    qos: 0
    device_class: temperature
    unit_of_measurement: “°C”

  • platform: mqtt
    name: “Test Battery”
    state_topic: “smartthings/test/battery/state”
    unit_of_measurement: “%”
    retain: true

binary_sensor:

  • platform: mqtt
    name: “test”
    state_topic: “smartthings/test/contact/state”
    payload_on: “open”
    payload_off: “closed”
    qos: 0
    device_class: door

//Regards and thank you for your help

Glad to hear that worked for you. No such luck for me yet. :slightly_frowning_face:

hmm one of my sensor i had to pull the battery from and set it back again to display and start to update the battery % (using one of this in every door/windows, about 25 units)

and your other config settings is looking the same as mine? protocol 3.1 / remove force_update etc?

I got it to “work” for the ones that are showing in the Logs. Had to change “%” to ‘%’.
:man_shrugging:

Ok nice :slight_smile: you stated before that you used zigbee usb sticks?
do any of this support this visonic sensors and xiamoi fire sensor?

I noticed that alexa can see my sensos from home assistant but not the ones from smartthings,
alexa can see the once from smartthings if im using mqtt bridge to home assistant, but it would be nice to thru out the smartthings hub. //Regards

It’s interesting that Alexa is seeing your sensors as they have no “actionable” items with them. What can you “do” with them through Alexa?

I have tried them with the Linear HUSBZB-1 and while they “work”, there’s typically something missing. The biggest note missing is the battery state typically. It can get the temperature sometimes but it’s really finicky.

I don’t have any Xiaomi Sensors but I’m looking into their Temp/Humidity Sensors in the near future. I will still more than likely use the ST Hub for them though.

i can ask if door, window is open and temperature in a certain room.
ps: do you know what happened to the nuc image? (i had to use a old one using google chash to find it)

Ah. You’re using Custom Intents with HA. You should be able to do it with ST as well since it’s an open platform. I’m just not 100% how.

Sorry, don’t use NUC. I just use DietPi on my RPi 3 B.