Skip to content
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

[Bug] Current layer value changes automation not working #775

Open
Alvie opened this issue Nov 23, 2024 · 9 comments
Open

[Bug] Current layer value changes automation not working #775

Alvie opened this issue Nov 23, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@Alvie
Copy link

Alvie commented Nov 23, 2024

Home Assistant Version

2024.11.3

Bambu Lab Integration Version

v2.0.38

Describe the bug

On creating an automation for current layer change, I am receiving an error message saying "Message malformed: must contain at least one of below, above:
image

To Reproduce

  1. Create New Automation
  2. Choose your Bambu Lab Printer as a trigger device.
  3. Choose "Current layer value changes" for the when
  4. Choose any action (e.g. Send notification)
  5. Save

Expected Behaviour

I expect the automation to save. Ideally whenever the layer number goes up, it triggers an event, without needing an above / below value.
config_entry-bambu_lab-01JDBB762Y7GMWCJ8JKY843MP8.json

What device are you using?

A1 Mini

Diagnostic Output

[config_entry-bambu_lab-01JDBB762Y7GMWCJ8JKY843MP8.json](https://github.com/user-attachments/files/17878141/config_entry-bambu_lab-01JDBB762Y7GMWCJ8JKY843MP8.json)

Log Extracts

No response

Other Information

No response

@Alvie Alvie added the bug Something isn't working label Nov 23, 2024
@AdrianGarside
Copy link
Collaborator

Home assistant is telling you that the automation you are creating requires an above or below value to be configured. This is unrelated to this integration.

@AdrianGarside AdrianGarside closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@Alvie
Copy link
Author

Alvie commented Nov 25, 2024

Home assistant is telling you that the automation you are creating requires an above or below value to be configured. This is unrelated to this integration.

EDIT: I think I have now just realised these triggers are not at all from the integration, I am sorry about that. I don't know where they are from, but perhaps a layer change trigger will be available in the future?

EDIT 2: I just read the message on
#777 and that answers my question, I'll have to find another way to do this then, thanks!

#777 (comment)

It seems that it is expecting there to be a value for above / below for the "current layer change" but there is no input to set this.

For the print length distance change, the inputs do appear.

Screenshot_20241125-171311

Regardless, is there a way to trigger an event when the layer changes? I ask because I want to program the gcode to move the head out of the way (at the start of the layer), and eventually to get a different camera to take a snapshot so I can create a timelapse. Right now I just tried to get it to send a notification to my phone but I cannot even get it to do that.

Please let me know if this trigger is possible with this integration, thanks.

@AdrianGarside AdrianGarside reopened this Nov 25, 2024
@AdrianGarside
Copy link
Collaborator

The integration must be indirectly influencing how home assistant is categorizing the sensor type. I’ll take a look.

@Alvie
Copy link
Author

Alvie commented Nov 25, 2024

The integration must be indirectly influencing how home assistant is categorizing the sensor type. I’ll take a look.

Thanks, sorry if it's a bit different to what I initially posted but it'll be good if it's fixed. I hope that I haven't confused things.

@jowlo
Copy link

jowlo commented Dec 10, 2024

You can definitely do an automation triggered by layer change. I often forget to put a pause at the layers in which i want to insert hex nuts. You can't add a pause to the gcode after sending off the print, so i have an automation that pauses the print when the layer changes to the one i want to pause (before), and sends a notification to my phone.

This is the automation in yaml format, it has saved me a few times already :)

alias: 3d-printer:pause-at-layer
description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.a1mini_01020c010203f_current_layer
    # remove this and change the trigger to 'state' to trigger on every layer change
    above: 27
conditions: []
actions:
  - action: button.press
    metadata: {}
    data: {}
    target:
      entity_id: button.a1mini_01020c010203f_pause_printing
  - action: notify.mobile_app_my_phone
    metadata: {}
    data:
      message: Print paused
mode: single

@AdrianGarside
Copy link
Collaborator

But presumably you had to craft the automation in yaml since HA doesn't have the above file in the UI?

@jowlo
Copy link

jowlo commented Dec 10, 2024

But presumably you had to craft the automation in yaml since HA doesn't have the above file in the UI?

No, i created it using the UI, you can either select the entity directly in a trigger for a numeric state (what i did) or first select the device and then choose the Layer Change event. It's all in the UI.

image

image

I just pasted the yaml output here because you can copy-paste it better.

@AdrianGarside
Copy link
Collaborator

What version of home assistant / integration? I see the same as OP - no UI for above/below and an error when saving. I had to make a code change to set the unit type to a space character to get the UI to appear as it does for other measurement sensors.

@jowlo
Copy link

jowlo commented Dec 10, 2024

I am running HA 2024.11.2 and Bambulab Integration v2.0.38. However, it has been working for me for a long time, with older HA and integration versions.

I did have some connection problems with newer firmware versions with Bambu Studio, so I downgraded my A1 Mini firmware to the one it came with. It was two versions older than the current one, I don't know where to look it up (during a print). Is the firmware version relevant here?

Note: Added screenshots of the UI to the comment above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants