Arlec BLE Bridge and Node Red - Decoding BLE Sensor Data

Hi Guys,

Having issues trying to get the BLE Bridge working.

  1. Node Red Cmnd Issue
  2. Unable to distinguish data.

I’ve got one of the Arlec BLE Bridges as per this Tasmota Page: https://templates.blakadder.com/arlec_SGS01HA.html
They are easy to get and relatively cheap from Bunnings.

I’m using this as a Sensor net in my garage.
2 x Motion Sensors
3 x Contact Sensors
2 x Temp Sensors

I have configured using the TUYA/Arlec App and paired all sensors to confirm they work. I have then flashed Tamota basic as per the instructions. Where i am stuck is how to decode the messages.

I’m using this code in a Function on Node Red:

// Get Message Payload
var payload = msg.payload

// Ignore Everything but Cmnd 54
if(payload.TuyaReceived.Cmnd != "54") { return }

// Extract the Sensor Hub ID
var Data            = payload.TuyaReceived.Data;
var sensorHubID     = Data.substr(0,12)

// Extract the Sensor Data Values
var CmndData        = payload.TuyaReceived.CmndData;
var updateID        = CmndData.substr(0,6);     // Each sensor+battery update shares this string
var sensorNumber    = parseInt(CmndData.substr(6,2));
var sensorType      = CmndData.substr(8,6);
var sensorValue     = CmndData.substr(14);

// Processing
switch(sensorType) {
    case "4F0204":
        sensorType = "TEMP"
        fahrenheit = parseInt(sensorValue,16)
        celsius = (fahrenheit - 32) * 0.555555555555555
        sensorValue = parseInt(celsius)
    break;
    case "4E0204":
        sensorType = "HUMIDITY"
        humidity = parseInt(sensorValue,16)
        sensorValue = parseInt(humidity)
    break;
    case "630204":
        sensorType = "INTERVAL"
        value = parseInt(value, 16) / 60    // Returns the interval in minutes at which the temp/humidity sensor will send an update. Interval is changed by pressing the button on the sensor
    break;
    case "5B0101":
        sensorType = "CONTACT"
        sensorValue = parseInt(sensorValue)
   
    break;
    case "5C0101":
        sensorType = "MOTION"
        sensorValue = parseInt(sensorValue)
    break;
    case "640204":
        sensorHubID = (parseInt("55AA0136000B",16) - 3).toString(16).toUpperCase()
        sensorType = "BATTERY"
        percentage = parseInt(sensorValue,16)
        sensorValue = percentage
    break;
}

var topic = "tasmota_4003E1/BLE" + sensorNumber + "/" + sensorType
var mqttMessage = {  payload: sensorValue, topic:topic };
var debugMessage = { mqtt           : mqttMessage,
                     sensorhubid    : sensorHubID,
                     sensornumber   : sensorNumber,
                     sensortype     : sensorType,
                     sensorvalue    : sensorValue,
                     updateid       : updateID,                     data           : Data,
                     cmnddata       : CmndData };
return [mqttMessage,debugMessage];

I have a contact sensor at my desk, which i can use to trigger a response in the messages being sent, but i have two issues:

  1. The Code above is giving me a Debug Message: “TypeError: Cannot read property ‘Cmnd’ of undefined”

  2. I can see a response change with the contact sensor, but unsure how to take it further in MQTT or NodeRed, and then finally to a sensor on HomeAssistant.

Finally, from the Tasmota Console with my BLE Contact Sensor:

Contact Closed:

02:10:21 RUL: TUYARECEIVED#CMND==54 performs ">Publish BleBridge/tele/command 802D060664020400000064"
02:10:25 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA01070008010100FE050000FD11","Cmnd":7,"CmndData":"010100FE050000FD","DpType1Id1":"0x050000FD110064C855786671312E30","1":{"DpId":1,"DpIdType":1,"DpIdData":"050000FD110064C855786671312E30"},"DpType254Id0":"0x00FD110064C855786671312E302E30","0":{"DpId":0,"DpIdType":254,"DpIdData":"00FD110064C855786671312E302E30"}}}
02:10:25 RUL: TUYARECEIVED#CMNDDATA performs "var1 010100FE050000FD"
02:10:25 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"010100FE050000FD"}
02:10:25 MQT: stat/tasmota_4003E1/RESULT = {"POWER":"ON"}

Contact Open:

