Tasmota device sends incorrect data via MQTT

15 views
Skip to first unread message

Christian Brandau

unread,
Feb 11, 2026, 2:46:52 AM (9 days ago) Feb 11
to TasmotaUsers
I have an infrared reading head on my electric meter ("Hichi" with Tasmota). Transfering the data via MQTT to Domotics works for actual power and export counter. But for the import counter I get these errors in Domoticz:

Error: Invalid Number sValue: '%' for device idx: '%'
Error: GetJSonDevices: exception occurred : 'stoull'

I am non-tech-guy but at least I have learned that the MQTT transfer of the Tasmota device sends incorrect data and causes inconsistent Data in the Database.

The console in the Tasmota device shows no errors. This is the code of the customized script that runs in the Tasmota device and it displays correct data in the Tasmota web interface. 

>D
>B
=>sensor53 r
>M 1
+1,3,s,0,9600,,1
1,77070100010800FF@100000000,Zählerstand Import ,kWh,1_8_0,8
1,77070100010801FF@1000,Zählerstand Import T1 ,kWh,1_8_1,8
;1,77070100010802FF@100000000,Energie Bezug T2,kWh,1_8_2,8
1,77070100020800FF@100000000,Zählerstand Export,kWh,2_8_0,8
1,77070100100700FF@1,Summe Verbrauch 🔌,W,16_7_0,16
1,77070100240700FF@1,akt. Verbrauch L1,W,36_7_0,16
1,77070100380700FF@1,akt. Verbrauch L2,W,56_7_0,16
1,770701004C0700FF@1,akt. Verbrauch L3,W,76_7_0,16
#

Even the non-customized Script for my electric meter from the Tasmota wiki shows the same behaviour:

Does anyone have a hint for me if and how I could adjust something in the Tasmota Device?

Christian Brandau

unread,
Feb 11, 2026, 2:52:24 AM (9 days ago) Feb 11
to TasmotaUsers
1000027849.png

Philip Knowles

unread,
Feb 11, 2026, 8:23:48 AM (9 days ago) Feb 11
to Christian Brandau, TasmotaUsers
I would guess that the issue is actually in Domoticz. It would be useful to show either the console output of the transmission or from MQTTExplorer plus your Domoticz configuration page in Tasmota The error looks to be that the number is out of the expected range


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Christian Brandau <christia...@gmail.com>
Sent: Wednesday, February 11, 2026 07:52
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Re: Tasmota device sends incorrect data via MQTT
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/sonoffusers/fec0f1f0-4488-4539-af20-e78cb42777bbn%40googlegroups.com.

Christian Brandau

unread,
Feb 11, 2026, 12:02:26 PM (9 days ago) Feb 11
to TasmotaUsers
I had a look into the Tasmota console and found out, that for for actual power (Watt) and export counter (kWh) a single svalue is transferred via MQTT. But for the import counter, two svalues are send.

=====Two svalues: ======
14:26:29.442 MQT: domoticz/in = {"idx":529,"nvalue":0,"svalue":"10440;10441.8","Battery":100,"RSSI":10}

======Only one svalue: ======
14:26:29.446 MQT: domoticz/in = {"idx":362,"nvalue":0,"svalue":"5620.7","Battery":100,"RSSI":10}

======Only one svalue: ======
14:26:29.450 MQT: domoticz/in = {"idx":447,"nvalue":0,"svalue":"256.7","Battery":100,"RSSI":10}

14:26:29.457 MQT: tele/Hichi_Lesekopf/SENSOR = {"Time":"2026-02-11T14:26:29","":{"1_8_0":10441.77938763,"1_8_1":10440.78400000,"2_8_0":5620.68320843,"16_7_0":257,"36_7_0":36,"56_7_0":92,"76_7_0":129}}

I need just the "1_8_0" import counter, but the "1_8_1" is also tranfered.

Is there any chance to force Tasmota to deliver just one svalue?

Philip Knowles

unread,
Feb 11, 2026, 12:31:57 PM (9 days ago) Feb 11
to Christian Brandau, TasmotaUsers
Commenting out  (;) the following line from your script may fix it (or break it)

1,77070100010801FF@1000,Zählerstand Import T1 ,kWh,1_8_1,8

It seems to be set to get the readings for 2 tariffs and Domoticz is only expecting one.


Sent: Wednesday, February 11, 2026 17:02

Philip Knowles

unread,
Feb 11, 2026, 12:31:58 PM (9 days ago) Feb 11
to Christian Brandau, TasmotaUsers

Christian Brandau

unread,
Feb 11, 2026, 1:53:29 PM (9 days ago) Feb 11
to TasmotaUsers

Thx for this hint. Tried it, but then it is replaced by another value (power of a single phase).  I think using "configure domoticz" is outdated and I have to find another way of getting data into domoticz .

.yyyyScreenshot 2026-02-11 195206.png

Philip Knowles

