Page 1 of 1
Virtual Smart Meter log
Posted: Tuesday 05 November 2024 0:52
by jmcvieira
Hello
First of all, thank you for developing Domoticz, I have been using Domoticz for about three years, I recently did a hardware upgrade and with this I installed the latest version of Domoticz on Windows (2024.7) from this day on my Virtual smart meter does not show the correct values in the log on the power graph (Watt) After testing other older versions I found that the last one where the virtual smart meter works correctly is the Domoticz 2024.4. To test I used a new database with just one virtual smart meter, I would appreciate it if someone tested it too as I can't find any information from anyone reporting this anomaly.

- Domoticz 2024.7
- Screenshot 2024-11-04 at 22-57-33 Domoticz.png (133.58 KiB) Viewed 3716 times
Same test with version Domoticz 2024.4

- Domoticz 2024.4
- Screenshot 2024-11-04 at 22-54-23 Domoticz.png (117.55 KiB) Viewed 3716 times
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 8:01
by waltervl
As it is a virtual smart meter it is important to know how you fill that Domoticz device. As this Domoticz version 2024. is out for some months now it seems you are doing something different with this device than normal, else we would have a lot more users having your issue.
Also what kind of device are you monitoring? It should be the grid connection of your house. If you monitor Solar panels or some other single appliance you better use a virtual Electricity (instant and counter) device,
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 12:56
by jmcvieira
Thanks
I believe that if it were a bug there would already be someone else complaining, I use an ESP8266/PZM004T with espeasy software and this rule, Publish domoticz/in,'{"command":"udevice", "idx":1, "svalue":"[PZEM#Energy_kWH];10;[mem#kwh];20;[PZEM#Power_W];100"}'
On mqtt explorer i have this: on domoticz/in
{"command":"udevice","idx":1,"svalue":"36504;10;2173;20;1128;100"}
the same script works well up to version 2024.4 and then something changed and I still couldn't find the correct way to update the smart meter from the following versions 2024.6 and 2024.7.
To test, I installed a version of Domoticz 2024.7 on Docker compose, with a new database and the result is the same.
On the dashboard the information is correct and the counters work correctly:

