dwainscheeren / dwains-dashboard-addons

Dwains Dashboard Community Addons
118 stars 75 forks source link

Printer AddOn - yaml error #67

Closed GoTTi74 closed 3 years ago

GoTTi74 commented 3 years ago

While in "File editor" I'm getting the following syntax error: missed comma between flow collection entries at line 16, column 29: {{ (data | fromjson)['printer'] }} ^ and the printer add on doesn't load for the room configured in rooms.yaml

Any idea why I'm getting this?

GoTTi74 commented 3 years ago

strange... the past few days I could reload the dashboard calling the dwains_dashboard.reload service. Currently this doesn't seem to work (for me) and I have to restart HA.

Seems that I can ignore the syntax error and the printer add on loaded after restarting HA only.

Same happens if I change a room name in rooms.yaml. The new name only shows in the dashboard after HA restart not after calling "dwains_dashboard.reload"

Klumpke commented 3 years ago

Could you share your rooms.yaml code of the addon part?

GoTTi74 commented 3 years ago

Hi @Klumpke

Thank you for your support. It seems that my Dashboard doesn't reload properly after calling the "dwains_dashboard.reload" service. After I restarted HA, the Printer Add On is working now...

Anyway, this is the add on part in the rooms.yaml

    addons:
      - name: Printer
        icon: mdi:printer
        path: 'dwains-dashboard/addons/rooms/office/printer/page.yaml'
        button_path: 'dwains-dashboard/addons/rooms/office/printer/button.yaml'
        data:
          printer:
            - entity: sensor.hp_printer_status
              name: State
            - entity: sensor.hp_printer_printer
              name: Total printed pages
            - entity: sensor.hp_printer_scanner
              name: Total scanned pages
          cardridges:
            - entity: sensor.hp_printer_toner_black
              name: Black
              color: Black
            - entity: sensor.hp_printer_toner_cyan
              name: Cyan
              color: MediumTurquoise
            - entity: sensor.hp_printer_toner_magenta
              name: Magenta
              color: Magenta
            - entity: sensor.hp_printer_toner_yellow
              name: Yellow
              color: Gold

Still having the syntax error in the HA File editor but I guess it doesn't matter as it doesn't seem to affect the add on.

Klumpke commented 3 years ago

Your code looks oke. The syntax error in the file editor is nothing to worry about. The editor can't handle the variables and will show them as an error but they do work.

GoTTi74 commented 3 years ago

Hi @Klumpke Thank you so much for reviewing and the clarification of the limitations in the editor!