I have checked the latest trace. it ha triggered, but ossibly the opposite way?
the door is closed and the temp is below the threshold and the switch turned off.
sorry for so much back and forth!
{
"trace": {
"last_step": "action/0",
"run_id": "e4cc6f024ba1666e3247638290329b96",
"state": "stopped",
"script_execution": "finished",
"timestamp": {
"start": "2024-04-17T10:19:53.982575+00:00",
"finish": "2024-04-17T10:19:54.100277+00:00"
},
"domain": "automation",
"item_id": "1713347838734",
"trigger": "state of binary_sensor.master_bedroom_door_sensor_door",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2024-04-17T10:19:53.982728+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.master_bedroom_temp_tester",
"state": "on",
"attributes": {
"id": "1713347838734",
"last_triggered": "2024-04-17T09:58:36.438534+00:00",
"mode": "single",
"current": 0,
"friendly_name": "Master bedroom temp tester"
},
"last_changed": "2024-04-17T09:57:24.114995+00:00",
"last_reported": "2024-04-17T09:58:36.441741+00:00",
"last_updated": "2024-04-17T09:58:36.441741+00:00",
"context": {
"id": "01HVNQWWMPQXM9C459EBB82RF3",
"parent_id": "01HVNQWWMN6DCJEGPK6598M52S",
"user_id": null
}
},
"trigger": {
"id": "off",
"idx": "0",
"alias": null,
"platform": "state",
"entity_id": "binary_sensor.master_bedroom_door_sensor_door",
"from_state": {
"entity_id": "binary_sensor.master_bedroom_door_sensor_door",
"state": "on",
"attributes": {
"device_class": "door",
"friendly_name": "Master bedroom door sensor Door"
},
"last_changed": "2024-04-17T10:15:32.026047+00:00",
"last_reported": "2024-04-17T10:15:32.026047+00:00",
"last_updated": "2024-04-17T10:15:32.026047+00:00",
"context": {
"id": "01HVNRVWDTNZD7FQMADYH45M5W",
"parent_id": null,
"user_id": null
}
},
"to_state": {
"entity_id": "binary_sensor.master_bedroom_door_sensor_door",
"state": "off",
"attributes": {
"device_class": "door",
"friendly_name": "Master bedroom door sensor Door"
},
"last_changed": "2024-04-17T10:16:53.980046+00:00",
"last_reported": "2024-04-17T10:16:53.980046+00:00",
"last_updated": "2024-04-17T10:16:53.980046+00:00",
"context": {
"id": "01HVNRYCEWZ5MDBFN1Y6BC5TQW",
"parent_id": null,
"user_id": null
}
},
"for": {
"__type": "<class 'datetime.timedelta'>",
"total_seconds": 180
},
"attribute": null,
"description": "state of binary_sensor.master_bedroom_door_sensor_door"
}
}
}
],
"condition/0": [
{
"path": "condition/0",
"timestamp": "2024-04-17T10:19:53.982843+00:00",
"result": {
"result": true
}
}
],
"condition/0/conditions/0": [
{
"path": "condition/0/conditions/0",
"timestamp": "2024-04-17T10:19:53.982929+00:00",
"result": {
"result": true
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2024-04-17T10:19:53.984232+00:00",
"changed_variables": {
"context": {
"id": "01HVNS3W7YTQ4ZAE5E75KP3AFD",
"parent_id": "01HVNRYCEWZ5MDBFN1Y6BC5TQW",
"user_id": null
}
},
"result": {
"params": {
"domain": "switch",
"service": "turn_off",
"service_data": {},
"target": {
"entity_id": [
"switch.master_bedroom_heater_plug"
]
}
},
"running_script": false
}
}
]
},
"config": {
"id": "1713347838734",
"alias": "Master bedroom temp tester",
"description": "",
"trigger": [
{
"platform": "state",
"entity_id": [
"binary_sensor.master_bedroom_door_sensor_door"
],
"to": "off",
"for": {
"hours": 0,
"minutes": 3,
"seconds": 0
},
"id": "off"
},
{
"platform": "numeric_state",
"entity_id": [
"sensor.master_bedroom_temp_humidity_sensor_temperature"
],
"above": 21,
"id": "off"
},
{
"platform": "state",
"entity_id": [
"binary_sensor.master_bedroom_door_sensor_door"
],
"to": "on",
"for": {
"hours": 0,
"minutes": 3,
"seconds": 0
},
"id": "on"
},
{
"platform": "numeric_state",
"entity_id": [
"sensor.master_bedroom_temp_humidity_sensor_temperature"
],
"below": 19,
"id": "on"
}
],
"condition": [
{
"condition": "or",
"conditions": [
{
"condition": "trigger",
"id": "off"
},
{
"condition": "and",
"conditions": [
{
"condition": "state",
"entity_id": "binary_sensor.master_bedroom_door_sensor_door",
"state": "on",
"for": {
"hours": 0,
"minutes": 3,
"seconds": 0
}
},
{
"condition": "numeric_state",
"entity_id": "sensor.master_bedroom_temp_humidity_sensor_temperature",
"below": 19
}
]
}
]
}
],
"action": [
{
"service": "switch.turn_{{ trigger.id }}",
"target": {
"entity_id": "switch.master_bedroom_heater_plug"
}
}
]
},
"blueprint_inputs": null,
"context": {
"id": "01HVNS3W7YTQ4ZAE5E75KP3AFD",
"parent_id": "01HVNRYCEWZ5MDBFN1Y6BC5TQW",
"user_id": null
}
},
"logbookEntries": [
{
"name": "Master bedroom temp tester",
"message": "triggered by state of binary_sensor.master_bedroom_door_sensor_door",
"source": "state of binary_sensor.master_bedroom_door_sensor_door",
"entity_id": "automation.master_bedroom_temp_tester",
"context_id": "01HVNS3W7YTQ4ZAE5E75KP3AFD",
"when": 1713349193.983198,
"domain": "automation"
},
{
"when": 1713349194.608292,
"state": "off",
"entity_id": "switch.master_bedroom_heater_plug",
"context_event_type": "automation_triggered",
"context_domain": "automation",
"context_name": "Master bedroom temp tester",
"context_message": "triggered by state of binary_sensor.master_bedroom_door_sensor_door",
"context_source": "state of binary_sensor.master_bedroom_door_sensor_door",
"context_entity_id": "automation.master_bedroom_temp_tester"
}
]
}