ReneNulschDE / mbapi2020

Custom Component to integrate MercedesME devices into Home-Assistant
Other
149 stars 29 forks source link

Attributes not allways respond correct value with is_state_attr #146

Closed dylan09 closed 10 months ago

dylan09 commented 10 months ago

I try to find out, when my car (PHEV) has precondition (heating) switched on. So I try to create a template sensor {{ is_state_attr('sensor.XXXX_XXXXX_range_electric', 'PrecondActive', 'true') }}

In entity view and in developer states view I could see the attribute is true. But my template sensor shows false. This happens when I start precondition to a departure time from the IOS app. If I start heating using the integration service call, my template sensor works as expected. How could I get ist also detecting the attribute change, when heating is switched on from my iOS App?

ReneNulschDE commented 10 months ago

Could you check if the attribute precondNow changes to true when you use the iOS app?

dylan09 commented 10 months ago

My mistake. Attribute names are case sensitive in HA. And to check a boolean condition a simple true is the right check.

For my B250e (PHEV) attributes are set: precondNow is true when preconditioning is instant startet from the app. precondActive is true when preconditioning is startet via departure time (have only checked in app) or when it is turned on using the service call.

Case closed