Changing device_tracker location in automation action

Do you know if it’s possible to change the device_tracker location in automation action?

Unfortunately iOS app is not very reliable, so I’ve added additional ping tracker to check if device is at home and would like to update the original tracker location.

Don’t know if it’s possible to change it, but the IOS app would eventually change it back anyway. Agreed, it’s too unreliable to be useful for location tracking.
Instead, it’s best to use multiple sources for location tracking, and base your automation off of the aggregate location instead of the single source.

You can use the service device_tracker.see. You should be able to pass it a device name and a location. It’ll get updated by iOS the next time iOS reports.

Yes, I’m doing the aggregation now, but I want to have nice “bubbles” with people photos in it on top of the home screen and these can be only generated by device_tracker. Sooo… maybe it’s time to create a dummy tracker that could be updated by an automation rule.

the bubbles on the top are sensors, binary_sensors, or known_devices. I recommend using a template sensor, here’s an example:

- platform: template
  sensors:      
    mud_room_lux:
      unit_of_measurement: "lux"
      value_template: >
        {% if is_state('light.m_ceiling', 'off') %}
          {{ states('sensor.mud_room_sensor_luminance') }}
        {% endif %}

Unfortunately you cannot set the photo inside nor dynamically change the measurement unit as in device_tracker.

right… that’s why you use a sensor template…

The whole point of a sensor template is to create a sensor that you manipulate however you please. You can set a picture on the sensor template in the customization section.

This statement is wrong, my last post was correcting you. The bubbles you are refering to are sensors, binary_sensors, or known_devices.

I think you don’t understand. Device_tracker “bubble” has two features that other sensors don’t have:

  1. It displays a photo instead of a sensor value
  2. In place of measurement unit (which is constant in normal sensor) it shows current location

There is no template for measurement_unit, only for value and icon.

What I would like to do is create a fake device_tracker “bubble” to get a summary of all device_trackers assigned to one device (like iOS app, ping, ibeacon, etc.).

I think I found a way to do it (i.e. create a custom device tracker):

I understand. Did you know you can use an image to overwrite the sensor state? Example:

  customize:
    sensor.test_1:
      entity_picture: /local/dot.png

test_1: 
    value_template: >
      {% if 1==1 %}
        "HOME"
      {% else %}
        "NOT HOME"
      {% endif %}

Capture

The only thing this wouldn’t do is display Home/Away with your sensor. You’d still get your image, and the state would be correct.

I’m not sure why you are dwelling on the unit of measure. That is only for graphing and units. You wouldn’t have a unit in this case…

EDIT: Apparently they added picture templating to sensors as well. So you could have your image change based on home/away.

entity_picture_template
(template)(Optional)Defines a template for the entity picture of the sensor.

I’ve managed to do what I want using mqtt tracker.