mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 13:08:19 -04:00
fixed GPS
This commit is contained in:
@@ -57,6 +57,30 @@ automation:
|
|||||||
|
|
||||||
template:
|
template:
|
||||||
- sensor:
|
- sensor:
|
||||||
|
- name: Van Last Known Latitude
|
||||||
|
unique_id: van_last_known_latitude
|
||||||
|
unit_of_measurement: "°"
|
||||||
|
state: >-
|
||||||
|
{% set lat = states('sensor.gps_latitude')|float(none) %}
|
||||||
|
{% set fix = states('sensor.gps_fix')|int(0) %}
|
||||||
|
{% if lat is not none and fix > 0 %}
|
||||||
|
{{ lat }}
|
||||||
|
{% else %}
|
||||||
|
{{ this.state | default('unavailable', true) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
- name: Van Last Known Longitude
|
||||||
|
unique_id: van_last_known_longitude
|
||||||
|
unit_of_measurement: "°"
|
||||||
|
state: >-
|
||||||
|
{% set lon = states('sensor.gps_longitude')|float(none) %}
|
||||||
|
{% set fix = states('sensor.gps_fix')|int(0) %}
|
||||||
|
{% if lon is not none and fix > 0 %}
|
||||||
|
{{ lon }}
|
||||||
|
{% else %}
|
||||||
|
{{ this.state | default('unavailable', true) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
- name: GPS Location
|
- name: GPS Location
|
||||||
unique_id: gps_location
|
unique_id: gps_location
|
||||||
state: >-
|
state: >-
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ modbus:
|
|||||||
|
|
||||||
# GPS
|
# GPS
|
||||||
- name: GPS Latitude
|
- name: GPS Latitude
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2800
|
address: 2800
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: int32
|
data_type: int32
|
||||||
@@ -88,7 +88,7 @@ modbus:
|
|||||||
unique_id: gps_latitude
|
unique_id: gps_latitude
|
||||||
|
|
||||||
- name: GPS Longitude
|
- name: GPS Longitude
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2802
|
address: 2802
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: int32
|
data_type: int32
|
||||||
@@ -98,7 +98,7 @@ modbus:
|
|||||||
unique_id: gps_longitude
|
unique_id: gps_longitude
|
||||||
|
|
||||||
- name: GPS Course
|
- name: GPS Course
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2804
|
address: 2804
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: uint16
|
data_type: uint16
|
||||||
@@ -109,7 +109,7 @@ modbus:
|
|||||||
unique_id: gps_course
|
unique_id: gps_course
|
||||||
|
|
||||||
- name: GPS Speed
|
- name: GPS Speed
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2805
|
address: 2805
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: uint16
|
data_type: uint16
|
||||||
@@ -120,7 +120,7 @@ modbus:
|
|||||||
unique_id: gps_speed
|
unique_id: gps_speed
|
||||||
|
|
||||||
- name: GPS Fix
|
- name: GPS Fix
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2806
|
address: 2806
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: uint16
|
data_type: uint16
|
||||||
@@ -129,7 +129,7 @@ modbus:
|
|||||||
unique_id: gps_fix
|
unique_id: gps_fix
|
||||||
|
|
||||||
- name: GPS Satellites
|
- name: GPS Satellites
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2807
|
address: 2807
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: uint16
|
data_type: uint16
|
||||||
@@ -138,7 +138,7 @@ modbus:
|
|||||||
unique_id: gps_satellites
|
unique_id: gps_satellites
|
||||||
|
|
||||||
- name: GPS Altitude
|
- name: GPS Altitude
|
||||||
slave: 100
|
slave: 1
|
||||||
address: 2808
|
address: 2808
|
||||||
input_type: holding
|
input_type: holding
|
||||||
data_type: int32
|
data_type: int32
|
||||||
|
|||||||
Reference in New Issue
Block a user