unread,
Feb 11, 2026, 4:00:59 PM (9 days ago) Feb 11
to Christian Brandau, TasmotaUsers
Did the T1 value disappear from the UI display?

Sent: 11 February 2026 18:53

Christian Brandau

unread,
Feb 11, 2026, 4:28:31 PM (9 days ago) Feb 11
to Philip Knowles, TasmotaUsers
Yes, it is not displayed anymore. Data transfer via MQTT remains - but with shifted figures.


Sent via mobile device

Philip Knowles

unread,
Feb 11, 2026, 4:31:26 PM (9 days ago) Feb 11
to Christian Brandau, TasmotaUsers
There are a couple of possibilities
The config page shows idx4 is 755 but  Tasmota is sending 529 (the other 2 are, correctly, 363 and 447). Not sure whether that's important
The other is that, looking at Domoticz it seems to expect 2 parameters both the instantaneous power and the consumption
Electricity (instant and counter)
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=POWER;ENERGY
  • IDX = id of your device (This number can be found in the devices tab in the column "IDX")
  • POWER = current power (W)
  • ENERGY = Integer, total cumulative energy in Watt-hours (Wh)
(Energy Read type (use edit button to change): Default: From Device. If the device is not able to send the ENERGY counter values you choose "Energy read : Computed". This will ignore ENERGY counter values and Domoticz will calculate the Energy (kWh) internally based on the (previous/current) POWER (Watt) values. By design this is less accurate then using the ENERGY counter when using them "from Device".)
Domoticz will calculate the today values based on the delta's in the total cumulative energy of today.
For Counters the standard counter dividers apply (menu setup - settings - tab counters)
Note: This device will show in Domoticz as type "General, kWh"
Which also matches the description of idx4 in the configuration. I think Tasmota needs to send  the incoming Watts followed by the meter reading and it's not. Not sure how you do that - perhaps allocate power in to 1_8_0 and the meter reading to 1_8_1


Sent: Wednesday, February 11, 2026 18:53

Christian Brandau

unread,
Feb 11, 2026, 4:42:16 PM (9 days ago) Feb 11
to Philip Knowles, TasmotaUsers
Oh - sorry for the confusion with IDX 529 and 755. I was testing with different device types in Domoticz and the two Screenshots have several hours of time difference.

In Domoticz I only want to receive one kWh value of 1_8_0. But IDX 4 of Tasmot always delivers two values.


Sent via mobile device

Philip Knowles

unread,
Feb 11, 2026, 4:59:34 PM (9 days ago) Feb 11
to christia...@gmail.com, TasmotaUsers
The problem seems to be that Domoticz expects two values - power and  energy - and Tasmota is taking 1_8_0 as power and 1_8_1 as energy
It might be worth trying
1,77070100100700FF@1,Leistung,W,16_7_0,18

>D
>B
=>sensor53 r
>M 1
+1,3,s,0,9600,,1
1,77070100100700FF@1,Leistung,W,1_8_0,8
1,77070100010800FF@100000000,Zählerstand Import ,kWh,1_8_1,8
;1,77070100010801FF@1000,Zählerstand Import T1 ,kWh,1_8_1,8
;1,77070100010802FF@100000000,Energie Bezug T2,kWh,1_8_2,8
1,77070100020800FF@100000000,Zählerstand Export,kWh,2_8_0,8
1,77070100100700FF@1,Summe Verbrauch 🔌,W,16_7_0,16
1,77070100240700FF@1,akt. Verbrauch L1,W,36_7_0,16
1,77070100380700FF@1,akt. Verbrauch L2,W,56_7_0,16
1,770701004C0700FF@1,akt. Verbrauch L3,W,76_7_0,16
#

And see what happens

From: Christian Brandau <christia...@gmail.com>
Sent: Wednesday, February 11, 2026 21:41
To: Philip Knowles <knowles...@gmail.com>
Cc: TasmotaUsers <sonof...@googlegroups.com>

Christian Brandau

unread,
Feb 12, 2026, 5:58:36 AM (8 days ago) Feb 12
to TasmotaUsers
Bingo! This works. What a great service of you. And even with a perfact translation of "power" into German "Leistung" ;-)

Now I receive a data format like expected by Domoticz - and even with the correct energy figure I really want (1_8_0 instead of 1_8_1).

Old status with two energy figures:
MQT: domoticz/in = {"idx":755,"nvalue":0,"svalue":"10460;10461.5","Battery":100,"RSSI":10}

New status with energy and power:
MQT: domoticz/in = {"idx":755,"nvalue":0,"svalue":"10461.5;132.5","Battery":100,"RSSI":10}

Thank you very, very much!

Philip Knowles

unread,
Feb 12, 2026, 7:28:28 AM (8 days ago) Feb 12
to Christian Brandau, TasmotaUsers
Glad it working. Thank Tasmota for the translation - just looked on the Smart Meter page

Sent: 12 February 2026 10:58
Reply all
Reply to author
Forward
0 new messages