-
Notifications
You must be signed in to change notification settings - Fork 35
AMS support with rotary selection #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EmberLightVFX
wants to merge
23
commits into
spuder:main
Choose a base branch
from
EmberLightVFX:AMS-with-rotary-selection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4701289
Add AMS options
EmberLightVFX e9ec935
Add better external LED functions
EmberLightVFX be94eb5
Update package_import_url
EmberLightVFX e220a9a
Reset the encoder number to 0 on each boot.
EmberLightVFX 575d157
Change from select component to number component (select contains a b…
EmberLightVFX e2dd3ab
Fix selected_slot and led selection
EmberLightVFX d1ee9ad
Update the ams and slot calculation for rotary encoder
EmberLightVFX 7223e3f
Update esphome to 2025.06.0
EmberLightVFX ac25681
Renamed update_leds to select_led to reflect better what it's doing
EmberLightVFX c01f27d
Move rotary encoder code to its own file
EmberLightVFX 3ef2aeb
Fix conditions when manually selecting units, ams and slots in web UI
EmberLightVFX d5c4fb0
reorder substitutions for better clarity
EmberLightVFX 7411828
remove the import of button.yaml as it's not used.
EmberLightVFX f230ea8
Clean up comments
EmberLightVFX ac5220c
Add correct flash size and psram info for esp32 S3 super mini
EmberLightVFX 54570a9
Correct LED pins and name
EmberLightVFX 72c3180
Place encoder info in diagnostic category
EmberLightVFX 22dc30d
Correct external led name in web ui
EmberLightVFX edb0375
Increase rmt_symbols for external led to reduce flickering
EmberLightVFX 70b304f
Change ams icons for better match
EmberLightVFX 49730e0
Set cpu frequency lower to reduce power consumption
EmberLightVFX 2d40c85
Add LED Brightness slider to be able to set the LED brightness and co…
EmberLightVFX 0919402
Merge branch 'spuder:main' into AMS-with-rotary-selection
EmberLightVFX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| --- | ||
| preferences: | ||
| flash_write_interval: 3sec | ||
|
|
||
| substitutions: | ||
| name: openspool | ||
|
|
||
| esphome: | ||
| name: ${name} | ||
| name_add_mac_suffix: true | ||
| project: | ||
| name: spuder.openspool | ||
| version: ${version} | ||
| min_version: 2025.6.0 | ||
| platformio_options: | ||
| build_unflags: -std=gnu++11 | ||
| build_flags: | ||
| - -std=gnu++14 | ||
| - -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" | ||
| on_boot: | ||
| then: | ||
| #TODO: breahting blue studders a little bit | ||
| - light.turn_on: | ||
| id: neopixel_light | ||
| effect: Breathing Blue | ||
| - wait_until: | ||
| condition: | ||
| wifi.connected: | ||
| - delay: 100ms | ||
| - light.turn_on: | ||
| id: neopixel_light | ||
| effect: none | ||
| - delay: 100ms | ||
| - light.turn_on: | ||
| id: neopixel_light | ||
| effect: Rainbow | ||
| - delay: 1s | ||
| - light.turn_off: | ||
| id: neopixel_light | ||
| - delay: 500ms | ||
| - script.execute: select_led | ||
| - if: | ||
| condition: | ||
| lambda: |- | ||
| return !id(bambu_lan_access_code).state.empty() && | ||
| !id(bambu_ip_address).state.empty() && | ||
| !id(bambu_serial_number).state.empty(); | ||
| then: | ||
| - logger.log: | ||
| level: info | ||
| format: "Connecting to Bambu printer" | ||
| - mqtt.enable: | ||
| id: bambu_mqtt | ||
| else: | ||
| - logger.log: | ||
| level: info | ||
| format: "Missing Bambu Credentials, skipping mqtt connect" | ||
| - mqtt.disable: | ||
| id: bambu_mqtt | ||
| on_shutdown: | ||
| then: | ||
| - light.turn_off: | ||
| id: neopixel_light | ||
|
|
||
| esp32: | ||
| framework: | ||
| type: esp-idf | ||
| sdkconfig_options: | ||
| CONFIG_MBEDTLS_HKDF_C: y # Needed for bambu KDF | ||
| CONFIG_MBEDTLS_MD_C: y # Needed for bambu KDF | ||
|
|
||
| packages: | ||
| version: !include conf.d/version.yaml | ||
| uptime: !include conf.d/uptime.yaml | ||
| wifi: !include conf.d/wifi.yaml | ||
| web_server: !include conf.d/web_server.yaml | ||
| debug: !include conf.d/debug.yaml | ||
| # time: !include conf.d/time.yaml | ||
| mqtt_bambu_lan: !include conf.d/mqtt_bambu_lan.yaml | ||
| filament: !include conf.d/filament.yaml | ||
| bambu_printer: !include conf.d/bambu_printer.yaml | ||
| automation: !include conf.d/automation.yaml | ||
| led-external: !include conf.d/led-external.yaml | ||
| ota: !include conf.d/ota.yaml | ||
| #update: !include conf.d/update.yaml | ||
| api: !include conf.d/api.yaml | ||
| logger: !include conf.d/logger.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| globals: | ||
| - id: selected_slot | ||
| type: int | ||
| restore_value: true | ||
| initial_value: "0" | ||
|
|
||
| script: | ||
| - id: update_selected_slot | ||
| then: | ||
| - lambda: |- | ||
| if (id(ams_number).state == 0) { | ||
| id(selected_slot) = 0; | ||
| } else { | ||
| id(selected_slot) = (id(ams_number).state - 1) * 4 + id(slot_number).state; | ||
| } | ||
| - script.execute: select_led | ||
|
|
||
| number: | ||
| - platform: template | ||
| name: "Number of AMS units" | ||
| id: ams_units | ||
| optimistic: false | ||
| restore_value: true | ||
| icon: mdi:train-car-container | ||
| min_value: 0 | ||
| max_value: 4 | ||
| step: 1 | ||
| initial_value: 1 | ||
| set_action: | ||
| then: | ||
| - lambda: |- | ||
| if (id(bambu_model).state == "A1Mini" || id(bambu_model).state == "A1") { | ||
| ESP_LOGD("AMS Units", "A1Mini or A1 detected, setting AMS to 1"); | ||
| id(ams_units).publish_state(1); | ||
| } else { | ||
| ESP_LOGD("AMS Units", "AMS units: %d", (int)id(ams_units).state); | ||
| id(ams_units).publish_state(x); | ||
| } | ||
| ESP_LOGD("AMS", "Number of AMS units set: %d", (int)x); | ||
|
|
||
| if (x < id(ams_number).state) { | ||
| ESP_LOGD("AMS Units", "AMS is higher than current units size, forcing AMS to %d", (int)x); | ||
| id(ams_number).publish_state(x); | ||
| } | ||
| if (x == 0) { | ||
| ESP_LOGD("AMS Units", "AMS units is 0, forcing slot to 1"); | ||
| id(slot_number).publish_state(1); | ||
| } | ||
| - script.execute: update_selected_slot | ||
| web_server: | ||
| sorting_group_id: sorting_group_printer_settings | ||
| sorting_weight: 100 | ||
|
|
||
| - platform: template | ||
| name: "AMS Number" | ||
| id: ams_number | ||
| optimistic: false | ||
| restore_value: true | ||
| icon: mdi:train-car-container | ||
| min_value: 0 | ||
| max_value: 4 | ||
| step: 1 | ||
| initial_value: 1 | ||
| set_action: | ||
| then: | ||
| - lambda: |- | ||
| if (x > id(ams_units).state) { | ||
| ESP_LOGD("ams_number", "AMS number too high, setting to %d", (int)id(ams_units).state); | ||
| id(ams_number).publish_state(id(ams_units).state); | ||
| } else { | ||
| id(ams_number).publish_state(x); | ||
| } | ||
| ESP_LOGD("AMS", "AMS selected: %d", (int)x); | ||
|
|
||
| if (x == 0 && id(slot_number).state != 1) { | ||
| ESP_LOGD("AMS", "AMS is 0, forcing slot to 1"); | ||
| id(slot_number).publish_state(1); | ||
| } | ||
| - script.execute: update_selected_slot | ||
| web_server: | ||
| sorting_group_id: sorting_group_ams | ||
|
|
||
| - platform: template | ||
| name: "Slot Number" | ||
| id: slot_number | ||
| optimistic: false | ||
| restore_value: true | ||
| icon: mdi:record-circle-outline | ||
| min_value: 1 | ||
| max_value: 4 | ||
| step: 1 | ||
| initial_value: 1 | ||
| set_action: | ||
| then: | ||
| - lambda: |- | ||
| if (id(ams_number).state == 0) { | ||
| ESP_LOGD("slot_number", "AMS is 0, forcing slot to 1"); | ||
| id(slot_number).publish_state(1); | ||
| } else { | ||
| id(slot_number).publish_state(x); | ||
| } | ||
| ESP_LOGD("AMS", "Slot selected: %d", (int)x); | ||
| - script.execute: update_selected_slot | ||
| web_server: | ||
| sorting_group_id: sorting_group_ams | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.