zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

SONOFF S60ZBTPF - Power reading frozen when off

Open iksela opened this issue 1 year ago • 18 comments

What happened?

As long as the plug is on, the power reporting works well. When set to off, the power reading stays to the last value. When set back to on, the power reading starts again.

Image

What did you expect to happen?

Power reading should go back to 0 (or whatever the plug is consuming)

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

2.6.0

Adapter firmware version

6.10.3.0 build 297

Adapter

EZSP v8

Setup

Linux, docker image Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux Debian GNU/Linux 11

Device database.db entry

{"id":5,"type":"Router","ieeeAddr":"0xa4c13803065dffff","nwkAddr":1203,"manufId":4742,"manufName":"SONOFF","powerSource":"Mains (single phase)","modelId":"S60ZBTPF","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,3,4,5,6,1794,2820,2821,64599,64529],"outClusterList":[10,25],"clusters":{"genBasic":{"attributes":{"modelId":"S60ZBTPF","manufacturerName":"SONOFF","powerSource":1,"zclVersion":3,"appVersion":16,"stackVersion":2,"hwVersion":16,"dateCode":"20250411","swBuildId":"1.0.2"}},"customClusterEwelink":{"attributes":{"28675":"\u0004\u000b\u0001\u0000\u0001�6\u0000\u0000P�1\u0000","acCurrentCurrentValue":0,"acCurrentVoltageValue":238451,"acCurrentPowerValue":8082,"outlet_control_protect":0,"energyYesterday":0,"energyToday":0,"energyMonth":0,"faultCode":50462720}},"genOnOff":{"attributes":{"onOff":0,"startUpOnOff":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x6c5cb1fffe993d41","endpointID":1},{"cluster":64529,"type":"endpoint","deviceIeeeAddress":"0x6c5cb1fffe993d41","endpointID":1}],"configuredReportings":[{"cluster":64529,"attrId":28682,"minRepIntval":60,"maxRepIntval":3600,"repChange":50},{"cluster":64529,"attrId":28683,"minRepIntval":60,"maxRepIntval":3600,"repChange":50},{"cluster":64529,"attrId":28681,"minRepIntval":60,"maxRepIntval":3600,"repChange":50},{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":65000,"repChange":1},{"cluster":64529,"attrId":28678,"minRepIntval":10,"maxRepIntval":30,"repChange":1}],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":16,"stackVersion":2,"hwVersion":16,"dateCode":"20250411","swBuildId":"1.0.2","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":332242049},"lastSeen":1756895332749}

Debug log

No response

iksela avatar Sep 03 '25 10:09 iksela

Tested against 2.6.1 - issue is still there.

Image

iksela avatar Sep 10 '25 06:09 iksela

Same problem here, and the fix in this issue did not work for me

chrisnav avatar Sep 12 '25 19:09 chrisnav

Fixed!

Changes will be available in the dev branch in a few hours from now and in the next release which is every 1st of the month.

Koenkk avatar Sep 13 '25 18:09 Koenkk

Fixed!

Changes will be available in the dev branch in a few hours from now and in the next release which is every 1st of the month.

Thanks Koenkk. Just checked the newest dev branch. So its working partially. The "Current" drops to 0 when switching off. However the "Power" stays still at the old value. So whatever you did to get the "Current" to 0 you have to do it to the "Power" as well.

Regards Michél

mfb-bbg avatar Oct 01 '25 17:10 mfb-bbg

It should do it for both power and current, seems something is wrong, can you provide the debug log?

Koenkk avatar Oct 01 '25 18:10 Koenkk

Attached the log. I had a quick look in the log as well and you can see that power and current went both to zero right after switch off. So you are right. However, for some reason, on the next message the power comes back.

log.log

mfb-bbg avatar Oct 02 '25 04:10 mfb-bbg

This contains only the info logging, could you provide the debug one?

See this on how to enable debug logging.

Koenkk avatar Oct 02 '25 18:10 Koenkk

Sorry i had debug on but i copied from the frontend, not from the logfile. Attached the debug log. Same behavior as already mentioned, when switched off then power is set to 0. But on the next message is back to the old value.

