I’m trying to create a simple automation that updates the gps location of a device_tracker after a telegram command is received with coordinates. for now it looks like this:
- id: telegram_jeep_location
alias: 'Telegram Jeep location'
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/jeeppark'
action:
- data_template:
gps: '{{ trigger.event.data["args"] }}'
dev_id: jeep
service: device_tracker.see
After execute the command /jeeppark 41.7917539 12.2781456
on telegram the event gets triggered correctly:
{
"event_type": "telegram_command",
"data": {
"user_id": <redacted>,
"from_first": "<redacted>",
"chat_id": <redacted>,
"command": "/jeeppark",
"args": [
"41.7917539",
"12.2781456"
]
},
"origin": "LOCAL",
"time_fired": "2019-06-22T12:06:33.725197+00:00",
"context": {
"id": "<redacted>",
"parent_id": null,
"user_id": null
}
}
However the automation throws an error:
ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.telegram_jeep_location. Invalid data for call_service at pos 1: None for dictionary value @ data['gps']
I believe it has something to do with how the gps coordinates touple gets formmated because I can manually launch the service without issues with this JSON data:
{"dev_id":"jeep",
"gps":[41.7917539, 12.2781456]}
Any insight is appreciated ^^