I opened my Lovelace and edited it. I paste this exactly into it and get the following when I hit save. Line 757 in the exception the âcardsâ line below. I have tried to mess with the spacing etc and no dice. Man I am missing something here, but made progress. I am a novice and I apologise.
Unable to parse YAML: YAMLException: bad indentation of a sequence entry at line 757, column 5: cards: ^
Youâll have to get familiar with YAML and its indentation. At this point the custom card is found but it cannot display it as the the YAML indentation in your Lovelace is wrong.
Try to put it under another card having thus the indentation of the garbage collection card aligned from indentation point of view with the other card.
Look at April 1 and follow our discussion. I believe if someone could capture this in a document it would help a lot of new users.
Also the more you practice, the more you will get the hang of it. Most people just cut and paste code they see and not understand how the format should look.
Good Luck.
Thank you both. I will read these docs. I am very aware that it needs to be correctly formatted and so I paid close attention, however it would appear that I have missed something.
OK so I totally get the importance of formatting and I have read over posts and I really appreciate your help so far guys! I have fiddled with the formatting as best I can and hope I have it right now. I took your advice Atticus and put in in another Lovelace UI. However:
I have taken a screen shot of part of the .yaml. below. This includes a little of the bit above. I am now getting this: Unable to parse YAML: YAMLException: duplicated mapping key at line 757, column -293: cards: ^
The resources donât belong where you put it. I have a sperate yaml file for all my custom cardâs resources. This is documented and Iâll try and send it to you shortly.
Just one other thing Bill. I installed all this following the instructions here
I used HACS. It installs under Lovelave UI resources the card. This is what I am finding so hard to understand. Most others stuff in HA I have got after a bit of Googling and fiddling.
So When I look under the resources tab you can see the what is below. I am finding it hard to understand why I need to add further resources when the.js appear to be already there. I have no idea how to edit or see it, but it is there.
You donât. When you install with HACS, the installation installs the resource in the correct location. I think you are confusing how to use the resource? Once I install different HACS stuff I honestly forget about them (until a system change causes you to move them , happened several months ago). It is not used in the Lovelace card. Are you not understanding how to make the card, how the integration works or something else. Once you have the integration installed there are many options on showing your garbage collection sensor. If you need, I can give you samples or search the forums. There are many examples.
Hi Bill. I just saw your response, thanks. I have installed via HACS the card and the integration. I am simply now trying to create a card to work in Lovelace. That is the whole issue.
Below is my lovelace card. When I try to create the card I get âCustom element doesnât exist: garbage-collection-cardâ
Happy to do this via PM and happy to buy you several coffees fort your time!
No coffee is needed. Iâll try and help you where I can. This is mine.
-
cards:
- entity: sensor.trash
icon_color: brown
icon_size: 35px
type: 'custom:garbage-collection-card'
- entity: sensor.yard_waste_2
icon_color: green
icon_size: 35px
type: 'custom:garbage-collection-card'
- entity: sensor.recycle
icon_color: blue
icon_size: 35px
type: 'custom:garbage-collection-card'
- entity: sensor.branches
icon_color: green
icon_size: 35px
type: 'custom:garbage-collection-card'
type: vertical-stack
I donât think you can stack custom:garbage-collection-card in custom garbage-collection-card?
My advice is try one item. When it works, then start with different types of stacks. I am using yaml mode, so my code may look a little different.
When I started with custom cardâs I got this a lot. Every âdoesnât existâ was always due to my formating errors in yaml. Not understanding how editing is done inside HA depending on where you were doing it was a big problem for me. When I learn about spiting my yaml file and using different loading tecniques forced me to learn how dictionaries and lists work. I stopped using the UI editor to be consistent. I use yaml mode so all of my cards look the same when I edit them. Do you have any other custom cards that work? If so copy the code using the raw editor in another editor (i.e notepad ++) and then copy this code and do a line by line comparison.
Thanks Bill. I thought I had already done this but i uninstalled, restarted HA and installed again and wait for it. IT WORKED!!!
I am fairly used to .yaml these days and realise the formatting is super important. I am however trying to move with the times and the way HA are pushing us I guess and that is the visual editor.
I want to thank you for your patience.
One other thing. What code do I have to add to make the colours change when its due, like tomorrow. Do you use this or just use the date?
Can anyone help me with an automation using this garbage collection sensor? Iâm trying to trigger an event (in this case an announcement) that uses the sensor states in the documentation (value 1 according to the documentation, is the âtomorrowâ state of the sensor), so that the event gets triggered the day before the garbage collection is due.
However, using State as a condition and using value 1 doesnât appear to work and I think it might be because of this condition not working as it should. Any ideas?
- id: '1576837842795'
alias: Refuse collection Alexa reminder announcement - Rubbish and garden waste
description: ''
trigger:
- at: '20:00'
platform: time
condition:
- condition: state
entity_id: sensor.rubbish_garden
state: '1'
action:
- data:
data:
type: tts
message: Remember to put out the rubbish and garden waste wheely bins and the
food waste tonight
service: notify.alexa_media_andy_and_alison