02:11:31 RUL: TUYARECEIVED#CMND==54 performs ">Publish BleBridge/tele/command E8800B0664020400000064"
02:11:38 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
02:11:38 RUL: TUYARECEIVED#CMNDDATA performs "var1 01"
02:11:38 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"01"}
02:11:42 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA01070008010100FE050000FD11","Cmnd":7,"CmndData":"010100FE050000FD","DpType1Id1":"0x050000FD1100648855786671312E30","1":{"DpId":1,"DpIdType":1,"DpIdData":"050000FD1100648855786671312E30"},"DpType254Id0":"0x00FD1100648855786671312E302E30","0":{"DpId":0,"DpIdType":254,"DpIdData":"00FD1100648855786671312E302E30"}}}
02:11:42 RUL: TUYARECEIVED#CMNDDATA performs "var1 010100FE050000FD"
2 Likes

First I would like to thank all contributors https://github.com/blakadder without the guide and template/function java script I would not have been able to get this working.

I hope this can can help others I managed to get it working after spending a day or so on it.
I am new at HomeAssistant and only just installed Node Red to get this working.

I found I had the same issue with the function in node red returning :
debug Message: “TypeError: Cannot read property ‘Cmnd’ of undefined”

I believe it was a case I had enabled a rule in Tasmota that may have interfered with the output.

The working rules I configured - Commands - Tasmota
Return MQTT response as 0 = RESULT topic (default)
SetOption4 0

Set publishing TuyaReceived to MQTT
SetOption66 1 Set publishing TuyaReceived to MQTT

Additions
I change the data type to ‘a parsed JSON object’ in the MQTT input node and create a debug set with complete msg data this can be removed or disabled when working. I found I needed to also reset Option66 to 1 for the data to flow correctly.

In HomeAssistant I also needed to update the template to match the sensor data topic: example: SENSORHUB/BLE4/CONTACT front door sensor MQTT output Node Red

Node Red

object
mqtt: object
payload: 0
topic: "SENSORHUB/BLE4/CONTACT"
_msgid: "3b9736fa.5bbdfa"
sensorhubid: "55AA01360008"
sensornumber: 4
sensortype: "CONTACT"
sensorvalue: 0
updateid: "83B521"
data: "55AA0136000883B521045B010100F8"
cmnddata: "83B521045B010100"
_msgid: "3b9736fa.5bbdfa"

HomeAssistant configuration.yaml example

binary_sensor:
  - platform: mqtt
    unique_id: front_door
    payload_on: 1
    payload_off: 0
    name: "Front Door"
    state_topic: "SENSORHUB/BLE4/CONTACT"
    device_class: door
    qos: 1
  - platform: mqtt
    unique_id: front_door_battery
    name: "Front Door Battery"
    state_topic: "SENSORHUB/BLE4/BATTERY"
    device_class: battery
    qos: 1

output as illustrated below:


My only issue now is finding out if it is possible to peer additional devices to the hub now it has been flashed with Tasmotoa.

Arrgghh, i saw your post, and thought great… i can get this working now. Any other tips? I’m tempted to just reflash the device and setup again.

I can now get NodeRed to display the input commands in my debug node. But the function doesn’t want to do anything with them.

Here is a copy from my Tasmota Console…

09:01:12 RUL: TUYARECEIVED#CMNDDATA performs "var1 01"
09:01:12 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"01"}
09:01:23 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
09:01:23 RUL: TUYARECEIVED#CMNDDATA performs "var1 01"
09:01:23 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"01"}
09:01:26 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA01070008EA0100FE00000000F8","Cmnd":7,"CmndData":"EA0100FE00000000","DpType1Id234":"0x00000000F84C793665786671312E30","234":{"DpId":234,"DpIdType":1,"DpIdData":"00000000F84C793665786671312E30"},"DpType254Id0":"0x","0":{"DpId":0,"DpIdType":254,"DpIdData":""}}}
09:01:26 RUL: TUYARECEIVED#CMNDDATA performs "var1 EA0100FE00000000"
09:01:26 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"EA0100FE00000000"}
09:01:34 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
09:01:34 RUL: TUYARECEIVED#CMNDDATA performs "var1 01"
09:01:34 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"01"}
09:01:41 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA01070008EA0100FE00000000F8","Cmnd":7,"CmndData":"EA0100FE00000000","DpType1Id234":"0x00000000F84C793665786671312E30","234":{"DpId":234,"DpIdType":1,"DpIdData":"00000000F84C793665786671312E30"},"DpType254Id0":"0x","0":{"DpId":0,"DpIdType":254,"DpIdData":""}}}
09:01:41 RUL: TUYARECEIVED#CMNDDATA performs "var1 EA0100FE00000000"
09:01:41 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"EA0100FE00000000"}
09:01:45 MQT: tele/tasmota_4003E1/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
09:01:45 RUL: TUYARECEIVED#CMNDDATA performs "var1 01"
09:01:45 MQT: stat/tasmota_4003E1/RESULT = {"Var1":"01"}

