Here is the trace, no error now but the switch is not triggering.
{
"trace": {
"last_step": "action/1/choose/0/conditions/0",
"run_id": "4b4ec0084e13956be55b375e7a79a652",
"state": "stopped",
"script_execution": "finished",
"timestamp": {
"start": "2022-07-21T19:25:08.014879+00:00",
"finish": "2022-07-21T19:25:08.115682+00:00"
},
"domain": "automation",
"item_id": "1658420676496",
"trigger": "state of input_button.add_per_input_box_cup",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2022-07-21T19:25:08.014957+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.add_chlorine_cup_input",
"state": "on",
"attributes": {
"last_triggered": "2022-07-21T19:22:10.527773+00:00",
"mode": "single",
"current": 0,
"id": "1658420676496",
"friendly_name": "Add Chlorine (cup input)"
},
"last_changed": "2022-07-21T19:23:35.473746+00:00",
"last_updated": "2022-07-21T19:23:35.473746+00:00",
"context": {
"id": "01G8H3E95HYKC54XG0FQHB0X9M",
"parent_id": null,
"user_id": null
}
},
"trigger": {
"id": "button",
"idx": "0",
"platform": "state",
"entity_id": "input_button.add_per_input_box_cup",
"from_state": {
"entity_id": "input_button.add_per_input_box_cup",
"state": "2022-07-21T19:22:10.523716+00:00",
"attributes": {
"editable": true,
"icon": "mdi:water-opacity",
"friendly_name": "Add Per Input Box (cup)"
},
"last_changed": "2022-07-21T19:23:26.597704+00:00",
"last_updated": "2022-07-21T19:23:26.597704+00:00",
"context": {
"id": "01G8H3E0G50XDTVW1CQ2E4HK8M",
"parent_id": null,
"user_id": null
}
},
"to_state": {
"entity_id": "input_button.add_per_input_box_cup",
"state": "2022-07-21T19:25:08.013410+00:00",
"attributes": {
"editable": true,
"icon": "mdi:water-opacity",
"friendly_name": "Add Per Input Box (cup)"
},
"last_changed": "2022-07-21T19:25:08.013558+00:00",
"last_updated": "2022-07-21T19:25:08.013558+00:00",
"context": {
"id": "01G8H3H3H9ND3BFZXN08SGK7J4",
"parent_id": null,
"user_id": "4bd34cc657944781af68fc1844948a77"
}
},
"for": null,
"attribute": null,
"description": "state of input_button.add_per_input_box_cup"
}
}
}
],
"action/0": [
{
"path": "action/0",
"timestamp": "2022-07-21T19:25:08.016957+00:00",
"changed_variables": {
"context": {
"id": "01G8H3H3HEKJ3VCP6PASEHK9Z3",
"parent_id": "01G8H3H3H9ND3BFZXN08SGK7J4",
"user_id": null
}
},
"result": {
"choice": 0
}
}
],
"action/0/choose/0": [
{
"path": "action/0/choose/0",
"timestamp": "2022-07-21T19:25:08.018501+00:00",
"result": {
"result": true
}
}
],
"action/0/choose/0/conditions/0": [
{
"path": "action/0/choose/0/conditions/0",
"timestamp": "2022-07-21T19:25:08.018562+00:00",
"result": {
"result": true
}
}
],
"action/0/choose/0/sequence/0": [
{
"path": "action/0/choose/0/sequence/0",
"timestamp": "2022-07-21T19:25:08.019251+00:00",
"result": {
"params": {
"domain": "switch",
"service": "turn_on",
"service_data": {},
"target": {
"entity_id": [
"switch.pentair_18_41_ca_high_speed"
]
}
},
"running_script": false,
"limit": 10
}
}
],
"action/0/choose/0/sequence/1": [
{
"path": "action/0/choose/0/sequence/1",
"timestamp": "2022-07-21T19:25:08.089495+00:00",
"result": {
"params": {
"domain": "input_datetime",
"service": "set_datetime",
"service_data": {
"timestamp": 1658431508,
"entity_id": [
"input_datetime.switch_off_time"
]
},
"target": {
"entity_id": [
"input_datetime.switch_off_time"
]
}
},
"running_script": false,
"limit": 10
}
}
],
"action/1": [
{
"path": "action/1",
"timestamp": "2022-07-21T19:25:08.112821+00:00",
"result": {
"choice": "default"
}
}
],
"action/1/choose/0": [
{
"path": "action/1/choose/0",
"timestamp": "2022-07-21T19:25:08.112953+00:00",
"result": {
"result": false
}
}
],
"action/1/choose/0/conditions/0": [
{
"path": "action/1/choose/0/conditions/0",
"timestamp": "2022-07-21T19:25:08.113008+00:00",
"result": {
"result": false
}
}
]
},
"config": {
"id": "1658420676496",
"alias": "Add Chlorine (cup input)",
"description": "",
"trigger": [
{
"platform": "state",
"entity_id": [
"input_button.add_per_input_box_cup"
],
"id": "button"
},
{
"platform": "time",
"at": "input_datetime.switch_off_time",
"id": "time"
}
],
"condition": [],
"action": [
{
"choose": [
{
"conditions": [
{
"condition": "trigger",
"id": "button"
}
],
"sequence": [
{
"service": "switch.turn_on",
"data": {},
"target": {
"entity_id": "switch.pentair_18_41_ca_high_speed"
}
},
{
"service": "input_datetime.set_datetime",
"data": {
"timestamp": "{{ ((( states('input_number.cup_s') | float ) / 1.66666666666667 / 16 ) + now().timestamp() ) | int }}"
},
"target": {
"entity_id": "input_datetime.switch_off_time"
}
}
]
}
],
"default": []
},
{
"choose": [
{
"conditions": [
{
"condition": "trigger",
"id": "time"
}
],
"sequence": [
{
"service": "switch.turn_off",
"data": {},
"target": {
"entity_id": "switch.pentair_chlor"
}
}
]
}
],
"default": []
}
],
"mode": "single"
},
"blueprint_inputs": null,
"context": {
"id": "01G8H3H3HEKJ3VCP6PASEHK9Z3",
"parent_id": "01G8H3H3H9ND3BFZXN08SGK7J4",
"user_id": null
}
},
"logbookEntries": [
{
"name": "Add Chlorine (cup input)",
"message": "triggered by state of input_button.add_per_input_box_cup",
"source": "state of input_button.add_per_input_box_cup",
"entity_id": "automation.add_chlorine_cup_input",
"context_id": "01G8H3H3HEKJ3VCP6PASEHK9Z3",
"when": 1658431508.015135,
"domain": "automation"
}
]
}