log.log

second log, already grouped with 3 on/off cycle zigbee_reiskocher_blocks.log

mfb-bbg avatar Oct 03 '25 05:10 mfb-bbg

Pushed another fix, can you check if it works?

Changes will be available in the dev branch in a few hours from now and in the next release which is every 1st of the month.

Koenkk avatar Oct 03 '25 18:10 Koenkk

Hi @Koenkk,

First of all: the latest fix works great for the OFF case — both power and current reliably go to 0. 👍

However, I’m seeing an intermittent issue after switching ON: sometimes current remains 0 while power reports a non-zero value.

Let me know if you’d like additional traces or logs.

z2m_reiskocher_blocks.log

mfb-bbg avatar Oct 05 '25 06:10 mfb-bbg

It seems the device doesn't always report the new current value, maybe because it didn't change enough, can you try to change the reporting change for acCurrentCurrentValue in the device reporting tab? If that doesn't help what we can do is, when turning ON, to restore the current value to the one before it was turned OFF. (does that make any sense?)

Koenkk avatar Oct 05 '25 13:10 Koenkk

Thanks, that did the trick!

acCurrentCurrentValue wasn’t present in the reporting tab by default, so I added it and set:

  • Min interval: 1
  • Max interval: 60
  • Min change: 2 (Edit)

Since then, current updates reliably after ON—works like a charm. If possible, consider adding this reporting config as a default for the S60ZBTPF so others get the correct behavior out of the box.

Thanks again!

Image

EDIT: However …I’m seeing a periodic refresh ~60s after turning OFF that sets current back to its old non-zero value, while power correctly remains 0. I guess that is the report at max interval even if no change, but it reintroduces a stale current reading when the relay is OFF.

Summary OFF: power stays 0 ✅ (thanks to the new clamp) OFF: current periodically “rebounds” to the last value after ~Max interval (e.g., 60s) ❌ ON: both power and current are fine

Suggestion Apply the same OFF clamp to acCurrentCurrentValue as you did for acCurrentPowerValue Maybe like that? but I'm not an expert :-)

            m.numeric<"customClusterEwelink", SonoffEwelink>({
                name: "current",
                cluster: "customClusterEwelink",
                attribute: "acCurrentCurrentValue",
                description: "Current",
                unit: "A",
                access: "STATE_GET",
                reporting: {min: "10_SECONDS", max: "MAX", change: 1},
                fzConvert: (model, msg, publish, options, meta) => {
                    // Device keeps reporting a acCurrentCurrentValue after turning OFF.
                    // Make sure Current = 0 when turned OFF
                    // https://github.com/Koenkk/zigbee2mqtt/issues/28470
                    if ("acCurrentCurrentValue" in msg.data) {
                        return {current: meta.state.state === "ON" ? msg.data.acCurrentCurrentValue / 1000 : 0};
                    }
                },    
            }),

If helpful, I can attach filtered logs showing: OFF → immediate current=0, and ~60s later → a periodic report setting current back to the previous non-zero value (while power remains 0).

Thanks again for the quick power fix!

mfb-bbg avatar Oct 05 '25 15:10 mfb-bbg

Apply the same OFF clamp to acCurrentCurrentValue as you did for acCurrentPowerValue

Since then, current updates reliably after ON—works like a charm.

done both!

Changes will be available in the dev branch in a few hours from now and in the next release which is every 1st of the month.

Koenkk avatar Oct 05 '25 18:10 Koenkk

Brilliant! Now its perfect! Tested a couple of times and its always showing as expected. Thanks a lot for your effort.

Image

mfb-bbg avatar Oct 06 '25 04:10 mfb-bbg

Confirm works too.

panther7 avatar Nov 04 '25 06:11 panther7

Upgraded so the latest version and confirmed also. Thanks!

iksela avatar Nov 04 '25 06:11 iksela

Hi, About this, you fixed it ok in regards to watt usage but there still is current usage. Please update that too. Thanks

esszopo avatar Nov 22 '25 13:11 esszopo

sorry, my bad my setup had a hickup. no updates

esszopo avatar Nov 22 '25 13:11 esszopo