And the function in Node Red:

// Get Message Payload
var payload = msg.payload

// Ignore Everything but Cmnd 54
if(payload.TuyaReceived.Cmnd != "54") { return }

// Extract the Sensor Hub ID
var Data            = payload.TuyaReceived.Data;
var sensorHubID     = Data.substr(0,12)

// Extract the Sensor Data Values
var CmndData        = payload.TuyaReceived.CmndData;
var updateID        = CmndData.substr(0,6);     // Each sensor+battery update shares this string
var sensorNumber    = parseInt(CmndData.substr(6,2));
var sensorType      = CmndData.substr(8,6);
var sensorValue     = CmndData.substr(14);

// Processing
switch(sensorType) {
    case "4F0204":
        sensorType = "TEMP"
        fahrenheit = parseInt(sensorValue,16)
        celsius = (fahrenheit - 32) * 0.555555555555555
        sensorValue = parseInt(celsius)
    break;
    case "4E0204":
        sensorType = "HUMIDITY"
        humidity = parseInt(sensorValue,16)
        sensorValue = parseInt(humidity)
    break;
    case "630204":
        sensorType = "INTERVAL"
        value = parseInt(value, 16) / 60    // Returns the interval in minutes at which the temp/humidity sensor will send an update. Interval is changed by pressing the button on the sensor
    break;
    case "5B0101":
        sensorType = "CONTACT"
        sensorValue = parseInt(sensorValue)
   
    break;
    case "5C0101":
        sensorType = "MOTION"
        sensorValue = parseInt(sensorValue)
    break;
    case "640204":
        sensorHubID = (parseInt("55AA0136000B",16) - 3).toString(16).toUpperCase()
        sensorType = "BATTERY"
        percentage = parseInt(sensorValue,16)
        sensorValue = percentage
    break;
}

var topic = "tasmota_4003E1/BLE" + sensorNumber + "/" + sensorType
var mqttMessage = {  payload: sensorValue, topic:topic };
var debugMessage = { mqtt           : mqttMessage,
                     sensorhubid    : sensorHubID,
                     sensornumber   : sensorNumber,
                     sensortype     : sensorType,
                     sensorvalue    : sensorValue,
                     updateid       : updateID,
                     data           : Data,
                     cmnddata       : CmndData };
return [mqttMessage,debugMessage];

Any ideas?

Hi Stu,

Try the update to the script below also my Tesmota output looks different, it looks like you have a rule or variable set, Tesmota config is where I would start to look. My output in Tesmota for a door sensor contact and how the function works I have listed below copy of my setup in NodeRed.
it may be worth reset the Tesmota config or re flash I don’t see this in my console output
looks like the cmnddata is performing a rule or something:

CMNDDATA performs "var1 01"
stat/tasmota_4003E1/RESULT = {"Var1":"01"}

Also check you MQTT topic setup, I kept my the same as the guide.
Tasmota topic setup = SENSORHUB

NodeRed MQTT in input node settings

NodeRed Function

  • Script in Function Tab
  • Two outputs configured top one linked to MQTT out
  • Enabled

Script:
diffrence from orginal dont know if its a fix

var payload = msg.payload;

Full Script

// Get Message Payload
var payload = msg.payload;

// Ignore Everything but Cmnd 54
if(payload.TuyaReceived.Cmnd != "54") { return }

// Extract the Sensor Hub ID
var Data            = payload.TuyaReceived.Data;
var sensorHubID     = Data.substr(0,12)

// Extract the Sensor Data Values
var CmndData        = payload.TuyaReceived.CmndData;
var updateID        = CmndData.substr(0,6);     // Each sensor+battery update shares this string
var sensorNumber    = parseInt(CmndData.substr(6,2));
var sensorType      = CmndData.substr(8,6);
var sensorValue     = CmndData.substr(14);

