currently i’m struggling a bit with how to get a command working to reset f.e. the todays energy meter…
I’ve searched this forum and try to find the answer for myself… but didnt find a solution…
MQTT / Mosquitto is set up and running… i can control normal switches… this all works fine…
I also can successfully call this command in the Tasmota console (both of them work)
accourding to the tasmota command doc the EnergyReset command has been replaced by 3 single commands for Total, Today, Yesterday
working
EnergyToday 1000
cmd/MQTTPlug80/EnergyToday 2000
Not working (without the space)
EnergyToday2000
cmd/MQTTPlug80/EnergyToday2000
How do i need to setup my config in the MainUI to get this space (or the right command) sent?
- id: sensor_energyTodayReset
channelTypeUID: mqtt:switch
label: Sensor Energy Today Reset
description: null
configuration:
commandTopic: cmd/MQTTPlug80/EnergyToday
off: "0"
on: "0"
and here is the log
2022-01-18 00:10:12.497 [DEBUG] [qtt.generic.AbstractMQTTThingHandler] - Successfully published value ON to topic cmd/MQTTPlug80/EnergyToday
==> /var/log/openhab/events.log <==
2022-01-18 00:10:12.481 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'MQTTPlug80_WM_SensorEnergyTodayReset' received command ON
The command seems to be sent… but the value in that topic doesnt reset… I’va also restarted my openhabian twice to be sure all mqtt bindings are picking up the changes…
It should be as simple as that. You certainly do not want to be adding extra spaces and backslashes.
I couldn’t say why it is not working for you. Have you used Mqtt explorer or similar to see what is actually published?
i changed cmd/MQTTPlug80/EnergyToday
to cmnd/MQTTPlug80/EnergyToday
I’ve missed the “n” … dont know why the “wrong” command was working in Tasmota console… maybe thats why i assumed that something in OH is wrong wih my config…
Its now working… Thanks for your help Rossko!
EDIT:
I’ve now removed the “0” value from the OFF command to not get the energy measurement deleted by accident if the switch receives the OFF command…
- id: sensor_energyTodayReset
channelTypeUID: mqtt:switch
label: Sensor Energy Today Reset
description: null
configuration:
commandTopic: cmd/MQTTPlug80/EnergyToday
off: ""
on: "0"