simontb / mojio-home-assistant

Custom component to integrate mojio with home assistant
MIT License
4 stars 2 forks source link

Error getting setup #24

Open tomcom05 opened 1 month ago

tomcom05 commented 1 month ago

I am really having issues getting this setup. I am using a legacy Tmobile US unit. Below is my confirmation and the error I am getting. Any help would be appreciated.

Config:

device_tracker:

Error: Logger: homeassistant.components.device_tracker Source: components/device_tracker/legacy.py:345 integration: Device tracker (documentation, issues) First occurred: 11:35:37 AM (1 occurrences) Last logged: 11:35:37 AM

Error setting up platform legacy mojio Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 345, in async_setup_legacy setup = await hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mojio/device_tracker.py", line 41, in setup_scanner if not scanner.login(hass): ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mojio/device_tracker.py", line 74, in login self.setup(hass) File "/config/custom_components/mojio/device_tracker.py", line 67, in setup self._refresh() File "/config/custom_components/mojio/device_tracker.py", line 83, in _refresh vehicles = self._api.get_vehicles() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/mojio_sdk/api.py", line 40, in get_vehicles return self._parse_devices(self._get_response("vehicles")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/mojio_sdk/api.py", line 68, in _parse_devices device = Vehicle(json_vehicle_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/mojio_sdk/vehicle.py", line 56, in init self.status = json_data.get('VehicleStatus').get('Value', 'unknown') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'

GSzabados commented 1 month ago

Have you defined a plate number in the SyncUp or whatever app you are using? And have you used the devices already so you have information in the app regarding the car, position, etc.?

Regarding the scan interval, my recent experience is that the position data is updated only in every two minute.

tomcom05 commented 1 month ago

Yes, i have the plate set in the SyncUp app & i have many years of data in the app. I adjusted the scan interval to 120. Same results :(

GSzabados commented 1 month ago

self.status = json_data.get('VehicleStatus').get('Value', 'unknown')

Your error message means that the API has returned VehicleStatus as None and it hasn't got a Value to get. So the API result is different than what the code expects.

tomcom05 commented 1 month ago

I am new to home assistant. Is there a way to get the full results from a log file to see what it is getting?