xZetsubou / ha-threedy-card

Home Assistant card to display 3D printer status and progress
15 stars 2 forks source link

Custom Sensors #7

Closed raddacle closed 1 year ago

raddacle commented 1 year ago

I'm trying to use sensors that come from the moonraker integration, and I can't seem to get the syntax to make them appear according to your doc. All it shows is the printer name with a red dot next to it.

How off am I?

type: custom:threedy-card base_entity: '' monitored: '' sensors: Filename: # return the print progress | 0 - 100 entity: sensor.ender_3_s1_plus_filename Progress: # return the print progress | 0 - 100 entity: sensor.ender_3_s1_plus_progress name: Ender 3 S1 Plus printer_type: I3

xZetsubou commented 1 year ago

Here is an example that I put in Readme. Copy it and paste in your card code. red dot means you didn't provide status entity.

assuming you are using moonraker-homeassistant I'll try to guess the configs for you. this just guessing but as you can see set the sensors in sensors object then order them from monitored object.

# Rather then specify 'base_entity' you can config each sensor.
type: 'custom:threedy-card'
base_entity: '' # You can use it if you want to override some of sensors and let some use base_etntity
name: 'Ender 3 S1 Plus'
printer_type: I3
monitored: # by the order you want.
  - Status
  - FileName
  - ETA
  - Elapsed
  - Remaining
  - Hotend
  - Bed
sensors:
  Progress: # return the print progress | 0 - 100
    entity: sensor.ender_3_s1_plus_progress 
  Status: # return the state of printer | ( printing, stopped etc.. ) 
    entity: sensor.ender_3_s1_current_print_state
  Elapsed: # return how much time have been since print starts - Require Status to be defined | number
    entity: sensor.ender_3_s1_print_duration
  Remaining: # return how much time left to finish print - Require Status to be defined | number
    entity: sensor.ender_3_s1_print_eta
  ETA: # return how much time left to finish print - Require Status to be defined | number
    entity: sensor.ender_3_s1_print_eta
  Hotend: # Return the temperature of hotend | number
    entity: sensor.ender_3_s1_extruder_temperature
  Bed: # Return the temperature of Bed | number
    entity: sensor.ender_3_s1_bed_temperature
  FileName:
    name: FileName
    entity: sensor.ender_3_s1_plus_filename

You should know that Progress, Elapsed, Remaining, ETA, Status, Hotend and Bed are the main sensors. This how to specify an additional sensors:

monitored: # you need to add it into monitored as well.
  - sensor_name
sensors:
 sensor_name:
    entity: # the sensor entity
    name: # the name if you want
    attribute: # if the value is in attribute into the entity.

more examples

raddacle commented 1 year ago

I appreciate your help. It now shows a yellow status color, but I still don't have any of the others. I can't seem to make any of the syntax from the examples work. Screenshot 2023-09-27 004907

xZetsubou commented 1 year ago

Click on the name ENDER 3 S1 Plus to expand the card by default the card will automatic expand it self if it's printing. Or use always Add this:

always_show: true
raddacle commented 1 year ago

Wow, I can't believe I missed that. Thanks!