// Processing
switch(sensorType) {
    case "4F0204":
        sensorType = "TEMP"
        fahrenheit = parseInt(sensorValue,16)
        celsius = (fahrenheit - 32) * 0.555555555555555
        sensorValue = parseInt(celsius)
    break;
    case "4E0204":
        sensorType = "HUMIDITY"
        humidity = parseInt(sensorValue,16)
        sensorValue = parseInt(humidity)
    break;
    case "630204":
        sensorType = "INTERVAL"
        value = parseInt(value, 16) / 60    // Returns the interval in minutes at which the temp/humidity sensor will send an update. Interval is changed by pressing the button on the sensor
    break;
    case "5B0101":
        sensorType = "CONTACT"
        sensorValue = parseInt(sensorValue)
   
    break;
    case "5C0101":
        sensorType = "MOTION"
        sensorValue = parseInt(sensorValue)
    break;
    case "640204":
        sensorHubID = (parseInt("55AA0136000B",16) - 3).toString(16).toUpperCase()
        sensorType = "BATTERY"
        percentage = parseInt(sensorValue,16)
        sensorValue = percentage
    break;
}

var topic = "SENSORHUB/BLE" + sensorNumber + "/" + sensorType
var mqttMessage = {  payload: sensorValue, topic:topic };
var debugMessage = { mqtt           : mqttMessage,
                     sensorhubid    : sensorHubID,
                     sensornumber   : sensorNumber,
                     sensortype     : sensorType,
                     sensorvalue    : sensorValue,
                     updateid       : updateID,
                     data           : Data,
                     cmnddata       : CmndData };
return [mqttMessage,debugMessage];

From my understanding the function takes information form Data and CmndData and checks the string to pull out the values shown below in bold then posts to MQTT:


Example Motion Sensor
sensorHubID = 55AA013600082
substring [0,12] = “Data”:“55AA013600082C0120055C010101EF”

updateID = 2C0120
substring [0,6] = “CmndData”:“2C0120055C010101”

sensorNumber = 05
substring [6,2] = “CmndData”:“2C0120055C010101”

sensorType = 5C0101
substring [8,6] = “CmndData”:“2C0120055C010101”

sensorValue = 01
substring [14] = “CmndData”:“2C0120055C010101


NodeRed MQTT Out
topic is blank

Below is my tesmota console output

10:32:20.111 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA013600082C0120055C010101EF","Cmnd":54,"CmndData":"2C0120055C010101"}}
10:32:20.114 TYA: RX unknown command
10:32:20.131 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA0136000B2C02200564020400000001FF","Cmnd":54,"CmndData":"2C02200564020400000001"}}
10:32:20.133 TYA: RX unknown command
10:32:21.959 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA013600081ED211035B0101009F","Cmnd":54,"CmndData":"1ED211035B010100"}}
10:32:21.962 TYA: RX unknown command
10:32:21.978 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA0136000B1ED311036402040000006414","Cmnd":54,"CmndData":"1ED3110364020400000064"}}
10:32:21.981 TYA: RX unknown command
10:32:23.585 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA01360008F09F1B055C0101004B","Cmnd":54,"CmndData":"F09F1B055C010100"}}
10:32:23.588 TYA: RX unknown command
10:32:23.601 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA0136000BF0A01B05640204000000015C","Cmnd":54,"CmndData":"F0A01B0564020400000001"}}
10:32:23.605 TYA: RX unknown command

Node red function MQTT output top node debug is:

3/9/2021, 11:32:21 AMnode: debug function
SENSORHUB/BLE3/CONTACT : msg : Object
object
payload: 0
topic: "SENSORHUB/BLE3/CONTACT"
_msgid: "23ad1b51.ea0e94"
3/9/2021, 11:32:21 AMnode: debug function
SENSORHUB/BLE3/BATTERY : msg : Object
object
payload: 100
topic: "SENSORHUB/BLE3/BATTERY"
_msgid: "76fe322d.97362c"
3/9/2021, 11:32:22 AMnode: debug function
SENSORHUB/BLE5/MOTION : msg : Object
object
payload: 0
topic: "SENSORHUB/BLE5/MOTION"
_msgid: "12ccae82.fbaa71"
3/9/2021, 11:32:22 AMnode: debug function
SENSORHUB/BLE5/BATTERY : msg : Object
object
payload: 1
topic: "SENSORHUB/BLE5/BATTERY"
_msgid: "811fa9f5.3bd128"

