Hi
I’m doing this to send location of a device tracker as a map via Telegram:
- service_template: notify.telegramdebug
data_template:
message: 'Blah blah.'
data:
location:
latitude: states.device_tracker.mydevice.latitude
longitude: states.device_tracker.mydevice.longitude
This errs:
Sep 14 15:45:30 home-assistant hass[32241]: 2017-09-14 15:45:30 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Sep 14 15:45:30 home-assistant hass[32241]: Traceback (most recent call last):
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
Sep 14 15:45:30 home-assistant hass[32241]: result = coro.throw(exc)
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/local/lib/python3.5/dist-packages/homeassistant/core.py”, line 1025, in _event_to_service_call
Sep 14 15:45:30 home-assistant hass[32241]: yield from service_handler.func(service_call)
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/telegram_bot/init.py”, line 288, in async_send_telegram_message
Sep 14 15:45:30 home-assistant hass[32241]: partial(notify_service.send_location, **kwargs))
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/lib/python3.5/asyncio/futures.py”, line 361, in iter
Sep 14 15:45:30 home-assistant hass[32241]: yield self # This tells Task to wait for completion.
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/lib/python3.5/asyncio/tasks.py”, line 296, in _wakeup
Sep 14 15:45:30 home-assistant hass[32241]: future.result()
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/lib/python3.5/asyncio/futures.py”, line 274, in result
Sep 14 15:45:30 home-assistant hass[32241]: raise self._exception
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
Sep 14 15:45:30 home-assistant hass[32241]: result = self.fn(*self.args, **self.kwargs)
Sep 14 15:45:30 home-assistant hass[32241]: File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/telegram_bot/init.py”, line 547, in send_location
Sep 14 15:45:30 home-assistant hass[32241]: latitude = float(latitude)
Sep 14 15:45:30 home-assistant hass[32241]: ValueError: could not convert string to float: ‘states.device_tracker.mydevice.latitude’
In the webui in states I can validate that the info looks OK:
device_tracker.mydevice
Larswork
longitude: 10.1234
icon: False
latitude: 59.1234
battery: 64
gps_accuracy: 24
source_type: gps
friendly_name: lars
tid: La
Any idea what I’m doing wrong?