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

Add current layer and total layer metrics #56

Open
JumpMaster opened this issue Dec 31, 2020 · 6 comments
Open

Add current layer and total layer metrics #56

JumpMaster opened this issue Dec 31, 2020 · 6 comments
Labels

Comments

@JumpMaster
Copy link

Hi,

Great plugin and I am having no issues with it! I would like to be able to see the current and total layers. It would be useful to be able to create an alert in HA before a scheduled filament change for example.

Thanks for your great work!
Kev

@cmroche
Copy link
Owner

cmroche commented Jan 22, 2021

It's an interesting idea. I'll have to check if the info is something I can pull form Octoprint though. Probably in a few weeks as I am a bit busy at the moment.

Thanks for the suggestion.

@cmroche cmroche added the enhancement New feature or request label Jan 22, 2021
@charredchar
Copy link

charredchar commented Jan 29, 2021

I've been attempting to make a version of this myself with what is in Home Assistant and OctoPrint MQTT by default ... and it has not been easy. OP MQTT will report the current and total layers via DisplayCurrentLayer plugin if installed, I've been able to use it to notify me on layer number. It should be doable.

@cmroche
Copy link
Owner

cmroche commented Jan 29, 2021

If the data is already present, then it only requires discovery topics to create the correct sensors.

@cmroche
Copy link
Owner

cmroche commented Mar 16, 2021

@charredchar Would you be willing to submit an MR with the feature?

@edekeijzer
Copy link
Contributor

I've been attempting to make a version of this myself with what is in Home Assistant and OctoPrint MQTT by default ... and it has not been easy. OP MQTT will report the current and total layers via DisplayCurrentLayer plugin if installed, I've been able to use it to notify me on layer number. It should be doable.

Can you provide a link to the specific plugin? I've looked and found nothing with that exact name. The LayerDisplay and DisplayLayerProgress plugins both do not do anything MQTT related.

@charredchar
Copy link

It was actually something I did completely within Home Assistant.

image

configuration.yaml

sensor:
  - platform: mqtt
    name: "OctoPrint DispalyLayer"
    state_topic: "octoPrint/event/DisplayLayerProgress_layerChanged"
    value_template: "{{ value_json.currentLayer }}"

  - platform: mqtt
    name: "OctoPrint TotalLayers"
    state_topic: "octoPrint/event/DisplayLayerProgress_layerChanged"
    value_template: "{{ value_json.totalLayer }}"

  - platform: template
    sensors:
        octoprint_layers:
            friendly_name: "OctoPrint Layers"
            value_template: "{{  states( 'sensor.octoprint_dispalylayer') ~ ' of ' ~ states( 'sensor.octoprint_totallayers') }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants