New Sonoff S40 Lite Zigbee Plug (US)

Anyone have one of these yet? Any opinions on whether to get the S31 or S40? Newer is not always better.

SONOFF S40 Lite 15A Zigbee Smart Plug with ETL Certified, Works with SmartThings, and Amazon Echo Plus, Hub Needed for Amazon Alexa - -

saw this on reddit
I just got an S40 to play with. Not only is it not DIY friendly, it has no LAN control option at all in the settings on the eWelink app either.

1 Like

Not good, but sounds like you’re talking about the wifi version.

I’m looking at the zigbee. I went ahead and ordered one. Should be here Thursday. Returns are easy if it’s bad.

If you are using Zigbee2MQTT the S40 is not currently supported. My pull request to add support was just added today, but I can provide you the external converter file to support it in the meantime!

Sort of expected it would need to be added. I was planning to take a stab at it if need be, but won’t turn down the file if you have it handy.

1 Like

Sure! its basically the same as the S31

The s40lite.js file needs to be added in the same folder as your configuration.yaml, and the configuration.yaml modified to include it.

configuration.yaml snippet

  - s40lite.js


const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['S40LITE'],
    model: 'S40ZBTPB',
    vendor: 'SONOFF',
    description: '15A Zigbee Smart Plug',
    extend: extend.switch(),
    fromZigbee: [fz.on_off_skip_duplicate_transaction],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);

module.exports = definition;


Thanks @tinkerfish

I think I could have managed it myself(copy S31 converter to an external converter and update), but it was very nice to have it cut and paste ready.

The S40 was on my door porch when I got home. Works just fine with your provided converter.

For anyone else landing here, the device pairs and functions in z2m using @tinkerfish’s converter. The July z2m release should have it included since his PR has been merged.

I can also confirm the S40 works in stock ZHA as of HA v2022.5.5.

1 Like

I just got two of these in this morning and made an external converter for them, but this one is better than mine. I didn’t realize that these were so new when I ordered them :joy:

1 Like

Tinkerfish…I am using Zigbee2MQTT with the SONOFF Zigbee 3.0 USB Dongle Plus. I did upgraded the firmware. It is working great with Aqara, sonoff sensor and other.
I bought 2 Sonoff Plugs, Zigbee devices, S40LITE… the “new devices” in question here. I was able to pair them with the Zigbee2MQTT, I can see them in the list but have not entities associated with them. Pretty much like it was talked here.
I did follow up your steps, but I was not able to make it work.

I created a the s40lite.js file and added to my config file, then I open the configuration.yaml and I added those to lines…

  • s40lite.js

I reboot it, and nothing happens…am I doing something really wrong here ??

Screen Shot 2022-06-13 at 11.04.46 PM

The .js file needs to be in the zigbee2mqtt folder (/config/zigbee2mqtt).

The “external converters” section needs to be added to z2m’s configuration.yaml (/config/zigbee2mqtt/configuration.yaml), not HA’s configuration.yaml.


I really appreciate the clarification, after making the changes on the folders, my new Sonoff Plugs are visible and now I can really use them.

I appreciate the support from this great community.

Thank you @jerrm … you save me so much time !!!


I just noticed my S40 Lites power on in the off state after a power failure, and that it does not honor the power on state setting.

Anybody have S40 Lites that remember the last power state?
See: Sonoff S40 Lite Power On State UNSUPPORTED_ATTRIBUTE · Issue #16941 · Koenkk/zigbee2mqtt · GitHub

I understand this thread is 1.5 years old but anyone else had/have issues pairing these to Z2M? I recently purchased 4x of these, and whilst pairing I get encountered with ‘unsupported device’ message.
HA core 2023.11.6.
Adding s40lite.js into configuration.yaml allows pairing but can’t control power-on behavior or other attributes.

I have 10 sonoff s31 lite which work like a charm.

The S31 supports power on config?

I didn’t think the S40 did.

The S40 is recognized for me with z2m 1.33.