Automation to reset power meter of smart plug TS011F

How do I automate the following at midnight ?

Reset energy

To reset “Sum of consumed energy”, use the Dev console and execute: Endpoint: 1
Cluster: 0x00
Command: 0
Payload: (don’t change this)

Next time the plug gets polled, “Sum of consumed energy” will start from zero again.

Source:

TS011F

1 Like

It would be easier to feed the sensor to a utility meter with a daily cycle.

Wouldn’t that require the souce sensor to cycle, as well?

Hi,
I did it this way (grabbed from the zigbee2mqtt logs):
send a message to the device via MQTT:


Or the NodeRed string:

[{"id":"4cb4c95b9d36ee27","type":"group","z":"c594875b20d947f8","name":"Reset Power measures","style":{"fill":"#bfdbef","label":true,"label-position":"n","color":"#000000"},"nodes":["3b9585b2bb0edc50","eebb938d97504ff8","d24b4cbc47a715a5","cd41f699d535f779","d24ed8bbf3930658"],"x":24,"y":269,"w":512,"h":232},{"id":"3b9585b2bb0edc50","type":"mqtt out","z":"c594875b20d947f8","g":"4cb4c95b9d36ee27","name":"Stecker-10","topic":"zigbee2mqtt/Stecker-10/1/set","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"aa6e58243e74ae43","x":440,"y":310,"wires":[]},{"id":"eebb938d97504ff8","type":"inject","z":"c594875b20d947f8","g":"4cb4c95b9d36ee27","name":"Reset kW data Stecker","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"01 00 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":{\"cluster\":0,\"command\":0,\"payload\":{}}}","payloadType":"json","x":180,"y":380,"wires":[["3b9585b2bb0edc50","d24b4cbc47a715a5","cd41f699d535f779","d24ed8bbf3930658"]]},{"id":"d24b4cbc47a715a5","type":"mqtt out","z":"c594875b20d947f8","g":"4cb4c95b9d36ee27","name":"Stecker-11","topic":"zigbee2mqtt/Stecker-11/1/set","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"aa6e58243e74ae43","x":440,"y":360,"wires":[]},{"id":"cd41f699d535f779","type":"mqtt out","z":"c594875b20d947f8","g":"4cb4c95b9d36ee27","name":"Stecker-12","topic":"zigbee2mqtt/Stecker-12/1/set","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"aa6e58243e74ae43","x":440,"y":410,"wires":[]},{"id":"d24ed8bbf3930658","type":"mqtt out","z":"c594875b20d947f8","g":"4cb4c95b9d36ee27","name":"Stecker-13","topic":"zigbee2mqtt/Stecker-13/1/set","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"aa6e58243e74ae43","x":440,"y":460,"wires":[]},{"id":"aa6e58243e74ae43","type":"mqtt-broker","name":"MQTT","broker":"homeassistant","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

I’m sure, that this could also be done by an automation from within HA. The payload would be:

{
    "command": {
        "cluster": 0,
        "command": 0,
        "payload": {}
    }
}

send to the respective topic of the device:

zigbee2mqtt/DEVICE-NAME/1/set

Hope, this helps…
Cheers, big-big

1 Like