thanks for your reply. when i move sensor.holy_iot_room_presence, the value of distance will change.
Near is smaller number, far is big number. Please compare the change in distance. “6.2 & 6.7”
I want to use distance value to trigger automation! For example: when old_state is 6.2, new_state is 6.7, Means the device is leaving, then action.
event_type": “state_changed”,
“data”: {
“entity_id”: “sensor.holy_iot_room_presence”,
“old_state”: {
“entity_id”: “sensor.holy_iot_room_presence”,
“state”: “Garage”,
“attributes”: {
"distance": 6.2,
“last_updated_at”: “2021-11-08T04:45:31.428Z”,
“friendly_name”: “Holy-IOT Room Presence”,
“icon”: “mdi:bluetooth”
},
“last_changed”: “2021-11-08T04:42:44.705959+00:00”,
“last_updated”: “2021-11-08T04:45:31.534302+00:00”,
“context”: {
“id”: “5ad28592235422e32775aea9bd8cab30”,
“parent_id”: null,
“user_id”: null
}
},
“new_state”: {
“entity_id”: “sensor.holy_iot_room_presence”,
“state”: “Garage”,
“attributes”: {
"distance": 6.7,
“last_updated_at”: “2021-11-08T04:45:33.444Z”,
“friendly_name”: “Holy-IOT Room Presence”,
“icon”: “mdi:bluetooth”