- Screenshot 2024-11-05 at 12-09-39 Domoticz.png (43.46 KiB) Viewed 3696 times
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 14:13
by waltervl
MQTT normally follows the API definition
https://www.domoticz.com/wiki/Domoticz_ ... mart_meter
svalue=USAGE1;USAGE2;RETURN1;RETURN2;CONS;PROD
USAGE1= integer, total cumulative energy usage meter tariff 1 in Wh. ==> [PZEM#Energy_kWH] is this a total counter?
USAGE2= integer, total cumulative energy usage meter tariff 2 in Wh. ==> 10? why not 0?
RETURN1= integer, total cumulative energy return meter tariff 1 in Wh. ==> [mem#kwh] What is this?
RETURN2= integer, total cumulative energy return meter tariff 2 in Wh. ==> 20? why not 0?
CONS= actual usage power (Watt) ==> [PZEM#Power_W]
PROD= actual return power (Watt) ==> 100? why not 0?
The [mem#kwh] is a strange value. Is that the return counter?
Edit: You should also check your browser cache as there were some graph changes on this. Perhaps you are having issues on web scripting in the new version (using old scripts). Use a incognito/private browser session to test.
And as you are testing in Docker, also check the latest 2024.7 beta...
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 15:16
by jmcvieira
Thanks
The "[mem#kwh]" this is the return counter ,this is a variable in espeasy coming from another esp8266 module with a pzm004T that monitors my solar production and transmits the values via espeasy P2P network and so I can integrate all the values in the same message, today there is no sun and as such there is no production I replaced the values of "0" to test.
I've already tested sending a message with fixed values, Publish domoticz/in,'{"command":"udevice", "idx":1, "svalue":"20000;10000;40000;20;200;100 "}' just to test and the result is the same, I tested on three different computers clearing the cache and in incognito mode I used Chrome, Firefox and Brave and the result is the same, yesterday I tested the beta version of Domoticz on Windows 2024_7 .16325 same result, I ran out of options that's why I made this post, in the hope that someone using domoticz 2024-6 or -7 will create a virtual smart meter and fill it with a fixed count just to test, and see what is the type of log visible in Domoticz.
this is a message captured by mqtt explorer:
{"command":"udevice","idx":1,"svalue":"36507;10;2174;20;1052;100"} this is the message that is published in "domoticz/in" I can't see any formatting error in values.
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 17:25
by waltervl
Perhaps play a bit with the "P1 Electricity report display setting" as shown in wiki page:
https://www.domoticz.com/wiki/Applicati ... alculation
Are there commas or dots in the values coming from ESP as it seems the high values Watt are ignored.
For testing you have to be sure the total counter values for Usage and Return are increasing. The values of CONS and PROD can fluctuate and that should be visible in the graphs (every 5 minutes). In the Domoticz log (Setup > Log) there is also not something strange to see? No messages about incorrect MQTT data received?
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 18:23
by jmcvieira
"Perhaps play a bit with the "P1 Electricity report display setting" as shown in wiki page:
https://www.domoticz.com/wiki/Applicati ... alculation" ------I already did this and didn't get any improvement.
"Are there commas or dots in the values coming from ESP as it seems the high values Watt are ignored."------I've already tested sending the value without decimal places and I didn't get any improvement.
For testing you have to be sure the total counter values for Usage and Return are increasing. The values of CONS and PROD can fluctuate and that should be visible in the graphs (every 5 minutes). In the Domoticz log (Setup > Log) there is also not something strange to see? No messages about incorrect MQTT data received?
At the moment only the consumption counter goes up and the return counter doesn't go up because there's no sun and there's no production, but I've had sunny days and the graph in the log remained the same even with the counter going up and the power fluctuating normally.
There is no error in the domoticz log about incorrect MQTT data received,
the mqtt explorer is the proof that the msg is being published correctly.
If I just reinstall version 2024.4 of domoticz and the graph in the log works normally again as it always did, I'm tired of installing, uninstalling, trying this and that and I haven't come up with anything definitive, I threw down the towel and came to ask for help, thank you.
Edit:
In my poor understanding, if the message with the values was not formatted correctly, Domoticz would complain and the error would be visible in the log, this has already happened to me in other situations, if the instantaneous values are visible on the dashboard, it is a sign that Domoticz accepted the values, am I thinking correctly?
The instantaneous values are updated as soon as a new message arrives:

- Capturar.JPG (34.74 KiB) Viewed 3654 times
But if I open the log this is what I see:

- Capturar1.JPG (86.19 KiB) Viewed 3654 times
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 19:16
by waltervl
Are you sending only once per half hour a message or more messages? As it looks you only send a message approx every 30 minutes.
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 19:52
by waltervl
And looking to the widget showing a factor 1000 higher Watt value than in the graph I still believe you have a javascript issue.
The webbrowser for the new Domoticz is using the old javascript....
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 19:58
by jmcvieira
waltervl wrote: Tuesday 05 November 2024 19:16
Are you sending only once per half hour a message or more messages? As it looks you only send a message approx every 30 minutes.
Esp sends a new message every 5s (five seconds)
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 20:16
by jmcvieira
waltervl wrote: Tuesday 05 November 2024 19:52
And looking to the widget showing a factor 1000 higher Watt value than in the graph I still believe you have a javascript issue.
The webbrowser for the new Domoticz is using the old javascript....
I just tested it on another machine where I never opened this domoticz server, I updated Firefox and cleaned the cache first, the result was the same...

- Screenshot 2024-11-05 at 19-07-26 Domoticz.png (56.23 KiB) Viewed 3645 times

- Screenshot 2024-11-05 at 19-09-05 Domoticz.png (165.88 KiB) Viewed 3645 times

- Screenshot 2024-11-05 at 19-10-36 Domoticz.png (111.51 KiB) Viewed 3645 times
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 21:18
by waltervl
Officially all values sent to Domoticz by MQTT for P1 should be integers so no commas or dots at all....
Further I have no idea what is going wrong with you. I do not have MQTT and on my test environment where I fill a P1 with a dzvents script everything is going fine.....
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 21:44
by jmcvieira
I made sure and from Esp that the power and total Kwh counter do not have decimal places, and this is confirmed by the message received in domoticz/in {"command":"udevice","idx":1,"svalue" :"36519;10;2174;20;1545;100"}
Thanks for all the help.

- Screenshot 2024-11-05 at 20-35-18 Energia.png (15.24 KiB) Viewed 3629 times
Re: Virtual Smart Meter log
Posted: Tuesday 05 November 2024 23:26
by waltervl
Ah, energy (kWh) should be multiplied by 1000 as Domoticz expects the values in Wh instead of kWh:
{"command":"udevice","idx":1,"svalue" :"36519000;10;2174000;20;1545;100"}
Re: Virtual Smart Meter log
Posted: Wednesday 06 November 2024 2:02
by jmcvieira
I just remove the divisor value from the energy counters in the domoticz setup, that's enough for me. This is just a test setup, I didn't even bother changing the parameters every time I cleaned the installation and reinstalled it several times until I came to the conclusion that only versions 2024.6 and 2024.7 present this anomaly.
thanks for your help.

- Screenshot 2024-11-06 at 00-44-52 Domoticz.png (61.62 KiB) Viewed 3604 times

- Screenshot 2024-11-06 at 00-45-30 Domoticz.png (26.07 KiB) Viewed 3604 times

- Screenshot 2024-11-06 at 01-00-06 Domoticz.png (145.17 KiB) Viewed 3604 times
Re: Virtual Smart Meter log
Posted: Wednesday 06 November 2024 14:13
by gizmocuz
As mentioned, you need to send the values in Wh... if you ever going to add zwave/zigbee devices or other MQTT kWh sensors, you will get yourself in trouble
Re: Virtual Smart Meter log
Posted: Wednesday 06 November 2024 14:30
by jmcvieira
I will do that thank´s
Re: Virtual Smart Meter log
Posted: Saturday 09 November 2024 13:58
by jmcvieira
I would like someone using mqtt to be able to test its proper functioning by communicating with a virtual smart meter and see what is the result of the power graph in its log, I think I tested everything I could, and the graph is not displayed correctly but just from version 2024.6 and up including beta.