Hope this helps sorry was only able to post one screenshot for the config in NodeRed.
here is a copy of my working NodeRed flow if it helps copy and save as a flows.json file change label:“Flow 1” to a unique name and import into NodeRed - you will need to then update MQTT server settings

[{"id":"c874df58.0e5f","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"dbbca1b5.1f34d","type":"mqtt in","z":"c874df58.0e5f","name":"","topic":"tele/SENSORHUB/RESULT","qos":"1","datatype":"json","broker":"c780ccbe.8e8de","x":140,"y":140,"wires":[["2b0072a5.1c3f6e","791aded6.1d3eb"]]},{"id":"779a2703.f3a528","type":"debug","z":"c874df58.0e5f","name":"debug function","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":180,"wires":[]},{"id":"2b0072a5.1c3f6e","type":"function","z":"c874df58.0e5f","name":"Format SENSORHUB Data","func":"// Get Message Payload\nvar payload = msg.payload;\n\n// Ignore Everything but Cmnd 54\nif(payload.TuyaReceived.Cmnd != \"54\") { return }\n\n// Extract the Sensor Hub ID\nvar Data            = payload.TuyaReceived.Data;\nvar sensorHubID     = Data.substr(0,12)\n\n// Extract the Sensor Data Values\nvar CmndData        = payload.TuyaReceived.CmndData;\nvar updateID        = CmndData.substr(0,6);     // Each sensor+battery update shares this string\nvar sensorNumber    = parseInt(CmndData.substr(6,2));\nvar sensorType      = CmndData.substr(8,6);\nvar sensorValue     = CmndData.substr(14);\n\n// Processing\nswitch(sensorType) {\n    case \"4F0204\":\n        sensorType = \"TEMP\"\n        fahrenheit = parseInt(sensorValue,16)\n        celsius = (fahrenheit - 32) * 0.555555555555555\n        sensorValue = parseInt(celsius)\n    break;\n    case \"4E0204\":\n        sensorType = \"HUMIDITY\"\n        humidity = parseInt(sensorValue,16)\n        sensorValue = parseInt(humidity)\n    break;\n    case \"630204\":\n        sensorType = \"INTERVAL\"\n        value = parseInt(value, 16) / 60    // Returns the interval in minutes at which the temp/humidity sensor will send an update. Interval is changed by pressing the button on the sensor\n    break;\n    case \"5B0101\":\n        sensorType = \"CONTACT\"\n        sensorValue = parseInt(sensorValue)\n   \n    break;\n    case \"5C0101\":\n        sensorType = \"MOTION\"\n        sensorValue = parseInt(sensorValue)\n    break;\n    case \"640204\":\n        sensorHubID = (parseInt(\"55AA0136000B\",16) - 3).toString(16).toUpperCase()\n        sensorType = \"BATTERY\"\n        percentage = parseInt(sensorValue,16)\n        sensorValue = percentage\n    break;\n}\n\nvar topic = \"SENSORHUB/BLE\" + sensorNumber + \"/\" + sensorType\nvar mqttMessage = {  payload: sensorValue, topic:topic };\nvar debugMessage = { mqtt           : mqttMessage,\n                     sensorhubid    : sensorHubID,\n                     sensornumber   : sensorNumber,\n                     sensortype     : sensorType,\n                     sensorvalue    : sensorValue,\n                     updateid       : updateID,\n                     data           : Data,\n                     cmnddata       : CmndData };\nreturn [mqttMessage,debugMessage];\n\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":420,"y":140,"wires":[["8152aee2.77332"],["779a2703.f3a528"]]},{"id":"8152aee2.77332","type":"mqtt out","z":"c874df58.0e5f","name":"","topic":"","qos":"","retain":"","broker":"82b765a2.477f28","x":650,"y":100,"wires":[]},{"id":"791aded6.1d3eb","type":"debug","z":"c874df58.0e5f","name":"debug MQTT message","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":420,"y":80,"wires":[]},{"id":"c780ccbe.8e8de","type":"mqtt-broker","name":"","broker":"10.0.0.10","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"82b765a2.477f28","type":"mqtt-broker","name":"MQTT","broker":"10.0.0.10","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Regards,
Simon.

@scoobee81 It may also be that if you have followed Method: 1 below you will have a rule breaking Method 2.
Arlec Smart Home Hub Bluetooth Bridge Template for Tasmota (blakadder.com)
try removing rule1 created with Method 1: -

Rule1 ON TuyaReceived#CmndData DO var1 %value% ENDON ON TuyaReceived#Cmnd==54 DO Publish BleBridge/tele/command %var1% ENDON Rule1 1

with the following command:
https://tasmota.github.io/docs/Rules/#delete-rule

Rule1 "

Thanks, yeah i tried that, but i think i may have now lost the pairing of the sensors, as I’m no longer seeing anything in the console.

What is strange is that i had a spare hub, which when I paired it, was able to link back to some of the sensors, which leads me to think that the pairing authorisation is done through the cloud. I though I would then try TUYA Local, but i get a permissions error from the API.

Anyway, I’ll keep plugging away slowly. And i’lol update if i work it out.

I had the same issue when trying to reset the hub back to tuya/delta firmware from backup. I wasn’t able to register the hub in Tuya to re assign the sensors. I ended up buying a new hub and some additional sensors from Bunnings. then followed the same procedure - Method 2. now have them all working.

Right, have got closer. Its not Node Red. Its the message coming out of Tasmota. I’m definitely not getting the Command 54 message. When i commend out the line if(payload.TuyaReceived.Cmnd != "54") { return } in the function, the message is passed through, although its not the correct message.

Maybe the BLE module has newer firmware or something.

02:40:32 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA01070008A60100FE00000000B4","Cmnd":7,"CmndData":"A60100FE00000000","DpType1Id166":"0x00000000B44C793665786671312E30","166":{"DpId":166,"DpIdType":1,"DpIdData":"00000000B44C793665786671312E30"},"DpType254Id0":"0x","0":{"DpId":0,"DpIdType":254,"DpIdData":""}}}
02:40:34 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
02:40:45 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
02:40:47 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA01070008A60100FE00000000B4","Cmnd":7,"CmndData":"A60100FE00000000","DpType1Id166":"0x00000000B44C793665786671312E30","166":{"DpId":166,"DpIdType":1,"DpIdData":"00000000B44C793665786671312E30"},"DpType254Id0":"0x","0":{"DpId":0,"DpIdType":254,"DpIdData":""}}}
02:40:56 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}
02:41:03 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA01070008A60100FE00000000B4","Cmnd":7,"CmndData":"A60100FE00000000","DpType1Id166":"0x00000000B44C793665786671312E30","166":{"DpId":166,"DpIdType":1,"DpIdData":"00000000B44C793665786671312E30"},"DpType254Id0":"0x","0":{"DpId":0,"DpIdType":254,"DpIdData":""}}}
02:41:07 MQT: tele/SENSORHUB/RESULT = {"TuyaReceived":{"Data":"55AA010000010102","Cmnd":0,"CmndData":"01"}}

Hi Stu,
The only other Tesmota configuration setting I changed is web logging.
Also check/re-try these options with reboot of the hub:
SetOption4 0
SetOption66 1
weblog 4

Logging Options


Template info:

Regards,
Simon

I had the same problem.

Change the first MQTT node’s output from autodetect to “a parsed JSON object” and it should function correctly.

1 Like

I recently deleted the bunnings GridConnect App and switched to the Tuya app and my Arlec Smart Home Hub Bluetooth Gateway “D2” Red LED started flashing. It wasn’t publishing any CMND==54 data regardless if I tried Method 1 or Method 2 here: Arlec Smart Home Hub Bluetooth Gateway (SGS01HA) Configuration for Tasmota

All I had to do is open the Tuya app and add device and it found the Arlec Hub and added it to the Tuya app. As soon as it added it the Red led stopped flashing and stayed on solid and started to publish all the sensors data CMND==54

Though i would share this here as I was struggling for the last 24 hours trying to get it to work using all the above. I guess the BLE sensors must need to be added to the tuya based app or it wont work. Not sure but im happy

2 Likes

how did you manged to ge the device to re-pair? as i keep getting a “device timed out” error on app.
it seams that the hub is dropping its wifi connection and going into fall back wifi mode. even if i connect to this network and connet to mt wifi network i still get a time out on app.

thanks for this I was having the same issue and followed your step and it worked.

I also had the timeout issue and the Arlec hub couldn’t really be added to the Tuya app, but during the adding process the bluetooth light stopped flashing on the Arlec hub and afterward Arlec hub started publishing the CMND==54 data.