-
Notifications
You must be signed in to change notification settings - Fork 0
/
error_handling.yaml
50 lines (47 loc) · 1.91 KB
/
error_handling.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
button:
- platform: template
name: ${stepper_motor_id_upper}.error.reset_errors
id: ${stepper_motor_id}_error_reset_errors
on_press:
lambda: |-
get_controller(id(${controller}))->reset_error_code();
get_controller(id(${controller}))->reset_error_homing_difference();
get_controller(id(${controller}))->reset_error_pinion_wheel_count();
binary_sensor:
- platform: template
name: "${stepper_motor_id_upper}.error.pinionwheel_check"
id: ${stepper_motor_id}_error_pinionwheel_check
lambda: |-
if (get_controller(id(${controller}))->get_pinion_wheel_diff_error())
{
if (get_controller(id(${controller}))->is_active())
{
//comment out to activate:get_controller(id(${controller}))->emergency_stop("Pinionwheel count mismatch", STEPPER_ERROR_PINIONWHEEL_MISMATCH);
}
if (get_controller(id(${controller}))->homing_is_valid())
{
//comment out to activate:get_controller(id(${controller}))->set_homing_invalid();
//TODO: auto reset: get_controller(id(${controller}))->reset_error_pinion_wheel_count();
}
return true;
}else
{
return false;
}
- platform: template
name: "${stepper_motor_id_upper}.error.homing_difference_check"
id: ${stepper_motor_id}_error_homing_difference_check
lambda: |-
if (get_controller(id(${controller}))->get_homing_diff_error())
{
if (get_controller(id(${controller}))->is_active())
{
//comment out to activate: get_controller(id(${controller}))->emergency_stop("Homing invalid, lost position", STEPPER_ERROR_HOMING);
}
//comment out to activate: get_controller(id(${controller}))->set_homing_invalid();
//TODO: auto reset: get_controller(id(${controller}))->reset_error_homing_difference();
return true;
}else
{
return false;
}