Replies: 2 comments
-
For most purposes, it is much worse atomizing into separate topics, which can be quite a hassle to put back into coherent observations. Actually, I'd recommend to get used to JSON being pretty easy to parse in common tools to use backend, and Tasmota is always using JSON as the flexible format for publishing data. Still, while I'm not using scripting, I'd expect it to be feasible to do something like what can be done with rules (not available at the same time as scripting), where you can pick up each value separately, and then do a publish. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick response. I had hoped that it might be very easy to do in the script. Then I think I will deal with reading out the json. |
Beta Was this translation helpful? Give feedback.
-
Hey all,
i use a ir reader to read my smartmeter. I use this script:
.>D
.>B
=>sensor53 r
.>M 1
+1,3,o,0,9600,LK13BE
1,1-0:1.8.0255(@1,Gesamtverbrauch,kWh,total,4
1,1-0:1.8.096(@1,Verbrauch 1 Tag,kWh,total_1d,4
1,1-0:1.8.097(@1,Verbrauch 7 Tage,kWh,total_7d,4
1,1-0:1.8.098(@1,Verbrauch 30 Tage,kWh,total_30d,4
1,1-0:1.8.099(@1,Verbrauch 365 Tage,kWh,total_365d,4
1,1-0:16.7.0255(@1,Verbrauch aktuell,W,current,20
1,1-0:2.8.0*255(@1,Gesamteinspeisung,kWh,total_out,4
all works fine and the datas are read.
Now i enable mqtt. The mqtt broker receives all Data on topic /tele/tasmota_9CD4E6 on SENSOR = {... like "total": 251.0000 or "current": -3251.0000
Is it possible to send all not as json rather the raw data seperatly to a topic ? e.g.
"total" to topic /tele/tasmota_9CD4E6/total/
"total_1" to topic /tele/tasmota_9CD4E6/total_1/
"total_7" to topic /tele/tasmota_9CD4E6/total_7/
"current" to topic /tele/tasmota_9CD4E6/current/
Hope anyone can help me with an example. Have a nice day!
Beta Was this translation helpful? Give feedback.
All reactions