Extra keys error

You’re right in that grep -r device: *.yaml won’t recurse. This is what I would usually do:

grep -r --include='*.yaml' device: .

Not sure why I didn’t say that here. :slight_smile:

FWIW, this:

grep -r device: . *.yaml

Will search all files that end in ‘.yaml’ in the working directory, and then all files in subdirectories.

EDIT: In fact, I even have an alias defined for it:

alias grepyaml='grep -r --include="*.yaml"'

:slight_smile:

1 Like

True true, however it seems like --include doesn’t work on the version included with HassIO

Result (it's long)
➜  /config git:(master) ✗ grep -r --include='*.yaml' device: .
grep: unrecognized option: include=*.yaml
BusyBox v1.28.4 (2018-12-06 15:13:21 UTC) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

Search for PATTERN in FILEs (or stdin)

        -H      Add 'filename:' prefix
        -h      Do not add 'filename:' prefix
        -n      Add 'line_no:' prefix
        -l      Show only names of files that match
        -L      Show only names of files that don't match
        -c      Show only count of matching lines
        -o      Show only the matching part of line
        -q      Quiet. Return 0 if PATTERN is found, 1 otherwise
        -v      Select non-matching lines
        -s      Suppress open and read errors
        -r      Recurse
        -i      Ignore case
        -w      Match whole words only
        -x      Match whole lines only
        -F      PATTERN is a literal (not regexp)
        -E      PATTERN is an extended regexp
        -m N    Match up to N times per file
        -A N    Print N lines of trailing context
        -B N    Print N lines of leading context
        -C N    Same as '-A N -B N'
        -e PTRN Pattern to match
        -f FILE Read pattern from file

Wow, yet another reason not to use hassio.

1 Like

Well that’s just uncalled for :stuck_out_tongue:

1 Like

Just kidding. (Well, …) Actually I’m sure there must be good reasons for it, but I’ve never gone down that path, and I’m happy I never did. I guess you don’t miss what you don’t know, and I’ve just seen it make it hard to do simple things.

Maybe after version 1.0 is released…

I ended up clearing my MQTT persistence DB. Did the trick. HA should make the error clearer, though. I spent a fair amount of time trying to figure it out by trial and error. Especially if it’s some sort of thing that will break things later.

Here’s script I found somewhere that worked beautifully.

#!/bin/sh
echo "cleaning " $1 " :: usage: cleanmqtt "
mosquitto_sub -h $1 -t “#” -v | while read line; do mosquitto_pub -h $1 -t “${line% *}” -r -n; done

1 Like

I ran the script but i get the following:

pi@hassbian:/home/homeassistant/.homeassistant$ ./cleanerror.sh
cleaning   :: usage: cleanmqtt 
Error: Unknown option '“#”'.

Use 'mosquitto_sub --help' to see usage.

That’s probably because the lines weren’t properly formatted in the post. I don’t use mqtt, but I would assume this (just fixing the double-quote characters):

#!/bin/sh
echo "cleaning " $1 " :: usage: cleanmqtt "
mosquitto_sub -h $1 -t "#" -v | while read line; do mosquitto_pub -h $1 -t "${line% *}" -r -n; done

Sorry, no way… same result.

Ok. Like I said, I don’t use mqtt so wasn’t sure. Maybe @InstigatorX can chime in.

@maurizio53 Edit: Missed the fist message. You have to put your HA IP address on the command line. i.e. “./cleanmqtt.sh localhost” assuming you called the script “cleanmqtt.sh”.

Also, try stopping HA and removing old entries from .storage/core.entity_registry. I did have a few old locks in there that I removed as well.

Ok, but how to know which are the old entries into storage/core.entity_registry?

About the script i tried this:

pi@hassbian:/home/homeassistant/.homeassistant$ ./cleanerror.sh 192.168.x.xx
cleaning  192.168.x.xx  :: usage: cleanmqtt 
Connection Refused: not authorised.

Tried also as sudo but with the same result.

Actually all you need is this line

mosquitto_sub -h hostname -t "#" -v | while read line; do mosquitto_pub -h hostname -t "${line% *}" -r -n; done

If you are getting

Connection Refused: not authorised

then obviously you need to give the uername and password to mosquitto_sub and mosquitto_pub, so the commandline will look like this:

 mosquitto_sub -h hostname -u username -P password -t "#" -v | while read line; do mosquitto_pub -h hostname -u username -P password -t "${line% *}" -r -n; done

@nickrout I have setup mqtt discovery and dafang picks it up and communicates with my HA i.e. without the need to have the mqtt component setup in my configuration.yaml.

I am running everything in docker including mqtt and HA.

How do I resolve this issue?:

WARNING (MainThread) [homeassistant.helpers.config_validation] Your configuration contains extra keys that the platform does not support.
Please remove [device].

I also have a similar one to the above and its for icon.

WARNING (MainThread) [homeassistant.helpers.config_validation] Your configuration contains extra keys that the platform does not support.
Please remove [icon].

Any idea how to resolve these?

Don’t know yet, I haven’t tracked down the problem. Fortunately it doesn’t break anything yet!

1 Like

Update your camera with the latest version of Dafang Hacks. This has solved the problem for me!

2 Likes

Yes I see there was a commit to dafang-hacks two days ago. Cheers.

Ok i did it and this is what i get in the terminal:

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid publish topic 'G0JUZAYkWAcLdlNNCSAsM1QGX38+RG8XAgBMAB4qV05WTiNOGhoxBDNFIS0zWA5CJgMfWlcfOksb', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'ESgoUU5+PiRFCA0/AAENEDEzUBpfMBJJCQlEUAlFQX0JBTNRaAVFTCQbCgwqMCJfC042PQZCTAU6', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'BSRNEB4rY0l4BDFaS1R2XE1GbREGfDt+CyVLYFEWC1ESHidRU35BHVgdBzsHTzkqLDReGgl/BApf', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'SxRJGhMSKlVPaw0PRB0PJh0wGSowMVgLTjY9GEpLBQBVKwQwUU9+FCAVUxomHApGbTEiXwxpJBYf', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'Dh8aFAFRACgwVUV+PiBeChohGwo1JiwzVBpdJA5JCRpHVRpYVTRCWGwEIlIHDTEaMB4uKSJuGEIm', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'CScdMVAEXiA+SQlkUzkaWCtmXVx+AjhoHRckDDNIdXJrbUpYLQ0cfVcFDF4dFCVEVGUPDBVTGiYc', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'CkYTYCleHEIjCwhSTBgKVicYMV5ZVkNqa0sNOwcbDyE2fW00d2o+N28XAgBMAB4qV05WPQwYGhcn', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'RAxCCEsDCzw2EVAEXiA+SQlkUzkaWCtmXFx5FQVHDQ8gDDNIdXNyBV4TclJdBgpCVQpYK2ZZTk8P', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'FChVN1FEVkNqUQgCJwwSRhNgdW1KET4+SVpcLUcCRlsYElNrDDVrS1QISxweLjYyQjQJaT5JWksi', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'NAkjCwdWaBARUChVfmwfVkN8a0sYOwAMDwwtKlwJRSE+SQlkUzkaWCtmQFxzDT9WDSgmBgI8ICsk', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'CEtVWH5uGxMERCsFAkdNFQBkVk11AxM+UmABXldgRTNIIyMzWBxeIQc3EQJFVxZEQ3MCCDxUfGtL', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'WxUDLV9TVQA+UxsBPQ1NUDswMlRECSAMClFUFCNxOjNmCltrDSNSRUwnDAEOCDI0fQdIJBYCXFZT', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'SgcASisHK0JJKFtyBlFWZ0tDSDktLlINaCoPBlJWFTFsJ1V+VlxmEjUbSws5HAMLOycIRgZfNwMI', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid input. Does your topic contain '+' or '#'?

Error: Invalid publish topic 'Xl0tRwIoVQBVS2MCNRcgADIGM0hjHmVYG3g8ER9WVS1HAhIWKENYJj1yWwgdID8OBjonGxNSd2c+', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'HkopFw5vGks5GihVaGwfZwAkVAExIBAfDxNgfQFEd2cRA1xPPwpMHREtU1x+CD9ZNUxuHR0fKm4b', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'NiZYBk4hPkkJXhAJSxFbGBJNaxg8WAgKCEtVNm0eZR00CSMLB1ZoEBFQKFV+bB9WQ3xrSxg7AAwP', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'CQsjMSIdNAkpAxhHbhAJTRErZgphKD1yGzVMOAgcHhoyI1AcThlAUQINQlUMQUB3AQ0+V2gbNUw9', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'Dj5+CgE6NU1QE2AbE0R3ZwsYYV0FBFEaEiBsHzAHMVsaC3g1TRouOyteCU8ZQFFvGi1HFChVIllR', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'azs5GBIHfhMlUkUydiM8JQEJIkg0CX8+SW8aXTkaGRYwU1VVFzFbHAsIS1U2bR5lHTQJKAMfUFAu', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'LUdbGxkwVVN+WwxrNUEINTNFPCczRQFFIhE3b2ReFkEHAyFdYVY9f1kGGj0PBgkuNi5eBnQ2DR5d', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'XFkVORpOK2ZsHyY9clEAAjE5Dh4nHmULNAkZQEdvGgcKURcSB19QZwA+UzVMbjVNNm1uGxMYSjwO', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'fFBFAg5JSwlaRX0SESgMIUMdMScMHRwqMBhEG043QFERUB4IXRUEN1lOfgA+Q0tCdgUOGTsAMlgE', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'VwlHNgdHEV8BFnUdGS1dSGclOUQdDzoKCkh1YHYBSgdnEQ5dXDYVSzgYJ1FJYw4+FVMaJhwKRm0n', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'KVAKRyAhCl5dAwQaTgM2RVgmQyNSGxg9Cgo1IyM0RTdfNwMIWFEfAmcHAyVCSX8Rcg1YW2FZVlJ+', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'eQQ+UzYdORowBCA2LlcBSCQWAlxWLgRWEAUrWVkoWyRFHAt4SwIbOzYYQg1ZMwcZbEgQFksDGDZU', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'SU5+BD1rRg84CB0HECMrVBpfZ05JQ0oUA10GEipTWHk+OFIIHCALCgs7YH1XCUc2B0cRVRAVSysV', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid publish topic 'AFkGAyZVXH4+OVkdCyYfDgZteGUIWAlpQBhEUQUGUCAWL1VtYwIkQhsLJ0tVDC4uNFRECTUQDlVd', does it contain '+' or '#'?

Use 'mosquitto_pub --help' to see usage.

Error: Invalid input. Does your topic contain '+' or '#'?

What does it means?

I had also this about icon… i removed the icon option and that issue was fixed.

hi @maurizio53 where did you remove the icon option from?