MQTT Sensor Car telemetry Torque Pro

Hello

I trying to re-do my configuration for the MQTT Sensor since the upgrade was done

i am using Torque Pro, llamalab script to get the data in MQTT… i see the data coming in with Mqtt W explorer

i was able to get some data in HA but some value such GPS Speed (Meters/second), Horizontal Dilution of Precision", etc that has space don’t come in

i got this error… Any help would be appreciated

Invalid config for [mqtt]: invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘Time’) for dictionary value @ data[‘mqtt’][‘sensor’][2][‘value_template’]. Got ‘{{ value_json.GPS Time }}’. (See /config/configuration.yaml, line 64).

MQTT
sensor:
- name: “Sierra Altitude”
state_topic: “devices/sierra/torque”
value_template: “{{ value_json.Altitude }}”

{“GPS Time”: “Sat Dec 24 13:23:47 EST 2022”, “Device Time”: “24-Dec-2022 13:23:11.066”, “Longitude”: “-112.63171826”, “Latitude”: “33.31137912”, “GPS Speed (Meters/second)”: “0.0”, “Horizontal Dilution of Precision”: “6.067999839782715”, “Altitude”: “236.0”, “Bearing”: “0.0”, “[GM]Oil Pressure (Engine)(bar)”: “183.31781019”, “[GM]Oil Temperature (Engine)(°C)”: “77”, “[GM]Transmission Fluid Temp (GM Method 2)(°C)”: “24”, “Ambient air temp(°C)”: “8”, “Barometric pressure (from vehicle)(kpa)”: “101”, “ECU(7EA): Voltage (Control Module)(V)”: “14.9289999”, “Engine Coolant Temperature(°C)”: “91”, “Engine Load(%)”: “28.62745094”, “Engine Oil Temperature(°C)”: “-”, “Fuel Level (From Engine ECU)(%)”: “52.54901886”, “GPS Altitude(ft)”: “774.2782164”, “Litres Per 100 Kilometer(Long Term Average)(l/100km)”: “19.32198143”, “Turbo Boost & Vacuum Gauge(bar)”: “-0.67999999”, “Voltage (Control Module)(V)”: “14.86600018”, “Voltage (OBD Adapter)(V)”: “14.19999981”, “Volumetric Efficiency (Calculated)(%)”: “64Sat Dec 24 13:23:47 EST 2022”}

The error refers to “GPS Time”, but your posted sensor has “Altitude”. Do you have another sensor with GPS Time? Some of the JSON attributes have spaces or other characters than cannot be used in Javasript property names. To access these you would have to use value_json['GPS Time'].

Hi…Altitude is the one that work… GPS Time is giving me an error
MQTT
sensor:

  • name: “Sierra GPS Time”
    state_topic: “devices/sierra/torque”
    value_template: “{{ value_json.GPS Time }}”

Invalid config for [mqtt]: invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘Time’) for dictionary value @ data[‘mqtt’][‘sensor’][2][‘value_template’]. Got ‘{{ value_json.GPS Time }}’. (See /config/configuration.yaml, line 64).