I with help from some great people here created a sensor. it uses IMAP integration to plot position on map card using GPS coordinates received via email.
template:
- trigger:
- platform: event
event_type: "imap_content"
id: "GPSposition"
event_data:
subject: pos
sensor:
- name: boatgps
state: "{{ trigger.event.data['date'] }}"
icon: mdi:home-circle-outline
attributes:
latitude: "{{(trigger.event.data['text']|from_json)['latitude'] }}"
longitude: "{{(trigger.event.data['text']|from_json)['longitude'] }}"
it works really great until i wanted to add Speed & destination as attributes too. I´m not an expert in yaml so i asked claude.ai , but what ever i do sensor goes totally unavailable. Can some body shed some light how to add another two or more attributes to above code please?
currently receiving email message is just a text message like below.
{"latitude": 8.08, "longitude": 74.31, "speed": 12.0 knots, "destination": dubai}