Using smart meter interface for power meter over P1 with Tasmota and MQTT,

943 views
Skip to first unread message

Eyvind Johansson

unread,
Dec 15, 2021, 1:56:55 PM12/15/21
to TasmotaUsers
I have managed to get a D1mini (ESP8266) to read the serial output from P1 port on my Sagemcom T211 power meter.
Using smart meter interface according to the instruction and example script found here 

and the Web UI from the device shows accurate reading with Unit of measurement, but the sensor that is auto discovered in Homeassistant has no unit of measurement. 

I wonder if anyone has managed to set up something similar and if there is a possibility to use the script in Tasmota to send the MQTT label including unit of measurement?

Also I have tried to use customise function but no change in the attributes of the sensors.Screenshot 2021-12-15 at 19.56.15.png

Here is my script for reference.

>D
>B
;smlj=0
->sensor53 r
>R
;smlj=0
>S
;if upsecs>22
;then
;smlj=1
;endif
>M 1
+1,3,o,16,115200,,1
1,1-0:1.8.0(@1,Meter reading import,kWh,enrg_imp,3
1,1-0:2.8.1(@1,Meter reading export,kWh,enrg_exp,3
1,=h—————————————
1,0:1.7.0(@1,power import,kW,power_imp,3
1,0:2.7.0(@1,power export,kW,power_exp,3
;1,13.7.0(@1,Power factor,,factor,3
1,32.7.0(@1,L1 Voltage,V,volt_l1,1
1,52.7.0(@1,L2 Voltage,V,volt_l2,1
1,72.7.0(@1,L3 Voltage,V,volt_l3,1
;1,0:14.7.0(@1,Frequency,Hz,freq,2
1,31.7.0(@1,L1 Current,A,amp_l1,2
1,51.7.0(@1,L2 Current,A,amp_l2,2
1,71.7.0(@1,L3 Current,A,amp_l3,2
1,0:3.8.0(@1,Reactive import,kvarh,renrg_imp,3
1,0:4.8.0(@1,Reactive export,kvarh,renrg_exp,3
;1,0:98.1.0(@(0:#,Month date,,month_date,3
1,=h—————————————
;1,0:96.13.0(@#),Message,,msg,0
;1,0-0:96.1.0(@#),Serial no,,sn,0
#
Screenshot 2021-12-15 at 19.52.59.pngScreenshot 2021-12-15 at 19.55.15.png

Philip Knowles

unread,
Dec 16, 2021, 12:53:46 AM12/16/21
to Eyvind Johansson, TasmotaUsers
What does the MQTT message look like in Console as it looks like it should be sending UoM?

Regards

Phil K


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Eyvind Johansson <eyv...@gmail.com>
Sent: Wednesday, December 15, 2021 6:56:55 PM
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Using smart meter interface for power meter over P1 with Tasmota and 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 on the web, visit https://groups.google.com/d/msgid/sonoffusers/ac160d0c-8cd8-4a4e-b2e5-ed5cb6e17815n%40googlegroups.com.

Eyvind Johansson

unread,
Dec 26, 2021, 11:04:41 AM12/26/21
to TasmotaUsers

Ended up coding for all sensors with yaml, that way they come out correct in HA and wasn't that much work after all. 

17:02:59.453 MQT: tele/P1CE1ECD/SENSOR = {"Time":"2021-12-26T17:02:59","P1":{"enrg_imp":1189.866,"enrg_exp":0.000,"power_imp":3.356,"power":0.000,"volt_l1":228.9,"volt_l2":236.9,"volt_l3":236.6,"freq":0.00,"amp_l1":9.20,"amp_l2":4.30,"amp_l3":3.80,"renrg_imp":224.258,"renrg_exp":42.235}}

No UoM that I can see in the message. The script also only contains MQTT label, but I never figured out how that works.

Thanks for your attention!

Eyvind
Reply all
Reply to author
Forward
0 new messages