homebridge-mqttthing icon indicating copy to clipboard operation
homebridge-mqttthing copied to clipboard

JSON for tasmota ble - connected xiaomi LYWSD0290dd04

Open sommertrip opened this issue 3 years ago • 5 comments

Hi!

This is a request for help on the configuration, I don't think it's a bug.

I am very happily using homebridge with many devices over MQTT but I do have issues to get temperatur/humidity displayed fetched from a Xiaomi BLE Device.

I do have the following Setup:

  • RasperryPi with 1.4.0
  • Homebridge Mqttthing - 1.1.39
  • Tasmota 32 BLE configured to receive data via MQTT Console report: CleanShot 2022-03-14 at 10 53 53@2x

I´d like to get the temperture and humidity displayed in homekit apps. the current JSON in homebridge in the temp section is. CleanShot 2022-03-14 at 10 55 58@2x

I´ve tried several other configs but can´t get it to work CleanShot 2022-03-14 at 11 00 07@2x

Maybe a Bug?

sommertrip avatar Mar 14 '22 10:03 sommertrip

This works well for me in a similar setup

   {
            "accessory": "mqttthing",
            "type": "temperatureSensor",
            "name": "Bathroom Temperature",
            "topics": {
                "getCurrentTemperature": {
                    "topic": "tele/mirrorheater/SENSOR",
                    "apply": "return (Math.round(JSON.parse(message).BME280.Temperature*2)/2);"
                }
            }
        },

rbswift avatar Apr 05 '22 23:04 rbswift

Hi thx, but didn´t help still receive the following message [6.4.2022, 15:46:00] [homebridge-mqttthing] This plugin generated a warning from the characteristic 'Current Temperature': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info.

sommertrip avatar Apr 06 '22 13:04 sommertrip

NaN means "not a number". Maybe you need to change the topic and BME280

rbswift avatar Apr 07 '22 02:04 rbswift

I was able to configure this sensor like this. Homebridge console throws warnings, but it works. { "accessory":"mqttthing", "type":"temperatureSensor", "name":"Temperature BLE Living room", "url":"mqtt://localhost", "topics":{ "getCurrentTemperature":"tele/tasmota_D6376C/SENSOR$.LYWSD03c61721.Temperature", "getStatusLowBattery":"tele/tasmota_D6376C/SENSOR$.LYWSD03c61721.Battery" } },

Hi thx, but didn´t help still receive the following message [6.4.2022, 15:46:00] [homebridge-mqttthing] This plugin generated a warning from the characteristic 'Current Temperature': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info.

MDo3 avatar May 08 '22 08:05 MDo3

Hi thx, did this according to your proposal, but do receive the following in the log files [9.5.2022, 07:20:29] [Xiaomi BLE] Initializing mqttthing accessory... [9.5.2022, 07:20:29] [Xiaomi BLE] Exception while creating services: TypeError: Cannot read properties of undefined (reading 'resubscribe') [9.5.2022, 07:20:29] [Xiaomi BLE] TypeError: Cannot read properties of undefined (reading 'resubscribe') at MqttClient.subscribe (/usr/lib/node_modules/homebridge-mqttthing/node_modules/mqtt/lib/client.js:701:27) at Object.subscribe (/usr/lib/node_modules/homebridge-mqttthing/libs/mqttlib.js:325:24) at mqttSubscribe (/usr/lib/node_modules/homebridge-mqttthing/index.js:50:17) at floatCharacteristic (/usr/lib/node_modules/homebridge-mqttthing/index.js:1221:21) at characteristic_CurrentTemperature (/usr/lib/node_modules/homebridge-mqttthing/index.js:1593:17) at configToServices (/usr/lib/node_modules/homebridge-mqttthing/index.js:2846:17) at createServices (/usr/lib/node_modules/homebridge-mqttthing/index.js:3425:24) at new makeThing (/usr/lib/node_modules/homebridge-mqttthing/index.js:3457:23) at /usr/lib/node_modules/homebridge/src/server.ts:352:50 at Array.forEach () [9.5.2022, 07:20:29] [Xiaomi BLE] Accessory mqttthing returned empty set of services; not adding it to the bridge.

sommertrip avatar May 09 '22 05:05 sommertrip