home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.28k stars 30.6k forks source link

Google maps travel time change entity ID when server restarts #2094

Closed emilhetty closed 7 years ago

emilhetty commented 8 years ago

I have defined 5 sensors with different travel times and given them name in customize, but when my server is restarted the name does not match the entity ID anymore

balloob commented 8 years ago

Need more info.

emilhetty commented 8 years ago

Okay, here is some more information. This is the config of a couple of sensors I added to test with in additional to the five I already had(don't want to share my addresses with you): sensor 39: platform: google_travel_time api_key: Key removed origin: Oslo, Norway destination: Kongsberg, Norway travel_mode: driving # can be ["driving", "walking", "bicycling", "transit"]

sensor 40: platform: google_travel_time api_key: Key removed origin: Drammen, Norway destination: Oslo, Norway travel_mode: driving # can be ["driving", "walking", "bicycling", "transit"] First restart after I added the two new sensors only one of them came with the right entity id(sensor.google_travel_time_6), the second one should have been sensor.google_travel_time_7 but instead took the place of one of the other I already had. Since sensor.google_travel_time_6 came out let my show you it, this is how it looks: image

And this is how it looks like after second restart after no change in the config: image

As you can see it changes the which sensor it is showing, the other 6 sensors I have is also the same, each time I restart the server the entity id have a different sensor than before restart. It is like the entity id is randomly picked for the sensors.

Danielhiversen commented 8 years ago

Can you try the newest version of hass? There is a new way of configuration: https://home-assistant.io/components/sensor.google_travel_time/

emilhetty commented 8 years ago

I gave all the sensors a name according to the new configurations and now they seems to stick to their entity id after restart. I will try to have a couple without a name to verify that is works as it should. Will come back with the result.

One more thing, the travel time have not been updated in 11 hours now and according to the configurations the time should be updated every 5 minutes.

emilhetty commented 8 years ago

Have had a couple of sensors for some days now and done several restarts without the issue anymore. Seems to be fixed

emilhetty commented 8 years ago

I was wrong, it is still changing the entity id for sensor without a name defined: image

image

arsaboo commented 8 years ago

I am using it with a name and it is working well for me. The name also helps identify which sensor it is, in case you are using multiple sensors.

infamy commented 8 years ago

@emilhetty are you still seeing this? and can you include your relevant config section minus api key.

emilhetty commented 8 years ago

@infamy do you mean seeing this thread or in my HA? Don't have my config available right now, but it is similar to the one described in the component. Just don't have any name on it.

@arsaboo As I wrote in my last comment it is not working without any name, with name they are working fine for me as well. The component says the following: name (Optional): A name to display on the sensor. The default is “Google Travel Time - " where transit mode is the mode set in options for the sensor (if no mode is set, the default is driving). Since it says "Optional" it should work as supposed to work without any name, or the component has to be changed to indicate that name is required.

k5map commented 8 years ago

I have 2 sensors setup with names and they are working as @emilhetty has stated... my problem is when I go to customize the 2 sensors, the frontend does not start. Can someone post an example of their sensor and how you've customized its icon?

andrey-git commented 7 years ago

Is this still broken?

dale3h commented 7 years ago

Closing this issue since supplying a name to the platform provides expected behavior.