I did try to look for the changelog but admit that I couldn’t find it but did see a very similar question posted here after I hit send on mine and so think a solution may be in ‘allow_other_uses: true’ and I’m trying that now (thanks).
I get on validation: (were row 88 is the allow_other_uses line in question):
“mapping values are not allowed in this context
in “”, line 88, column 22”
I’ve tried it on the first re to P4, both, without the ‘true’ …
I have the same issue but not sure how to proceed and what this means for me:
Pin Reuse validation¶
There is a new validation performed on configurations to ensure that pins are not reused unintentionally. This is a common source of issues and generally a pin does not need to be reused across multiple components in a single configuration. The error can be bypassed by specifically adding another config item to all of the duplicate pin definitions. See the Pin Schema for details.
I use pin 17 2 times…
INFO ESPHome 2023.12.1
INFO Reading configuration /config/esphome/sprinklerrelais4x.yaml…
Failed config
That didn’t work for me so I just edited out the switch function that toggles the backlight on and off and to my surprise / pleasure, it works (and removed the need to try to get the override to work).
I had to tinker with this for a bit also. I think what your problem is, you needed to set the pin number(GPIO4) on a different line, then add the allow_other_uses after that line. Try doing this, of course you have to add this to the to pin GPIO04
Nick, you seem upset / frustrated that not everyone finds all this as easy as you seem to?
Imagine looking at a block of code or even the information on pin-schema and effectively seeing hieroglyphics?
Imagine having dyslexia or dyscalculia but really wanting to play with this stuff and just not always seeing stuff as easily as others do?
Should those of us who have to live with such things not ask in help forums for help and support and if / when we do, would it be reasonable that we be given help / support that actually helps, rather than just sends us down other rabbit holes?
Maybe it’s because I spent most of my career in ‘IT Support’ and know what it’s like to have the answers and to really be able to help others with my experience. Personally I relished that position / opportunity and learned help was only really help if it helped (the person asking for help).
In the end I helped myself (because I couldn’t make sense of the help) by removing the pin duplication as it wasn’t a function I was using anyway (backlight on/off) and just happened to be part of the code I used as it was offered by another person wiling to share.
I guess I probably assumed that someone who was already programming in esphome would be able to follow the docs, as you have to have a certain understanding of the docs to start with.
Well, that’s probably not a completely bogus assumption, please be aware that many of us are able to handle the tech (especially as it all becomes more ‘Auto-magic’) but might only copy-paste existing code, rather than create any from scratch, or be able to just read say a manual on ‘How to be a brain surgeon’ and become one overnight.
I think I can state that in my years using HA, right now, today I’m very little better doing the coding than I was at the beginning. What I have maybe picked up is the ‘steps’ involved in getting to my goal (a functional solution), how to check for a ‘good’ project to copy and how to Google to a solution.
There is little point me actively trying to learn how to code because:
If I couldn’t pick it up when I was 15 I’m not likely to be able to at 65.
Because I’m not coding regularly, I am unlikely to be able to keep up or remember, especially given my current obligations.
I would rather pay someone to do that side while I enjoy doing the bits I do like (basically everything else).
Re ‘the docs’ … I’ve never been a big reader … I mean I can, it’s just not what I enjoy, I’d rather explore something (and why the GUI was invented) and one of the things that has attracted me to HA is how intuitive it has been (considering).
As I mentioned, I’d much rather watch the Youtube ‘Launch Parties’ with the guys, see if something is of interest and take it from there.
‘Different strokes for different folks’ as they say.
Yeah, like others, this kind of snuck up on me. Very quickly checked the documentation, tried to add the line to ignore the duplication and it wouldn’t pass validation in HA, so I’ve put it off for the time being.
Of note, the documentation page for the display I’m using is still using an example config that duplicates GPIO pins, so someone who knows this stuff better than I might want to update it lest it cause issues for the next guy.
I’ll figure it out eventually since I’ve figured out my issues in the past, but I wanted to chime in.
Edit: Okay, figured it out, but I’ve seen more than a few devs say that reusing GPIO pins is bad practice and honestly don’t know where to start with the st7789v since even the documentation is instructing me to reuse the pin. It’s compiling and working, so I guess I’ll just leave it be for the time being.
Does it? I can’t see that. Would you please tell me exactly where that is? ST7789V TFT LCD — ESPHome
What the docs for Pin Schema say is that there may be cases where pin sharing is needed, and it allows for that
allow_other_uses (Optional, boolean): If the pin is also specified elsewhere in the configuration. By default multiple uses of the same pin will be flagged as an error. This option will suppress the error and is intended for rare cases where a pin is shared between multiple components. Defaults to false.