KSensor Tracker - Inconsistent Home / Away state

Hi. For KSensor Blue Charm BC021 tracker, using Theengs Bridge v1.8.1, the Home / Away status is inconsistent while the tracker is stationary. It used to flip to “Away” status every few minutes or so until I changed the BT configuration to the following:

{"bleconnect":false,"interval":10000,"adaptivescan":false,"intervalacts":55555,"intervalcnct":3600000,"scanduration":10000,"hasspresence":false,"prestopic":"presence/","presuseuuid":false,"minrssi":-100,"extDecoderEnable":false,"extDecoderTopic":"undecoded","pubuuid4topic":false,"ignoreWBlist":false,"forcepscn":false,"tskstck":1608,"crstck":3060,"enabled":true,"scnct":1847,"onlysensors":false,"randommacs":false,"filterConnectable":false,"pubadvdata":false,"presenceawaytimer":120000,"movingtimer":60000}

However, still, every 40 minutes / 1 hour I see the change to Away status with the corresponding message in the topic:

{"id":"DD:34:02:09:CA:32","state":"offline"}

The Home Assistant status history looks like so, while the tracker is stationary. Any advise is appreciated.

One relevant observation is that those Away events may be related to the intervals when no motion is detected. If I switch off accelerometer in the tracker device, I no longer see any MQTT messages and the status is permanently away. This leads to the question - can this device reliably work as a tracker in KSensor protocol.

Hi @kseniuts

Ould you post a full sample message of your BC021?

As I do not have one myself I do not know which properties it does actually broadcast. If it doesn’t broadcast any temperature nor battery voltage, then yes, only the three axis for acceleration will make the BC021 be received and recognised, but it does sound that it doesn’t broadcast these values when stationary, as other acceleration beacons still do even when they are not being moved. It could also be that the BC021 is out of range for being received by the OMG gateway during the times it shows as offline.

With your settings of "interval":10000 and "scanduration":10000 you should receive decoded broadcasts every 20 seconds, moving or not, unless there is an above mentioned broadcast stop when stationery.

And with the 2 minutes timeout ("presenceawaytimer":120000) you should only get offline/AWAY notifications once the beacon has not been received six times with the 20 seconds window.

To see if the broadcasts stop if stationary or if it might be a reception issue with your gateway can you see what happens when the BC021 is stationary near the gateway? Do you still see the regular 20 seconds receptions or not?

Thank you, @DigiH

With accelerometer off, the last message I received was

{"id":"DD:34:02:09:CA:32","state":"offline"}

No more messages coming after this. Interestingly, the phone KBeacon app still continues to update the tracker’s rssi, battery / voltage and temperature.

With accelerometer on, I receive messages like so

{"id":"DD:34:02:09:CA:32","name":"BlueCharm_001","rssi":-54,"brand":"BlueCharm","model":"Beacon 08/04P/021","model_id":"KSensor","type":"ACEL","tempc":27,"tempf":80.6,"accx":-11,"accy":-15,"accz":989,"volt":3.006}

Messages come in different intervals, not exactly 20 seconds. The tracker is less than a meter away from the gateway.

Now and then the “offline” message still comes through throwing the status to “Away”

Can it be that the tracker is detected as purely acceleration sensor and as such sets “Home” status only if it detects motion?

This sounds almost as if the broadcast format changes from KSensor (which we recognise and decode) to iBeacon format (which we do not recognise so far) once the accelerometer is turned off.

Or is there a setting in the app which might still have the iBeacon format active somehow?

To see if this is the case, can you turn on BT: Publish Advanced and Advertising Data in the gateway’s HA UI and see which undecoded messages with the raw data you are receiving when the accelerometer is off?

Can it be that the tracker is detected as purely acceleration sensor and as such sets “Home” status only if it detects motion?

This really depends on the above possible format change and the decoder recognising the BC021 as such. If correctly an regularly received it should report Home the whole time, moving or stationary.

I think I set “BT: Publish only sensors” to on when attempting to solve “Home / Away” issue. Now when I set it to off and “BT: Publish Advanced and Advertising Data” on, I get these messages:

{"id":"DD:34:02:09:CA:32","mac_type":1,"adv_type":0,"name":"BlueCharm_001","rssi":-65,"servicedata":"660103e803e8","servicedatauuid":"0x2080"}

HA Device looks like so, only “KSensor-tracker” gets updated, all other attributes are old.

to having a Blue Charm beacon myself, I only just discovered the full instructions for them myself ; - in addition to the decoder which I know more about :slight_smile:

Can you follow these and see if things are working for you as expected then? With the accelerometer kept on on your BC021.

So you should have all the settings in the app as shown in the documentation, but also set “movingtimer” to the same timeout as “presenceawaytimer”.

I think this might have been implemented to be able to use the BC021 attached to a dryer or something. So once the machine stops rumbling and shaking it is set tooffline.

Why this was implemented as a BLE device tracker I do not know, instead of just setting the .moving property to Not moving instead. And why not for the other accelerometer decoders we have?

@1technophile Any insight on this?

@DigiH @kseniuts
I will do a test with a BlueCharm sensor and share the parameters here

@DigiH @1technophile , I increased the value of movingtimer to 2 minutes, equal to presenceawaytimer value, and, while leaving the tracker near the gateway and with accelerometer turned on, encountered another “offline” / Away message within several minutes. Raising the value of movingtimer to 3 minutes didn’t produce Away state for about 2 hours, until I moved the tracker away downstairs.

I have the same feeling from the behavior.