Zendure / developer-device-data-report

Subscribe to device data for Zendure products. To receive information from the device, Developers can obtain the same device information as the official App by subscribing to Zendure MQTT Broker
83 stars 3 forks source link

missing attributes #11

Open sirnicolas21 opened 1 year ago

sirnicolas21 commented 1 year ago

home assistant is complaining about missing attributes in every mqtt message received by SBV, i have a log of 500mb with that image

after digging I found this image https://community.home-assistant.io/t/mqtt-dict-object-has-no-attribute/297330/18

markcocker commented 1 year ago

Is there a work around to turn off this logging?

sirnicolas21 commented 1 year ago

Is there a work around to turn off this logging?

not in my knowledge

markcocker commented 1 year ago

I have added the following to Home Assistant configuration.yaml to prevent these log messages:

logger:
  default: info
  filters:
    homeassistant.helpers.template:
      - "Template variable warning: 'dict object' has no attribute"
sirnicolas21 commented 1 year ago

I have added the following to Home Assistant configuration.yaml to prevent these log messages:

logger:
  default: info
  filters:
    homeassistant.helpers.template:
      - "Template variable warning: 'dict object' has no attribute"

that works yes, thanks, I still however believe that zendure API should behave as HA describes, so I will keep the issue open

z-master42 commented 1 year ago

Is there a work around to turn off this logging?

Add a default value to the value_json like value_template: "{{ value_json.electricLevel | int('') }}" or value_template: "{{ value_json.electricLevel | default('') }}".

AzraelsDisk commented 1 year ago

I would say there are a lot more of them... Can somebody help me out?

Logger: homeassistant.helpers.template Source: helpers/template.py:735 First occurred: 14:22:02 (214060 occurrences) Last logged: 21:57:08

z-master42 commented 1 year ago

See my previous post.

AzraelsDisk commented 1 year ago

See my previous post.

yes, but where to add... sorry for the noob question

z-master42 commented 1 year ago

Were your entities created automatically by HA or did you enter them manually in configuration.yaml or similar?

AzraelsDisk commented 1 year ago

They where created automatically by HA, so no manually edit by my side

@z-master42 thanks for your support, I've used @markcocker example for my configuration it's working!

z-master42 commented 1 year ago

Ok, I can't help you there at the moment. I have created mine manually and was able to set a default value that prevents these warnings from coming in. This is due to the fact that the Zendure broker only plays out value changes, so the values do not come in regularly for all sensors.