I have these as well. I believe it’s due to the latest Z2M release supporting new attributes (through herdsman) for a bunch of devices. However, those updates only seem to get updated in MQTT when the values actually change. For instance, I was getting it on [xAxis], [yAxis] and [zAxis] on some of my SmartThings multi-purpose sensors. Once I went and actually moved the devices, they started updating their values in MQTT.
In your instance, I’d recommend going into the Z2M interface and checking the link quality of your devices as I bet some of them have ‘N/A’ for LQI and that’s what is killing the template.
Yes, that seems to make sense. It does look like Z2M doesn’t always report/update values - e.g. I have a Z2M aqara button that has just reported a battery update as below, but no linkquality or action is reported there
Yeah, I think it’s more of a Z2M issue. This is a cap of two of the same sensors (both SmartThings IM6001-MPP01); One is reporting axis values, while the other one isn’t and it’s causing HA to throw a hissy fit in the logs.
If the value template excludes some of the expected values, then it will generate the warning (and later this year, HA will reject it apparently). You can do something like {“attribute”:null} which HA will accept.
Can anyone please be more specific how to fix this?
I have currently 11 (soon 15) xiaomi ble temperature and humidity sensors of which are sending these values to manually made mqtt-sensors via ESP32 running Tasmota.
Now, after the latest update my logging file is full of errors like:
2021-04-14 09:37:22 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC3ae0ef' when rendering '{{ value_json.ATC3ae0ef.Temperature }}'
2021-04-14 09:37:22 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC3ae0ef' when rendering '{{ value_json.ATC3ae0ef.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCd17f48' when rendering '{{ value_json.ATCd17f48.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCd17f48' when rendering '{{ value_json.ATCd17f48.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC4a2dcc' when rendering '{{ value_json.ATC4a2dcc.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC4a2dcc' when rendering '{{ value_json.ATC4a2dcc.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC37967e' when rendering '{{ value_json.ATC37967e.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC37967e' when rendering '{{ value_json.ATC37967e.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCc931e6' when rendering '{{ value_json.ATCc931e6.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCc931e6' when rendering '{{ value_json.ATCc931e6.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCab8345' when rendering '{{ value_json.ATCab8345.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCab8345' when rendering '{{ value_json.ATCab8345.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCbe98b3' when rendering '{{ value_json.ATCbe98b3.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCbe98b3' when rendering '{{ value_json.ATCbe98b3.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC22312b' when rendering '{{ value_json.ATC22312b.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC22312b' when rendering '{{ value_json.ATC22312b.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC0eea4b' when rendering '{{ value_json.ATC0eea4b.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC0eea4b' when rendering '{{ value_json.ATC0eea4b.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC3ae0ef' when rendering '{{ value_json.ATC3ae0ef.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATC3ae0ef' when rendering '{{ value_json.ATC3ae0ef.Humidity }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCf09d9d' when rendering '{{ value_json.ATCf09d9d.Temperature }}'
2021-04-14 09:37:23 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'ATCf09d9d' when rendering '{{ value_json.ATCf09d9d.Humidity }}'
So, what should I change on my template sensor definition? Now, they are like this:
See my post above - it’s because you are sending either Temperature or Humidity in the MQTT message, but the other is missing, so it’s complaining that it can’t see it. Either ensure you are sending both (even if null), or use separate topics for each.
Well. Do not know how to fix that, since that is the way Tasmota is sending those messages?
Or does anyone know can this be configured differently in Tasmota?
Also, I have these other warnings I do not know where it is located. How to track it down?
Template variable warning: 'dict object' has no attribute 'click' when rendering '{{ value_json.click }}'
Template variable warning: 'dict object' has no attribute 'action' when rendering '{{ value_json.action }}'
Template variable warning: 'dict object' has no attribute 'requested_brightness_level' when rendering '{{ value_json.requested_brightness_level }}'
Template variable warning: 'dict object' has no attribute 'requested_brightness_percent' when rendering '{{ value_json.requested_brightness_percent }}'
I assume you’re using Zigbee2MQTT? The click/action/brightness warnings should be fixed in an upcoming release.
The first bit seems to be saying that you’re trying to populate a value in an attribute called ‘4/8/2021’, which I’m guessing is incorrect. That sounds like the value your trying to assign and not the name of the attribute, so it looks like you have things the wrong way around.
I assume you’re using Zigbee2MQTT? The click/action/brightness warnings should be fixed in an upcoming release.
Yes, Great news.
The first bit seems to be saying that you’re trying to populate a value in an attribute called ‘4/8/2021’, which I’m guessing is incorrect.
I’ve looked at the days.json file and there is no 4/28/2021 attribute, but the sensor is scanning 11 days ahead which was 4/28/2021 for any data, but there wasn’t such a date to report.
Same problem here
However, If I take a look at the logs, it appears that those messages are comming from my boiler, connected with ems-esp to mqtt to hass.
So I don’t think this is an zigbee2mqtt issue.
(Although I’m also running z2m)
Anybody an idea how to resolve this. I have approx 10.000 log records/hour. Destroying my sd-card on my pi…
2021-04-17 19:36:05 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'maintenance' when rendering '{{value_json.maintenance}}'
2021-04-17 19:36:05 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'wWSetPumpPower' when rendering '{{value_json.wWSetPumpPower}}'
2021-04-17 19:36:05 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'wwMixTemperature' when rendering '{{value_json.wwMixTemperature}}'
2021-04-17 19:36:05 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'wwBufferTemperature' when rendering '{{value_json.wwBufferTemperature}}'
2021-04-17 19:36:06 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'floordry' when rendering '{{value_json.floordry}}'
2021-04-17 19:36:06 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'floordrytemp' when rendering '{{value_json.floordrytemp}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'pumpMod2' when rendering '{{value_json.pumpMod2}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'switchTemp' when rendering '{{value_json.switchTemp}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'boilTemp' when rendering '{{value_json.boilTemp}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'exhaustTemp' when rendering '{{value_json.exhaustTemp}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'setFlowTemp' when rendering '{{value_json.setFlowTemp}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'setBurnPow' when rendering '{{value_json.setBurnPow}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'upTimeControl' when rendering '{{value_json.upTimeControl}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'upTimeCompHeating' when rendering '{{value_json.upTimeCompHeating}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'upTimeCompCooling' when rendering '{{value_json.upTimeCompCooling}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'upTimeCompWw' when rendering '{{value_json.upTimeCompWw}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'heatingStarts' when rendering '{{value_json.heatingStarts}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'coolingStarts_' when rendering '{{value_json.coolingStarts_}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'wWStarts2' when rendering '{{value_json.wWStarts2}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgConsTotal' when rendering '{{value_json.nrgConsTotal}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'auxElecHeatNrgConsTotal_' when rendering '{{value_json.auxElecHeatNrgConsTotal_}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'auxElecHeatNrgConsHeating' when rendering '{{value_json.auxElecHeatNrgConsHeating}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'auxElecHeatNrgConsDHW' when rendering '{{value_json.auxElecHeatNrgConsDHW}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgConsCompTotal' when rendering '{{value_json.nrgConsCompTotal}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgConsCompHeating' when rendering '{{value_json.nrgConsCompHeating}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgConsCompWw' when rendering '{{value_json.nrgConsCompWw}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgConsCompCooling' when rendering '{{value_json.nrgConsCompCooling}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgSuppTotal_' when rendering '{{value_json.nrgSuppTotal_}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgSuppHeating' when rendering '{{value_json.nrgSuppHeating}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgSuppWw' when rendering '{{value_json.nrgSuppWw}}'
2021-04-17 19:36:15 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'nrgSuppCooling' when rendering '{{value_json.nrgSuppCooling}}'
The issue is that HA is expecting ALL the attributes for a device to be passed in the MQTT message, and some of them are missing. HA now issues a warning message for this and, in the future, will error (apparently).
The fix is to ensure that all the attributes are passed or, if not, a null value is passed instead (e.g. {“switchTemp”:null}
This is also what is causing the issues with Zigbee2MQTT as devices don’t always send all attribute values, so Z2M is being updated to pass a null value in those cases too.
Problem is: how can I do this practically? I connect my ems-esp. Happy with autodiscovery but not so happy with the errors.
I’m not willing to rewrite the ems-esp code…