Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional sensor prefix for home assistant entities #5

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dflvunoooooo
Copy link

I added an option to choose whether to add a prefix or not. One can choose between:
0, which is the default and will omit a prefix,
1 which will use the host name as prefix
or a custom string.

The prefix is only added to the home assistant entity names not the script internal names. I saw no need to add them there.

The only problem now is, that the config settings of this option is not used. It only works when enabled in the .sh file. I don't know why.

Added sensor prefix option and added prefix to sensor names published to home assistant.
Added option for sensor prefix
Forgot the actual function.
Confused files. No correct.
Changed if statement to use proper test syntax ("$STRING" = "STRING" not $STRING == "STRING").
Home Assistant warning about not allowed characters in discovery topic resulting in characters other than letters or _ in the SENSOR_PREFIX. Added sed to replace any character other than letter or _ with _ and remove double occurrences.
Letter, numbers and _ are kept of cause. Added conversion from upper to lower case in SENSOR_PREFIX function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant