gcobb321 / icloud3_v3

iCloud3 v3, Development Version - This Repo/Version is used for development and testing of new and updated features. It is not the official release of iCloud3 v3, .
MIT License
169 stars 13 forks source link

iCloud3 v3.0 Event Log creation #287

Closed sfguy83 closed 3 months ago

sfguy83 commented 8 months ago

Hi. I’m running into a error when saving the yaml code shared in the setup.

Error: Unable to parse YAML: YAMLException: bad indentation of a mapping entry (26:9) 23 | name: TravTime 24 | - entity: sensor.gary_ipho ... 25 | name: NextUpdt 26 | - type: glance --------------^ 27 | columns: 5 28 | entities:

Error is a result of following Step 5.2 - #3 on this New Installation guide https://gcobb321.github.io/icloud3_v3_docs/#/chapters/3.2-installing-and-configuring

I get the same error if I paste the code as is into the HA dashboard or edit the code to include my device name. There's an issue with the code.

Thanks!

gcobb321 commented 8 months ago

Yaml is very unforgiving about spaces and integrations of each line. Add or remove the spaces on those lines until it works. Or delete the code for that entity and add it back using the gui. I’ll check it out and see what I find.

gcobb321 commented 8 months ago

The sample dashboard yaml code format error has been corrected

cyberchan commented 6 months ago

I’m also having this issue, with or without changing code to match my devices. I’m confused on what @gcobb321 meant about spacing. Could I get some help with that?

gcobb321 commented 6 months ago

As I said, YAML is very strict about the number of spaces before a text value. The example in the documentation had the wrong number of spaces before the text and an error message was being displayed that one of the lines could not be processed.

The example in the documentation was corrected.

Google YAML parsing for more information about YAML errors

sfguy83 commented 6 months ago

Unfortunately, the sample code wasn’t fixed. Or maybe the formatting changes in GitHub. For others, the correct code is below. Also note the name Gary and Lillian are both used and need to be updated. The site I used to fix the code is https://codebeautify.org/yaml-parser-online. Unfortunately, I found most other YAML parser websites confusing.

title: iCloud3
views:
 - title: iCloud3
   cards:
     - square: false
       columns: 1
       type: grid
       cards:
         - type: glance
           state_color: true
           show_name: true
           show_icon: true
           show_state: true
           columns: 5
           entities:
             - entity: device_tracker.gary_iphone
               name: Gary
             - entity: sensor.gary_iphone_arrival_time
               name: Arrive
             - entity: sensor.gary_iphone_zone_distance
               name: Distance
             - entity: sensor.gary_iphone_travel_time
               name: TravTime
             - entity: sensor.gary_iphone_next_update
               name: NextUpdt
         - type: glance
           columns: 5
           entities:
            - entity: sensor.gary_iphone_battery
              name: Battery
            - entity: sensor.gary_iphone_interval
              name: Interval
            - entity: sensor.gary_iphone_moved_distance
              name: Moved
            - entity: sensor.gary_iphone_last_located
              name: Located
            - entity: sensor.gary_iphone_last_update
              name: LastUpdt
         - type: entities
           entities:
             - entity: sensor.gary_iphone_info
               name: Info - Lillian
               icon: mdi:information-outline

     - type: grid
       square: false
       columns: 1
       cards:
         - type: custom:icloud3-event-log-card

Edit: I put this in a code block so the formatting characters are not displayed as GitHub Markdown dots. @gcobb321

gcobb321 commented 6 months ago

I have updated the code in the iCloud3 documentation to the corrected yaml code and it now checks out as valid. For some reason, I would copy it from Lovelace into the documentation, everything would look fine but an extra space was being inserted between my docs, GitHub and the program that I am using for the manual display.

Thanks for bringing it back to my attention.