RS 1.3.0 + Home Assistant Integration Bugs?

edited February 19 in Repetier-Server
Hello everyone.

I'm using RS 1.3.0 with an Home Assistant automation. And I maybe discovered 2 Bugs.

First, the ETA is not showing the correct time. It shows always the actual Time, not the Time when the print should be finished.

And second, my Server is running 24/7 and I only turn on or off the printer but the state of my printer is in Home Assistant always "ready" (sensor.blablabla_blabla_cond_text) or "on" (binary_sensor.blablabla_connected). Maybe these two sensors work only if the Server is shutdown?

Maybe these are no Bugs but just user mistakes?
Any suggestions?

Kind regards, Gurry.

Comments

  • ETA is a bug I already fixed for next update. The computed time remaining was converted to milliseconds so ETA is factor 1000 wrong, so nearly zero. You can fix it with own entity using this equation for value based on base state
    {{ ((value_json.time/1000)+value_json.printTime-value_json.printedTimeComp) | int | timestamp_custom(\"%d.%m.%Y %H:%M\") }}
    instead.

    Make sure time zone is set correctly in Home Assistant. Probably main reason I did not register time was zero on my tests.

    Regarding conditionText it is falsely returned Ready even if printer is offline. Will also be fixed in next release. The online variable in state/basics gets set 0 correctly, but the computation of the conditionText we added to make it easier to see human readable state did not check that case. Will also be fixed on next update.

  • Sounds good. I thought that I just did something wrong. :# thank you for your quick reply.
  • I just realized that the buttons (stop, pause, resume) doesn't work either.
  • The buttons should work, but you need to enable "Allow execution of incoming g-code" in MQTT settings, otherwise server does not accept commands via MQTT.
  • edited February 21
    Hmm... this option was activated all the time but yesterday it wasn't working... today it was after another test.  :#

    One more question: Is it possible to integrade "Temperature Set" for Bed and Extruder?
  • You can integrate anything available in MQTT including set temperature. For temperature set there are already predefined entities. Same entity name like temperature just instead of ..._ext_temp_0 you write ..._ext_temp_set0 to see set temperature.
  • Ok, couldn't find it, I will look again tonight. Thank you.
  • Repetier said:
    You can integrate anything available in MQTT including set temperature. For temperature set there are already predefined entities. Same entity name like temperature just instead of ..._ext_temp_0 you write ..._ext_temp_set0 to see set temperature.
    I looked now and I have definitley no "temp_set" entities. Try to figure out how to add them through MQTT but to be honest I'm completley new to all this stuff and google isn't a big help.  :#
  • Easiest is to just go to visual editor with our example and copy the temperature line and add the set where they differ and save and you should see it.
  • Is it possible to send you some pictures? Maybe through Telegram or WhatsApp? Because my mainproblem is still that the entities for temp set are missing.

    ETA
    ETE
    Job
    Job Thumbnail
    Layer
    Printing
    Printing Time
    Progress
    Status
    Z
    Bed 1 temperature
    Extruder 1 temperature
    Fan 1

    These are my sensor entities I have... in total it's 17 entities with the buttons and so, but it should be at least 19 if the temp set sensors were available. 
  • You can use e.g. imgur.com or dropbox/google drive to post links to images here.

    Where are you looking for the entities?
    What does your yml definition for the view now look like?

  • edited February 26
    Here are the pictures:

    https://i.imgur.com/Cv3JarG.jpg
    https://i.imgur.com/6XuxBVe.jpg
    https://i.imgur.com/fz4MksJ.jpg
    https://i.imgur.com/qvCtkrX.jpg

    And here the complete yml definition:

    type: vertical-stack
    title: *****
    cards:
      - type: conditional
        conditions:
          - entity: binary_sensor.********_connected
            state: 'off'
        card:
          type: markdown
          content: |
            ## Server is not running
      - type: conditional
        conditions:
          - entity: binary_sensor.********_connected
            state: 'on'
        card:
          type: custom:stack-in-card
          cards:
            - type: custom:stack-in-card
              mode: horizontal
              style: ha-card {background:none;border:0;box-shadow:none;}
              cards:
                - type: picture-entity
                  camera_view: auto
                  entity: camera.*****_camera
                  show_state: false
                  show_name: false
                  card_mod:
                    style:
                      hui-image$:
                        .: img {max-height:160px;object-fit:contain;}
                        ha-camera-stream$: img {max-height:160px;object-fit:contain;}
                      .: ha-card {background:none;border:0;box-shadow:none;}
                - type: picture-entity
                  camera_view: live
                  entity: camera.********_*****_job_thumbnail
                  show_state: false
                  show_name: false
                  card_mod:
                    style:
                      hui-image$:
                        .: img {max-height:160px;object-fit:contain;}
                        ha-camera-stream$: img {max-height:160px;object-fit:contain;}
                      .: ha-card {background:none;border:0;box-shadow:none;}
            - type: entity
              style: ha-card {background:none;border:0;box-shadow:none;}
              entity: sensor.********_*****_cond_text
              name: Status
              icon: mdi:cast-connected
            - type: glance
              style: ha-card {background:none;border:0;box-shadow:none;}
              entities:
                - entity: sensor.********_*****_ext_temp_1
                  name: Extr. Temp
                - entity: sensor.********_*****_ext_temp_set1
                  name: Extr. Temp Set
                - entity: sensor.********_*****_bed_temp_1
                  name: Bed Temp
                - entity: sensor.********_*****_bed_temp_set1
                  name: Bed Temp Set
                - entity: sensor.********_*****_fan_1
                  name: Fan
            - type: conditional
              conditions:
                - entity: binary_sensor.********_*****_printing
                  state: 'on'
              card:
                type: vertical-stack
                style: ha-card {background:none;border:0;box-shadow:none;}
                title: Running Print-Job
                cards:
                  - type: entities
                    style: |
                      ha-card {background:none;border:0;box-shadow:none;}
                    entities:
                      - entity: sensor.********_*****_job
                        name: Job
                      - type: custom:bar-card
                        height: 40px
                        entity_row: true
                        positions:
                          indicator: 'off'
                        entity: sensor.********_*****_progress
                        name: Progress
                      - entity: sensor.********_*****_eta
                        name: ETA
                      - entity: sensor.********_*****_ete
                        name: ETE
                      - entity: sensor.********_*****_print_time
                        name: Printing Time
                      - entity: sensor.********_*****_layer_progress
                        name: Layer
                      - entity: sensor.********_*****_z_progress
                        name: Z
                      - type: divider
                      - type: buttons
                        entities:
                          - entity: button.********_*****_pause
                            tap_action:
                              action: call-service
                              service: button.press
                              service_data:
                                entity_id: button.********_*****_pause
                          - entity: button.********_*****_continue
                            tap_action:
                              action: call-service
                              service: button.press
                              service_data:
                                entity_id: button.********_*****_continue
                          - entity: button.********_*****_stop
                            tap_action:
                              action: call-service
                              service: button.press
                              service_data:
                                entity_id: button.********_*****_stop
                              confirmation:
                                text: Are you sure you want to stop the print?


    Please tell me if you need something else.
  • Ok, I managed to get it running. Added the sensors in the sensor.yaml file. It was alot of try and error but now it is working. Thanks for your patience.
  • Good you got it running. I also solved it. The new json library did not exactly behave as I expected, so the set temp descriptions were missing some fields so home assistant ignored them. With next update they will also be present natively not requiring the manual definition.

    But it still good to know how to add manual entries. That way you add anything we currently do not offer or in a modified way.
  • edited February 26
    Was quite some work but for you it has to be a lot harder getting the code done correctly. Everyone who can write codes and creating software has my respect and appreciation. 

    For everyone who want to know how to add the states:
    Go to your File editor and open the Sensor.yaml file. Add these lines to it:

    - platform: mqtt
      device_class: temperature
      unique_id: ********-****-****-****-************-*****-ext_temp_set-1
      object_id: ********_*****_ext_temp_set_1
      name: ***** Extruder 1 temperature set
      icon: mdi:printer-3d-nozzle-outline
      unit_of_measurement: °C
      state_topic: *****-7945d59a-851a-4c84-b673-b81e99328cbd/state/*****/state
      value_template: '{{ value_json.extruder[0].tempSet }}'

    - platform: mqtt
      device_class: temperature
      unique_id: ********-****-****-****-************-*****-bed_temp_set-1
      object_id: ********_*****_bed_temp_set_1
      name: ***** Bed 1 temperature set
      icon: mdi:square-outline
      unit_of_measurement: °C
      state_topic: *****-7945d59a-851a-4c84-b673-b81e99328cbd/state/*****/state
      value_template: '{{ value_json.heatedBeds[0].tempSet }}'


    You can fix the ETA bug the same way by yourself:

    - platform: mqtt
      unique_id: ********-****-****-****-************-*****-eta
      object_id: ********_*****_eta
      name: *****  ETA
      icon: mdi:clock-end
      state_topic: *****-7945d59a-851a-4c84-b673-b81e99328cbd/state/*****/basics
      value_template: '{{ ((value_json.time/1000)+value_json.printTime-value_json.printedTimeComp) | int | timestamp_custom("%d.%m.%Y %H:%M") }}'


    Replace the "*" with your ID and Printer Name and you should be good to go.

    Kind regards, Gurry.
Sign In or Register to comment.