Setup instructions for HomeAssistant
-
Hi,
Just wanted to add some instructions for people that use HomeAssistant and want to forward the location from HA towards Trackserver. You can do this in combination with the normal HA helper app on your phone that is already recording location, or with tracclient towards HA.
Anyhow, from HA you can forward the data to the Trackserver. First create add a section to the configuration.yaml:
rest_command: send_location_to_trackserver: url: "slug with user credentials from profile page" method: post content_type: "application/x-www-form-urlencoded" payload: "source=HomeAsssistant&lat={{ lat }}&lon={{ lon }}&altitude={{ altitude }}&bearing={{ bearing }}&speed={{ speed }}"
Reload the template. Now you can make a automation that on a change of location (in this case an iPhone, but can be anything with location in HA, just adjust the attributes if needed) uses the above rest command, for example:
alias: iPhoneData to TrackServer description: "" trigger: - platform: state entity_id: - device_tracker.iphoneY attribute: latitude condition: [] action: - service: rest_command.send_location_to_trackserver data: lat: "{{state_attr('device_tracker.iphoneY', 'latitude')}}" lon: "{{state_attr('device_tracker.iphoneY', 'longitude')}}" altitude: "{{state_attr('device_tracker.iphoneY', 'altitude')}}" bearing: "{{state_attr('device_tracker.iphoneY', 'bearing')}}" speed: "{{state_attr('device_tracker.iphoneY', 'speed')}}" mode: single
Maybe you can add it to the profile page or somewhere in the documentation or wiki.
- The topic ‘Setup instructions for HomeAssistant’ is closed to new replies.