bimmer_connected icon indicating copy to clipboard operation
bimmer_connected copied to clipboard

Get data with active Check Control messages

Open m1n3rva opened this issue 8 years ago • 10 comments

At the moment we do not have any example data with active check control messages. So we cannot parse these :sob:

If you have a vehicle :car: that currently shows check control messages (red :exclamation: or yellow :warning: warnings in your instrument cluster :clock12: :clock630: : ). Please send us your data: https://github.com/ChristianKuehnel/bimmer_connected#data-contributions

The status.json should then contain some data in the field checkControlMessages.

m1n3rva avatar Mar 24 '18 06:03 m1n3rva

I have a white exclamation right now for tire pressure after changing all 4 this weekend but it didn't generate a check control message. sorry.

robbz23 avatar Apr 09 '18 06:04 robbz23

I would have expected a message from that as in the app for my car the only check control messages are for tyre pressure and motor oil :neutral_face:

My tyres are also changed last week, but that didn't produce an message. So I guess we have to wait a bit longer :wink:

gerard33 avatar Apr 14 '18 19:04 gerard33

@m1n3rva I have some data finally :wink:

"checkControlMessages": [
      {
        "ccmDescriptionLong": "You can continue driving. Check tyre pressure when tyres are cold and adjust if necessary. Perform reset after adjustment. See Owner's Handbook for further information.",
        "ccmDescriptionShort": "Tyre pressure notification",
        "ccmId": 955,
        "ccmMileage": 41544
      }
    ]

My suggestion is to show the ccmDescriptionShort on the HA card like in the screenshot below. I have now changed this is in the binary_sensor component of HA on my test version.

But the cleanest way would be to do the processing in the library of course. Can you spend some time to implement that? If not then I will change it in the HA code and can release that together with bumping the version after PR #83 is merged.

cbs_screenshot

gerard33 avatar Sep 24 '18 21:09 gerard33

Hi @m1n3rva,

I will make a PR to bump the version of bimmer_connected to 0.5.3 and will make a small change in the HA code of the binary sensor to support the check_control_messages as well.

Current code

elif self._attribute == 'check_control_messages':
    check_control_messages = vehicle_state.check_control_messages
    if not check_control_messages:
        result['check_control_messages'] = 'OK'
    else:
        result['check_control_messages'] = check_control_messages

New code

elif self._attribute == 'check_control_messages':
    check_control_messages = vehicle_state.check_control_messages
    if not check_control_messages:
        result['check_control_messages'] = 'OK'
    else:
        cbs_list = []
        for message in check_control_messages:
            cbs_list.append(message['ccmDescriptionShort'])
        result['check_control_messages'] = cbs_list

gerard33 avatar Sep 25 '18 20:09 gerard33

@gerard33 Thx for the data :scroll:!

I created 2 PRs for this:

  • in #90 I just added your data and created tests for CCMs
  • in #91 I also added a new API to parse these CCMs into Python objects. So the answer to State.check_control_messages now is List[CheckControlMessage] instead of List[Dict].

I guess this does not fit to your implementation in Home Assistant, so this would be a breaking change. Please let me know what you think of #91 and if we should merge that.

m1n3rva avatar Oct 07 '18 12:10 m1n3rva

@m1n3rva thanks for the update. Will do some test for #91 as it's much nicer to have this data parsed in bimmer_connected just as the rest. Don't think this will be a breaking change. If that's confirmed I can update the code in HA and bump the version.

gerard33 avatar Oct 07 '18 22:10 gerard33

@m1n3rva you can merge #91 and release a new version on Pypi. I have tested this and will make a HA PR so this data is parsed just as the cbs part. This won't be a breaking change as the current value will be remained and I will add some extra info.

screenshot_2

gerard33 avatar Oct 17 '18 21:10 gerard33

Hmm, I did some more thinking and it is possible that you can get multiple check_control_messages at the same time. I know that at least messages for tyre pressure and motor oil are possible.

That's way we need to group the messages, I used the id for that. It will look like this. Will mean that this is a breaking change for the attribute, but that's no real issue.

@m1n3rva what do you think?

screenshot_3

gerard33 avatar Oct 17 '18 22:10 gerard33

@gerard33 Nice HomeAssistant Integration 👍

Yes, I guess the Vehicle can return a list CC Messages, so the HomeAssistant Integration would somehow have to deal with that. And the solution with the IDs in the names is not the prettiest, but I do not really have a better idea right now…

I'll fix your code comments and then merge the PR.

m1n3rva avatar Oct 20 '18 12:10 m1n3rva

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Apr 25 '20 09:04 lock[bot]