Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

...

Kodeblok
- platform: rest
  name: Toyota RAV4 Fuel
  resource: http://127.0.0.1/mytoyota/odometer.json
  method: GET
  value_template: '{{ value_json.1.value }}'
  unit_of_measurement: Pct
  scan_interval: 3000

- platform: rest
  name: Toyota RAV4 Mileage
  resource: http://127.0.0.1/mytoyota/odometer.json
  method: GET
  value_template: '{{ value_json.0.value }}'
  unit_of_measurement: Km
  scan_interval: 3000

- platform: rest
  name: Toyota RAV4 Gasoline Travelable Distance
  resource: http://127.0.0.1/mytoyota/remote_control.json
  method: GET
  value_template: '{{ value_json.VehicleInfo.ChargeInfo.GasolineTravelableDistance }}'
  unit_of_measurement: Km
  scan_interval: 3000

- platform: rest
  name: Toyota RAV4 EV Travelable Distance (with EC)
  resource: http://127.0.0.1/mytoyota/remote_control.json
  method: GET
  value_template: '{{ value_json.VehicleInfo.ChargeInfo.EvDistanceWithAirCoInKm }}'
  unit_of_measurement: Km
  scan_interval: 3000

- platform: rest
  name: Toyota RAV4 EV Travelable Distance (without EC)
  resource: http://127.0.0.1/mytoyota/remote_control.json
  method: GET
  value_template: '{{ value_json.VehicleInfo.ChargeInfo.EvTravelableDistance }}'
  unit_of_measurement: Km
  scan_interval: 3000

- platform: rest
  name: Toyota RAV4 Inside Temperature
  resource: http://127.0.0.1/mytoyota/remote_control.json
  method: GET
  value_template: '{{ value_json.VehicleInfo.RemoteHvacInfo.InsideTemperature }}'
  unit_of_measurement: C
  scan_interval: 3000

- platform: rest
  name: Toyota RAV4 Charging Status
  resource: http://127.0.0.1/mytoyota/remote_control.json
  method: GET
  value_template: '{{ value_json.VehicleInfo.ChargeInfo.ChargingStatus }}'
  scan_interval: 3000


Getting the GPS Data on a Device

In known_devices.yaml I create the car:

Kodeblok
rav4:
  hide_if_away: false
  icon: mdi:car
  name: Toyota Rav4
  track: true


And an automation set the lat and lon onto the device:

Kodeblok
alias: Update Car Tracker
trigger:
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: sensor.toyota_rav4_parking
condition: []
action:
  - service: device_tracker.see
    data:
      dev_id: rav4
      gps:
        - '{{ state_attr(''sensor.toyota_rav4_parking'', ''lat'') }}'
        - '{{ state_attr(''sensor.toyota_rav4_parking'', ''lon'') }}'
mode: single