I am trying to input dynamic value to origin attribute of Waze Trave Time with no success…
Tried lot’s of variations with ’ / " / {{ }} etc.
Tried playing with lot lat from device tracker / with the interpreted address produce using google travel time component (I tried taking the origin_addresses attribute from the google component and stick it in the waze component…
None seem to work - the component only seems to accept static address text (even if parsed exactly as the google travel attribute returns them) or lon,lat as static text…
is this an issue with the component or am I missing something ?
So I guess you are correct @petro
however - my trying to play around with the code was unsuccessful due to my limited python skills…
seems like it’s only doing static routing until someone can augment the existing waze code with the relevant parts from google_time_travel component or something like that.
Yes, you’d also need this func in there, granted some changes would be needed:
def _get_location_from_entity(self, entity_id):
"""Get the location from the entity state or attributes."""
entity = self._hass.states.get(entity_id)
if entity is None:
_LOGGER.error("Unable to find entity %s", entity_id)
self.valid_api_connection = False
return None
# Check if the entity has location attributes
if location.has_location(entity):
return self._get_location_from_attributes(entity)
# Check if device is in a zone
zone_entity = self._hass.states.get("zone.%s" % entity.state)
if location.has_location(zone_entity):
_LOGGER.debug(
"%s is in %s, getting zone location",
entity_id, zone_entity.entity_id
)
return self._get_location_from_attributes(zone_entity)
# If zone was not found in state then use the state as the location
if entity_id.startswith("sensor."):
return entity.state
# When everything fails just return nothing
return None