I just finished my dashboard for my Ender 3 and wanted to share the results.
The Ender 3 runs the latest Marlin Bugfix and is controlled via a Raspberry Pi 4 using Octoprint. In Octoprint I use the Filament Manager plugin to manage my spools. In addition, I operate at the moment 5 DHT22 sensors, one for the enclosure and 4 for my dryboxes.
All this information is collected via a python cronjob on the Octoprint Pi and send via MQTT to home assistant:
Please excuse the German titles in the screenshot.
9 Likes
Cool !
By the way, how can you reach so low humidity level in your filament box. Even with dessicant in à closed box I can’t get mine so low .
Nice intégration
I tried two solutions from thingiverse but ultimately was not satisfied how the roles performed and made my own design:
I used approx 150g of silica gel in each. As the IKEA boxes are only 10l large, humdity levels are stable between 10-20%. The numbers are also quite objective as the measurement takes place at the back. I’ll upload the design on thingiverse this weekend
1 Like
ThibautLM
(Thibaut Lm)
July 17, 2020, 8:15am
4
Nice !
How did you put multiple output per line in each entity ? like temp printing, status … Its really nice looking an simple.
Its the multiple entitiy row card. That card is really awesome, I use it in almost every view: https://github.com/benct/lovelace-multiple-entity-row
ThibautLM
(Thibaut Lm)
July 17, 2020, 12:30pm
6
thanks ! I’m definitely gonna use it !
Attached an even more compressed visualization for >4 dry boxes:
ui-lovelace.yaml
- title: ender3
icon: mdi:printer-3d-nozzle
path: ender3
cards:
- !include /config/ui-lovelace/cards/ender3/ender3-01.yaml
- !include /config/ui-lovelace/cards/ender3/ender3-02.yaml
ender3-01.yaml
type: vertical-stack
cards:
- type: markdown
style: !include /config/ui-lovelace/style/title.yaml
content: DRUCKER
- type: entities
style:
.: |
ha-card {
border: solid 1px var(--border-color);
font-family: Raleway;
}
"#states div:nth-child(9)":
"hui-sensor-entity-row":
$: |
.text-content::after{
content: '';
display: inline-block;
width: 34px;
height: 34px;
-moz-border-radius: 17px;
-webkit-border-radius: 17px;
border-radius: 17px;
background-color:
{% set updated = (as_timestamp(now()) - as_timestamp(states.sensor.octoprint.last_updated)) / 60 %}
{% set state = states.sensor.octoprint.state %}
{% if state == 'Printing' and updated < 5 %}
orange
{% elif state == 'Operational' and updated < 5 %}
green
{% else %}
red
{% endif %}
;
margin-left: 10px;
}
.text-content {
display: flex;
justify-content: center;
align-items: center;
}
entities:
- entity: sensor.octoprint_printer_hotend_actual
name: Düse
state_header: Ist
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_printer_hotend_target
unit: '°C'
name: 'Soll'
- entity: sensor.octoprint_printer_bed_actual
name: Heizbett
state_header: Ist
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_printer_bed_target
unit: '°C'
name: 'Soll'
- entity: sensor.octoprint_enclosure_temperature
name: Gehäuse
state_header: Temperatur
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_enclosure_humidity
unit: '%'
name: 'Luftfeuchtigkeit'
- entity: sensor.octoprint_job_state
name: Status
state_header: 'Status'
icon: mdi:bullseye-arrow
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_job_percent
name: Fortschritt
- entity: binary_sensor.ender3_power
name: Strom
- entity: sensor.octoprint_job_file
name: Datei
icon: mdi:file-outline
- entity: sensor.octoprint_job_completion
name: Zeit
icon: 'mdi:clock-outline'
state_header: 'Fertig'
secondary_info: last-changed
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_job_remaining
name: 'Verbleibend'
- entity: sensor.octoprint_job_elapsed
name: 'Verstrichen'
- type: picture-entity
style:
.: |
ha-card {
height: 330px;
}
entity: camera.ender_3
camera_view: live
show_state: false
show_name: false
ender3-02.yaml
type: vertical-stack
cards:
- type: markdown
style: !include /config/ui-lovelace/style/title.yaml
content: TROCKENBOXEN
- type: horizontal-stack
cards:
- type: entities
style:
.: |
ha-card {
border: solid 1px var(--border-color);
font-family: Raleway;
}
"#states div":
"multiple-entity-row":
$: |
state-badge {
display: none;
}
.info {
flex: 1 0 30px !important;
margin-left: -8px !important;
}
entities:
- entity: sensor.octoprint_filament1_temperature
name: Box 1
icon: false
state_header: 'Temperatur'
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_filament1_humidity
unit: '%'
name: 'Luftfeuchtigkeit'
- entity: sensor.octoprint_filament2_temperature
name: Box 2
state_header: 'Temperatur'
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_filament2_humidity
unit: '%'
name: 'Luftfeuchtigkeit'
- entity: sensor.octoprint_filament3_temperature
name: Box 3
state_header: 'Temperatur'
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_filament3_humidity
unit: '%'
name: 'Luftfeuchtigkeit'
- type: entities
style:
.: |
ha-card {
border: solid 1px var(--border-color);
font-family: Raleway;
}
"#states div":
"multiple-entity-row":
$: |
state-badge {
display: none;
}
.info {
flex: 1 0 30px !important;
margin-left: -8px !important;
}
entities:
- entity: sensor.octoprint_filament4_temperature
name: Box 4
state_header: 'Temperatur'
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_filament4_humidity
unit: '%'
name: 'Luftfeuchtigkeit'
- entity: sensor.octoprint_filament5_temperature
name: Box 5
state_header: 'Temperatur'
type: custom:multiple-entity-row
entities:
- entity: sensor.octoprint_filament5_humidity
unit: '%'
name: 'Luftfeuchtigkeit'
- type: markdown
style: !include /config/ui-lovelace/style/title.yaml
content: FILAMENT
- type: entities
style:
.: |
ha-card {
border: solid 1px var(--border-color);
font-family: Raleway;
}
entities:
- entity: sensor.octoprint
name: PLA
show_state: false
type: custom:multiple-entity-row
icon: mdi:printer-3d-nozzle-outline
entities:
- entity: sensor.octoprint_spools_pla_schwarz
name: 'Schwarz'
- entity: sensor.octoprint_spools_pla_weiss
name: 'Weiß'
- entity: sensor.octoprint
name: PETG
show_state: false
type: custom:multiple-entity-row
icon: mdi:printer-3d-nozzle-outline
entities:
- entity: sensor.octoprint_spools_petg_schwarz
name: 'Schwarz'
- entity: sensor.octoprint_spools_petg_weiss
name: 'Weiß'
- entity: sensor.octoprint_spools_petg_blau
name: 'Blau'
- entity: sensor.octoprint_spools_petg_braun
name: 'Braun'
- entity: sensor.octoprint
name: ABS
show_state: false
type: custom:multiple-entity-row
icon: mdi:printer-3d-nozzle-outline
entities:
- entity: sensor.octoprint_spools_abs_weiss
name: 'Weiß'
- entity: sensor.octoprint
name: ASA
show_state: false
type: custom:multiple-entity-row
icon: mdi:printer-3d-nozzle-outline
entities:
- entity: sensor.octoprint_spools_asa_schwarz
name: 'Schwarz'
- entity: sensor.octoprint
name: TPU
show_state: false
type: custom:multiple-entity-row
icon: mdi:printer-3d-nozzle-outline
entities:
- entity: sensor.octoprint_spools_tpu_blau
name: 'Blau'
- type: markdown
style: !include /config/ui-lovelace/style/title.yaml
content: STEUERUNG
- type: horizontal-stack
cards:
- type: custom:button-card
entity: input_boolean.show_poweroff
name: Strom
icon: mdi:power-plug
template: dash_button
- type: conditional
conditions:
- entity: input_boolean.show_poweroff
state: "on"
card:
type: vertical-stack
cards:
- type: custom:button-card
entity: switch.3ddrucker
name: Strom
template: dash_button
style: |
ha-card {
{% if is_state('binary_sensor.ender3_power', 'on') %}
background: repeating-linear-gradient(45deg,#db4437,#db4437 10px,#f74f40 10px,#f74f40 20px);
{% else %}
{% endif %}
}
I’m definitely interested in your solution; the design looks clean and I love the idea of integrating the sensors.
Did you use the IKEA 365+ air tight food storage container for this?
@DeltaNoir here ist the complete design and instruction including the fusion 360 file:
how did you installed the octoprint-mqtt-enclosure in octopi? by any chance can you add support for a bme280? thank you
@engpedroamorim It’s just a cronjob on the Pi. For bme you could add another adafruit library
dinth
(Michal)
December 28, 2020, 2:44pm
12
How are you measuring weight of the fillament?
Hi there
I know its an old thread, how did you get the remaining filament information from Filament manager in Octoprint via MQTT to Home Assistant?
I couldnt find much information in the forum nor the internet.
all the best
Andrew
1 Like
deadly667
(Deadly667)
June 28, 2023, 9:39pm
14
@lighthouse
As author didn’t respond I wrote small python script for that
SpoolManager Plugin is used on Octoprint side!
import sqlite3
import time
import paho.mqtt.client as mqttClient
def on_connect(client, userdata, flags, rc):
if rc == 0:
print("Connected to broker")
global Connected # Use global variable
Connected = True # Signal connection
else:
print("Connection failed")
Connected = False # global variable for the state of the connection
broker_address = "192.168.x.xxx"
port = 1883
user = "user"
password = "passs"
client = mqttClient.Client("Python-spools") # create new instance
client.username_pw_set(user, password=password) # set username and password
client.on_connect = on_connect # attach function to callback
client.connect(broker_address, port=port) # connect to broker
client.loop_start() # start the loop
while Connected != True: # Wait for connection
time.sleep(0.1)
# creating file path
dbfile = '/YOUR_PATH/.octoprint/data/SpoolManager/spoolmanager.db'
# Create a SQL connection to our SQLite database
con = sqlite3.connect(dbfile)
# creating cursor
cur = con.cursor()
# reading all table names
for a in cur.execute("SELECT material,colorName,remainingWeight FROM spo_spoolmodel"):
client.publish("spools/" + a[0] + "/" + a[1], a[2])
# Be sure to close the connection
con.close()
client.disconnect()
client.loop_stop()
You need to install paho_mqtt and fill for mqtt in script broker_address , user , password and dbfile location. I put that script as cronjob for every hour.
In HA under mqtt integration you need to add sensors for each spool you have
sensor:
- state_topic: "spools/PETG/black"
name: "Spools PETG black"
value_template: '{{value | round(0) }}'
unit_of_measurement: 'g'
In the end, result looks like this:
I know that script can be better but well if someone wants to make it better, please do and share it.
1 Like
thanks a lot, gonna give it a try! unfortunately my 3d-printer is getting clogged lately, first I have to fix that.
Hi Could you please share a model of the box?