Sorry if this has already been answered. I did try searching, but got tons of threads, read a few of them, but the actual issue wasnt part of them…
My problem is, I have a Sonoff POW R2 (tasmota) device set up using MQTT, which is working fine…
However, I cant seem to get an item to update on a topic, which doesnt change… Only those topics which changes will update…
How can I force an update to a mqtt topic… is it even possible.
I tried restart OH, but that didnt help. I havn´t tried disconnect the thing and reconnect it. I believe this is not the way to do it at all. (I have a few, for ones I preferere not to toggle the switch. Infact I wish I could get the same device without the switch opputunity at all).
This is the message from the Tasmota consol:
18:36:04 MQT: tele/sonoffPOW1/SENSOR = {"Time":"2019-12-27T18:36:04","ENERGY":{"TotalStartTime":"2019-09-07T18:16:01","Total":87.303,"Yesterday":0.476,"Today":0.851,"Period":0,"Power":1,"ApparentPower":8,"ReactivePower":8,"Factor":0.15,"Voltage":235,"Current":0.034}}
The topic “TotalStarTime” is the one which doesnt update in OH, because it´s quite static.
The same goes for Power ON (the actual switch operation). It only updates if I toggle the switch. But OH doesnt read its state, if it doesnt change…
18:39:04 MQT: tele/sonoffPOW1/STATE = {"Time":"2019-12-27T18:39:04","Uptime":"49T21:46:21","Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"ON","Wifi":{"AP":1,"SSId":"Kepler","BSSId":"FC:EC:DA:17:CF:64","Channel":11,"RSSI":86,"LinkCount":677,"Downtime":"0T00:46:50"}}
Is this only possible by storing its previous state in a mapdb and then read it from there?
I´m not sure, but isn´t there something about mapdb cant store string values? (like the first with the datetime). Storing previous state is a option I havnt played with yet.
This is my mqtt things:
Thing topic sonoffpow1 "Sonoff Pow1 " @ "A Room" {
Channels:
Type string : reachable "Reachable" [ stateTopic="tele/sonoffPOW1/LWT" ]
Type switch : power "Power" [ stateTopic="stat/sonoffPOW1/POWER", commandTopic="cmnd/sonoffPOW1/POWER" ]
Type number : powerload "Power load" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Power"]
Type number : voltage "Line voltage" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Voltage"]
Type number : current "Line current" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Current"]
Type number : total "Total energy today" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Today"]
Type number : totalyest "Total energy yesterday" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Yesterday"]
Type number : totalall "Total energy alltime" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Total"]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/sonoffPOW1/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
Type number : period "Energy Period" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Period"]
Type string : starttime "Start time" [ stateTopic="tele/sonoffPOW1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.TotalStartTime"]
}