I’m trying to write an automation to calculate the distance when the distance changes.
I have the distance integration which is fine, and I know its not 100% accurate, and thats fine, I just need a rough guide.
However, on the tile tracker, it is the attribute that changes, not the state, so running into an error with my automation.
Here it is:
Error while processing state change for device_tracker.car
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 288, in _async_state_change_dispatcher
hass.async_run_hass_job(job, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 574, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/components/homeassistant/triggers/state.py", line 143, in state_automation_listener
old_value = from_s.attributes.get(attribute)
TypeError: unhashable type: 'NodeListClass'
Are you sure that using a list of attributes is supported in state triggers? There are no examples of that in the docs… it also seems gratuitous, what is the likelihood that the GPS is reliable enough, accurate enough, and you travel in exactly a cardinal direction? Try it with just one attribute.
The docs say you can provide a longitude, latitude and then an entity with those attributes.
I’m not looking hugely reliable, and I know its straight-line, but just looking to find out roughly the distance so to know the likelyhood of needing to charge the car.
Looking at the message, I think it’s because the the from_state doesn’t give the previous attributes