Error when loading vehicle_state

Posted on
Sun Mar 03, 2019 2:11 am
davinci offline

Error when loading vehicle_state

When I update the vehicle_state I get this error. (changed some values for privacy)

Code: Select all
   Tesla Control PAH Debug         vehicle_state
   Tesla Control PAH Debug         {u'valet_pin_needed': True, u'remote_start_supported': True, u'homelink_nearby': False, u'parsed_calendar_supported': True, u'odometer': 0.0, u'remote_start': False, u'pr': 0, u'valet_mode': False, u'calendar_supported': True, u'speed_limit_mode': {u'active': False, u'current_limit_mph': 85.0, u'max_limit_mph': 90, u'min_limit_mph': 50, u'pin_code_set': False}, u'pf': 0, u'sun_roof_percent_open': None, u'media_state': {u'remote_control_enabled': True}, u'api_version': 6, u'rt': 0, u'ft': 0, u'df': 0, u'timestamp': 1551600219224, u'sun_roof_state': u'unknown', u'notifications_supported': True, u'software_update': {u'expected_duration_sec': 2700, u'status': u''}, u'is_user_present': False, u'vehicle_name': u'Name', u'dr': 0, u'autopark_style': u'dead_man', u'remote_start_enabled': True, u'locked': True, u'center_display_state': 0, u'last_autopark_error': u'no_error', u'car_version': u'2018.51.16 e111878', u'autopark_state_v2': u'standby'}
   Tesla Control PAH Error         Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 130, in vehicleStatus
TypeError: state value type must be bool, int, real, or string


The other updates work properly, but I don't get new values for example for the timestamp. It remains at 2147xxxxxx. I guess it crashed before writing the values.

Running V1.0.4.

After update to 1.0.8 - I did not remove the device, though:
Code: Select all
   Tesla EV Control Debug          State homelink_nearby, value False, type <type 'bool'>
   Tesla EV Control Debug          State is_user_present, value False, type <type 'bool'>
   Tesla EV Control Debug          State last_autopark_error, value no_error, type <type 'unicode'>
   Tesla EV Control Debug          State locked, value True, type <type 'bool'>
   Tesla EV Control Debug          State media_state, value {u'remote_control_enabled': True}, type <type 'dict'>
   Tesla EV Control Error          Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 165, in vehicleStatus
  File "plugin.py", line 212, in vehicleStatus2
  File "plugin.py", line 190, in vehicleStatus2
TypeError: state value type must be bool, int, real, or string


Maybe it is not related, but I can't select timestamp as a trigger value - it always selects something else.
Update: Issue is related to 1.0.8. I can't select the upper few values as device triggers. Resolution of the screen is 1080p - so the list has to scroll.

I also used fresh all vehicle_states (btw. what is the difference between this and updating every state separately?)

How can I check if the update is recent or if it failed? The timestamp of the call is not stored in the variable but it shows in the debug for every call:
Code: Select all
 u'timestamp': 1551636305746

There is only one timestamp in the variables, but every call should get a new one - confusing. I would need a timestamp-vehicle_state, timestamp-climate_state and so on.

Posted on
Sun Mar 03, 2019 12:58 pm
davinci offline

Re: Error when loading vehicle_state

For now I can work around this with this code which I run every second:

Code: Select all
import time
teslaTimestampOld = str(indigo.variables[0000000].value)

timeLastUpdate = indigo.devices[111111111].lastChanged
teslaTimestamp = time.mktime(timeLastUpdate.timetuple())
teslaTimestamp = str(teslaTimestamp)
if teslaTimestampOld != teslaTimestamp:
    indigo.variable.updateValue(0000000, teslaTimestamp) #Tesla Timestamp
    indigo.server.log("Update Tesla")


Not sure how efficient this is...

Posted on
Mon Mar 04, 2019 10:31 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Error when loading vehicle_state

I’ll have a look at this in a day or two.

From memory the device state TYPES (int, bool, str) are set the first time each state appears.

If Tesla have changed a state from (eg) sending string “True” to sending Boolean TRUE, then I may not catch that change and it will throw an error similar to your report.

I need to read your logs on a pc not my phone to make sense of them.


Sent from my iPhone using Tapatalk Pro

Posted on
Sun Mar 17, 2019 4:44 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Error when loading vehicle_state

See 1.0.9 Beta on the announcement thread.

Posted on
Sun May 26, 2019 3:31 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Error when loading vehicle_state

MOD NOTE:

I've split the rest of this thread into a new topic: HTTPError 408 Timeout

Any further posts regarding 408 timeout should go in that thread.

If further issues with the vehicle state types, as per this thread, feel free to post them here.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests