TuYa 4 Button Scene Switch (TS004F)

Hi Guys,

I fear this is a rookie question. I have a TuYa 4 button switch. Its given me nothing but grief. I have it hooked up via Zigbee2MQTT. I can see its traffic on the Z2M web interface, it works. I can pick up the traffic in HA via the log file, I can see the automation trigger, but nothing happens when I press the buttons.

Debugging it I can see the blueprint is setup and IS receiving the message. However, its producing an error "Error: In template condition: UndefinedError: None has no attribute split ".

Digging into it, I found this:

So what I can see is happening here, is the deviceName is null, so when we hit the deviceName.split() it obviously fails. So, based on this I assume there is a defect in the blueprint. Looking at it, it would seem the line deviceName.split() should read something to read the trigger payload attribute, or the command attribute.

The question is, how do I fix it?

1 Like

With this blueprint I believe the problem is you can not have any spaces in the device name.

Not entirely sure, but it uses the mqtt trigger. Some of the other blueprints use states for trigger, and they work with spaces in the name. However, easy just to rename devices in Z2M