Thanks for the Automations, were just about to make one for me.
I don’t quite get it to work, took me awhile to figure out, you also need input_number but still it will not work.
input_number:
monthly_mileage:
name: Whatever
min: 0
max: 100000
step: 1
- alias: Monthly Mileage
trigger:
platform: time
at: '00:00:00'
condition:
- condition: template
# Change the number here to get whatever day of the month you want.
value_template: “{{ now().day == 1 }}”
action:
service: input_number.set_value
data_template:
entity_id: input_number.monthly_mileage
value: “{{ states.sensor.XXXXXX_odometer.state }}”
Been trying this tonight and change day == 2 and proper time but it will not fire.
@ReneNulschDE Would be great if you find the heater, I can test it for my mb (that also is diesel ) Also, how can I see that the custom updater have updated files ?
alias: Februari Mileage
trigger:
platform: time
at: ‘00:00:00’
condition:
- condition: template
# Change the number here to get whatever day of the month you want.
value_template: “{{ now().day == 1 and now().month == 2 }}”
action:
service: input_number.set_value
data_template:
entity_id: input_number.monthly_mileage_feb
value: “{{ states.sensor.tg_XXX_k_odometer.state }}”
Where do you enter that “monthly_mileage_feb:” part? I just get errors if it’s in automation.yaml…
Btw, I have a leasing car with a mileage limit. I’m interested about predicting my mileage in three years to avoid additional costs. So I have a telegram status report which makes the estimate: {{ ((states('sensor.odometer') | int) / (((states('sensor.date')[:-6] | int - 2017) * 365 + (states('sensor.date')[-5:-3] | int - 10) * 30 + (states('sensor.date')[-2:] | int - 13)) / 1095)) | int }}
…simple odometer divided by (days-in-use / 1095), where 1095=3*365.
However, it’d be interesting to make a history graph of the estimate instead of just spot reports. How can one enter such formulae to history graphs?
I’ve having trouble getting this to work.
This is my log:
2019-02-04 19:54:41 INFO (SyncWorker_9) [mbwebapppy.controller] Login step 2 http code 200
2019-02-04 19:54:42 INFO (SyncWorker_9) [mbwebapppy.controller] Login step 3 http code 404
2019-02-04 19:54:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component mbwebbeta
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/mbwebbeta.py”, line 167, in setup
mercedesme_api = Controller(username, password, scan_interval)
File “/config/deps/lib/python3.6/site-packages/mbwebapppy/controller.py”, line 212, in init
self._get_cars()
File “/config/deps/lib/python3.6/site-packages/mbwebapppy/controller.py”, line 265, in _get_cars
response.content.decode(‘utf8’))[‘vehicles’]
File “/usr/local/lib/python3.6/json/init.py”, line 354, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.6/json/decoder.py”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/local/lib/python3.6/json/decoder.py”, line 357, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
When i click the link i’m asked to login. I put in my “mercedes me” app email and pass and i get 404
# Not Found
The requested URL /app/ciam/success.html was not found on this server.
The 2nd link obviously doesn’t work either. I get
Not Found / Details (optional): com.daimler.daivb.cpp.exceptions.CppUserNotFoundException: CIAM user with id xxx not found in CPD.
The 404 is normal because they have removed the webapp. The second error is the problem. Never have seen this before. Could you login in the normal mb portal with this user and password?
thanks, ya I just read Mercedes connected vehicle API docs. No dice for us in US right now hopefully they’ll add it at some point.
I messed around with it a bit more and got it to give me the data consent screen etc but when you query it for vehicles it doesn’t find anything
Even my mobile app doesn’t work any longer, apparently they closed all api’s. The car is nice, but the way MB handles software (api, mobile, in-car)… I haven’t seen as poor performance probably ever.