custom-components / weatheralerts

A sensor that gives you weather alerts from alerts.weather.gov.
MIT License
127 stars 15 forks source link

Custom name support for sensor entities #32

Closed raetha closed 4 years ago

raetha commented 4 years ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like I would like a way to supply the name for each sensor created. Currently they become "sensor.county". Depending on the name of the county that could be fairly generic. Ultimately I personally would like "sensor.weather_alerts_county", however others may want to name them other things, so the most flexible option would be for an optional argument to supply the name.

Describe alternatives you've considered I'm considering modifying the code myself, but I'm not really a strong developer and thought it worth seeing if this might be something easy to do in the source rather than me doing a one time hack.

Additional context Nothing specific.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jlverhagen commented 4 years ago

I may consider adding this to a config flow in a future update of weatheralerts, to allow specifying the geographical name of the alerts sensor (i.e. specify a city name instead of county). In the meantime, it's probably just as easy to make this change using the Entities editor in the Home Assistant Configuration UI. Go to your Home Assistant web UI >> Configuration >> Entities and then click on the row (not the checkbox on that row) that contains your main weatheralerts sensor. A popup box will appear and allow you to change the name and entity ID of the sensor. And, unlike yaml config changes, no Home Assistant restart required if you use the built-in Entities editor.

raetha commented 4 years ago

Appreciate the idea on just doing a rename through the UI. I've done that before with a couple things, but didn't even think of it here for some reason. Right now though, I am generally avoiding manual entity renames as I'm still building out a lot of the infrastructure and capabilities, so it's been more than once that I've had to nuke integrations, databases, or the main HA .storage folder. In those cases I'm relying on the YAML or UI integration to bring stuff back. And anywhere I don't have to rename things again is much more convenient.

So I'll probably go that route once things stabilize in a few months if there isn't an alternate option by then.

If you do end up adding something by then, or anytime in the future. I'm really looking to have the integration type in the name. I don't mind the use of the zone, county, city, etc. I just want it to start with something like "sensor.weatheralerts_<<county/city>>". Makes it easier to search for and obvious what integration created it.

Thanks for getting back to me and reminding me of an option I can do today!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.