|
1 | 1 | ---
|
2 | 2 | select:
|
3 |
| - #TODO: printer model is currently unused, but will be needed for setting AMS type |
4 |
| - - platform: template |
5 |
| - name: Printer Model |
6 |
| - id: bambu_model |
7 |
| - state_topic: |
8 |
| - options: |
9 |
| - - "A1Mini" |
10 |
| - - "A1" |
11 |
| - - "P1P/P1S" |
12 |
| - - "X1C/X1E" |
13 |
| - optimistic: true |
14 |
| - restore_value: true |
15 |
| - icon: mdi:printer-3d |
16 |
| - web_server: |
17 |
| - sorting_group_id: sorting_group_printer_settings |
| 3 | +#TODO: printer model is currently unused, but will be needed for setting AMS type |
| 4 | +- platform: template |
| 5 | + name: Printer Model |
| 6 | + id: bambu_model |
| 7 | + state_topic: |
| 8 | + options: |
| 9 | + - "A1Mini" |
| 10 | + - "A1" |
| 11 | + - "P1P/P1S" |
| 12 | + - "X1C/X1E" |
| 13 | + optimistic: true |
| 14 | + restore_value: true |
| 15 | + icon: mdi:printer-3d |
| 16 | + web_server: |
| 17 | + sorting_group_id: sorting_group_printer_settings |
18 | 18 |
|
19 | 19 | text:
|
20 |
| - - platform: template |
21 |
| - name: Printer Serial Number |
22 |
| - id: bambu_serial_number |
23 |
| - state_topic: |
24 |
| - optimistic: true |
25 |
| - mode: text |
26 |
| - restore_value: true |
27 |
| - icon: mdi:barcode |
28 |
| - web_server: |
29 |
| - sorting_group_id: sorting_group_printer_settings |
30 |
| - on_value: |
31 |
| - then: |
32 |
| - - if: |
33 |
| - condition: |
34 |
| - lambda: |- |
35 |
| - return !id(bambu_lan_access_code).state.empty() && |
36 |
| - !id(bambu_ip_address).state.empty() && |
37 |
| - !id(bambu_serial_number).state.empty(); |
38 |
| - then: |
39 |
| - - logger.log: |
40 |
| - level: info |
41 |
| - format: "Connecting to Bambu printer" |
42 |
| - - mqtt.enable: |
43 |
| - id: bambu_mqtt |
44 |
| - else: |
45 |
| - - logger.log: |
46 |
| - level: info |
47 |
| - format: "Missing Bambu Credentials, skipping mqtt connect" |
48 |
| - - mqtt.disable: |
49 |
| - id: bambu_mqtt |
50 |
| - |
51 |
| - # - script.execute: check_mqtt_creds #TODO: Enable once this is merged: https://github.com/esphome/esphome/pull/7716 |
52 |
| - # lambda: |- |
53 |
| - # id(bambu_printer_status).topic = "device/" + x + "/report"; |
54 |
| - - platform: template |
55 |
| - name: Printer Lan Access Code |
56 |
| - id: bambu_lan_access_code |
57 |
| - state_topic: |
58 |
| - optimistic: true |
59 |
| - mode: password |
60 |
| - restore_value: true |
61 |
| - icon: mdi:lock |
62 |
| - web_server: |
63 |
| - sorting_group_id: sorting_group_printer_settings |
64 |
| - on_value: |
65 |
| - then: |
66 |
| - - lambda: |- |
67 |
| - id(bambu_mqtt).set_password(x.c_str()); |
68 |
| - - if: |
69 |
| - condition: |
70 |
| - lambda: |- |
71 |
| - return !id(bambu_lan_access_code).state.empty() && |
72 |
| - !id(bambu_ip_address).state.empty() && |
73 |
| - !id(bambu_serial_number).state.empty(); |
74 |
| - then: |
75 |
| - - logger.log: |
76 |
| - level: info |
77 |
| - format: "Connecting to Bambu printer" |
78 |
| - - mqtt.enable: |
79 |
| - id: bambu_mqtt |
80 |
| - else: |
81 |
| - - logger.log: |
82 |
| - level: info |
83 |
| - format: "Missing Bambu Credentials, skipping mqtt connect" |
84 |
| - - mqtt.disable: |
85 |
| - id: bambu_mqtt |
86 |
| - - platform: template |
87 |
| - name: Printer IP Address |
88 |
| - id: bambu_ip_address |
89 |
| - state_topic: |
90 |
| - optimistic: true |
91 |
| - mode: text |
92 |
| - restore_value: true |
93 |
| - icon: mdi:ip |
94 |
| - web_server: |
95 |
| - sorting_group_id: sorting_group_printer_settings |
96 |
| - on_value: |
97 |
| - then: |
98 |
| - - lambda: |- |
99 |
| - id(bambu_mqtt).set_broker_address(x.c_str()); |
100 |
| - - if: |
101 |
| - condition: |
102 |
| - lambda: |- |
103 |
| - return !id(bambu_lan_access_code).state.empty() && |
104 |
| - !id(bambu_ip_address).state.empty() && |
105 |
| - !id(bambu_serial_number).state.empty(); |
106 |
| - then: |
107 |
| - - logger.log: |
108 |
| - level: info |
109 |
| - format: "Connecting to Bambu printer" |
110 |
| - - mqtt.enable: |
111 |
| - id: bambu_mqtt |
112 |
| - else: |
113 |
| - - logger.log: "Missing Bambu Credentials, skipping mqtt connect" |
114 |
| - - mqtt.disable: |
115 |
| - id: bambu_mqtt |
| 20 | +- platform: template |
| 21 | + name: Printer Serial Number |
| 22 | + id: bambu_serial_number |
| 23 | + state_topic: |
| 24 | + optimistic: true |
| 25 | + mode: text |
| 26 | + restore_value: true |
| 27 | + icon: mdi:barcode |
| 28 | + web_server: |
| 29 | + sorting_group_id: sorting_group_printer_settings |
| 30 | + on_value: |
| 31 | + then: |
| 32 | + - if: |
| 33 | + condition: |
| 34 | + lambda: |- |
| 35 | + return !id(bambu_lan_access_code).state.empty() && |
| 36 | + !id(bambu_ip_address).state.empty() && |
| 37 | + !id(bambu_serial_number).state.empty(); |
| 38 | + then: |
| 39 | + - logger.log: |
| 40 | + level: info |
| 41 | + format: "Connecting to Bambu printer" |
| 42 | + - mqtt.enable: |
| 43 | + id: bambu_mqtt |
| 44 | + else: |
| 45 | + - logger.log: |
| 46 | + level: info |
| 47 | + format: "Missing Bambu Credentials, skipping mqtt connect" |
| 48 | + - mqtt.disable: |
| 49 | + id: bambu_mqtt |
| 50 | + # - script.execute: check_mqtt_creds #TODO: Enable once this is merged: https://github.com/esphome/esphome/pull/7716 |
| 51 | + # lambda: |- |
| 52 | + # id(bambu_printer_status).topic = "device/" + x + "/report"; |
| 53 | +- platform: template |
| 54 | + name: Printer Lan Access Code |
| 55 | + id: bambu_lan_access_code |
| 56 | + state_topic: |
| 57 | + optimistic: true |
| 58 | + mode: password |
| 59 | + restore_value: true |
| 60 | + icon: mdi:lock |
| 61 | + web_server: |
| 62 | + sorting_group_id: sorting_group_printer_settings |
| 63 | + on_value: |
| 64 | + then: |
| 65 | + - lambda: |- |
| 66 | + id(bambu_mqtt).set_password(x.c_str()); |
| 67 | + - if: |
| 68 | + condition: |
| 69 | + lambda: |- |
| 70 | + return !id(bambu_lan_access_code).state.empty() && |
| 71 | + !id(bambu_ip_address).state.empty() && |
| 72 | + !id(bambu_serial_number).state.empty(); |
| 73 | + then: |
| 74 | + - logger.log: |
| 75 | + level: info |
| 76 | + format: "Connecting to Bambu printer" |
| 77 | + - mqtt.enable: |
| 78 | + id: bambu_mqtt |
| 79 | + else: |
| 80 | + - logger.log: |
| 81 | + level: info |
| 82 | + format: "Missing Bambu Credentials, skipping mqtt connect" |
| 83 | + - mqtt.disable: |
| 84 | + id: bambu_mqtt |
| 85 | +- platform: template |
| 86 | + name: Printer IP Address |
| 87 | + id: bambu_ip_address |
| 88 | + state_topic: |
| 89 | + optimistic: true |
| 90 | + mode: text |
| 91 | + restore_value: true |
| 92 | + icon: mdi:ip |
| 93 | + web_server: |
| 94 | + sorting_group_id: sorting_group_printer_settings |
| 95 | + on_value: |
| 96 | + then: |
| 97 | + - lambda: |- |
| 98 | + id(bambu_mqtt).set_broker_address(x.c_str()); |
| 99 | + - if: |
| 100 | + condition: |
| 101 | + lambda: |- |
| 102 | + return !id(bambu_lan_access_code).state.empty() && |
| 103 | + !id(bambu_ip_address).state.empty() && |
| 104 | + !id(bambu_serial_number).state.empty(); |
| 105 | + then: |
| 106 | + - logger.log: |
| 107 | + level: info |
| 108 | + format: "Connecting to Bambu printer" |
| 109 | + - mqtt.enable: |
| 110 | + id: bambu_mqtt |
| 111 | + else: |
| 112 | + - logger.log: "Missing Bambu Credentials, skipping mqtt connect" |
| 113 | + - mqtt.disable: |
| 114 | + id: bambu_mqtt |
116 | 115 |
|
117 | 116 | button:
|
118 |
| - - platform: restart |
119 |
| - name: "Restart OpenSpool" |
120 |
| - id: restart_openspool |
121 |
| - state_topic: |
122 |
| - entity_category: diagnostic |
| 117 | +- platform: restart |
| 118 | + name: "Restart OpenSpool" |
| 119 | + id: restart_openspool |
| 120 | + state_topic: |
| 121 | + entity_category: diagnostic |
123 | 122 |
|
124 | 123 | #TODO: Show the current state of the printer
|
125 | 124 |
|
|
0 commit comments