Hi Erik,
I got the value by just monitoring the event bus (Developer Tools > Events) and use a * for the definition of what to listen for then hit the test button, you will see the device where you presses the button first and then the event for the smoke detection system overall.
As for how to test, I am with you that it should look just like the real thing in the data (with maybee an EXTRA flag that you can check to determine if its a test). However, one I was happy with the TEST working ok I copied it to the real version of the automation and got the matches out (amazon cardboard wallets burn well) to prove it REALLY worked.
Here is an exampl of the event you will see.
Event 12 fired 13:38:
{
"event_type": "state_changed",
"data": {
"entity_id": "binary_sensor.hall_smokealarm",
"old_state": {
"entity_id": "binary_sensor.hall_smokealarm",
"state": "off",
"attributes": {
"smokedetectorcheck_state": "NONE",
"alarmstate": "IDLE_OFF",
"friendly_name": "Hall Smoke Alarm",
"icon": "mdi:smoke-detector",
"device_class": "smoke"
},
"last_changed": "2021-12-27T21:02:55.487423+00:00",
"last_updated": "2022-01-01T12:18:43.090604+00:00",
"context": {
"id": "b65272a68c5aa869069c2b715f413094",
"parent_id": null,
"user_id": null
}
},
"new_state": {
"entity_id": "binary_sensor.hall_smokealarm",
"state": "off",
"attributes": {
"smokedetectorcheck_state": "SMOKE_TEST_OK",
"alarmstate": "IDLE_OFF",
"friendly_name": "Hall Smoke Alarm",
"icon": "mdi:smoke-detector",
"device_class": "smoke"
},
"last_changed": "2021-12-27T21:02:55.487423+00:00",
"last_updated": "2022-01-03T13:38:58.686452+00:00",
"context": {
"id": "3209a1eedd619cd7a24b32cbcbf25905",
"parent_id": null,
"user_id": null
}
}
},
"origin": "LOCAL",
"time_fired": "2022-01-03T13:38:58.686452+00:00",
"context": {
"id": "3209a1eedd619cd7a24b32cbcbf25905",
"parent_id": null,
"user_id": null
}
}