Z2M flooding HA logs with "Template variable warning" errors - VZM31-SN switches

My Home Assistant logs are flooded with entries like the following:

2024-07-15 20:26:32.114 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: ‘dict object’ has no attribute ‘ledColorForFanControlMode’ when rendering ‘{{ value_json.ledColorForFanControlMode }}’

I get them for the attributes ledColorForFanControlMode, highLevelForFanControlMode, singleTapBehavior, quickStartTime, fanControlMode, fanLedLevelType, lowLevelForFanControlMode, and mediumLevelForFanControlMode.

By “flooded” I mean 180,000+ messages in the last five days.

I have seven VZM31-SN switches. If I look at the HA device info page I can see these attributes, but they’re all in the “unknown” state:

image

The Z2M “Exposes” tab for each of the switches shows those attributes, each with no set value:

My questions are:

  • What’s the best way to stop the flood of log messages? Just set values for them in Z2M?
  • Why are these attributes defined for these switches in Z2M anyway? These are all, AFAIK, fan control attributes. But these aren’t fan switches.

Turns out I can’t set values for them in Z2M:

2024-07-16 07:36:44z2m: Publish ‘set’
‘fanControlMode’ to ‘Front Porch Light’ failed: ‘Error: ZCL command
0x040d84fffe05f7d2/1
manuSpecificInovelli.write({“130”:{“value”:0,“type”:32}},
{“timeout”:10000,“disableResponse”:false,“disableRecovery”:false,“disableDefaultResponse”:true,“direction”:0,“srcEndpoint”:null,“reservedBits”:0,“manufacturerCode”:4655,“transactionSequenceNumber”:null,“writeUndiv”:false})
failed (Status ‘UNSUPPORTED_ATTRIBUTE’)’

This looks like a bug in Z2M. These attributes should not be defined for these switches.

You need to update your firmware to 2.18 for all of those to be available.

Thanks @rohan, I was just writing a post explaining what I’d discovered. Updating to 2.18 doesn’t seem like a desirable solution for folks who want to stay on production firmware, seeing as the latest production firmware is 2.15.

  • These parameters were added starting in firmware 2.17, which is currently in beta.
  • This zigbee-herdsman PR added support for these parameters to the VZM31 switches.
  • All but one of my switches are on firmware versions prior to 2.17. The one switch that is on 2.17 has values populated for these parameters in the Z2M “Exposes” tab and has valid states in the HA device info page.

So the problem is that unless your switches have a beta firmware version installed, current versions of Z2M are going to result in spamming the log with these errors.

So you can’t run production firmware and stay up-to-date with your Z2M version? AFAICT there doesn’t seem to be a way to even detect that you’re about to get into this state when updating Z2M.

I believe that’s a Z2M issue. I’m not aware of it supporting different params at different firmware versions (unlike Z-Wave JS).

That said, I would encourage you to upgrade to 2.18. It’s currently the version shipping with new switches from the manufacturer and has been extensively tested and deemed reliable.

Thanks for that info. The firmware revision page doesn’t even mention 2.18 yet and the GitHub repo still has it in the “beta” folder, so I couldn’t tell if it was ready for use.

This thread should have the latest information on the firmware. It looks like the documentation on the help page hasn’t been updated yet.

This is an interesting discussion though for those that do not want to update their firmware. Some people are in the “if it ain’t broke, why fix it” camp (very few I know). It would be useful to know a workaround in that scenario . . . but I don’t know one at this time.

Some people are in the “if it ain’t broke, why fix it” camp

Especially given your own documentation says, “Beta firmware is considered unstable - please update at your own risk”. :slight_smile:

Also, I was confused as to why these parameters were even here, since the VZM31 isn’t for controlling fans. But I just found your fan controller module and it all clicked.