lokonli / domoticz-wallbox

1 stars 2 forks source link

Session Energy not logged to DB #2

Closed sincze closed 1 year ago

sincze commented 1 year ago

Great plugin. I noticed that Session Energy is not logging the data to the Database. I think it should with your AddDBLogEntry = true. Device is created as Managed Counter "Managed counter will not transfer automatically every day data from device status to history log, it's up to an external script or plugin to insert data in history log database (useful to show non realtime consumption of energy provider that put energy information "in the cloud")."

Should it have been created as a counter maybe?? Or is that going to fail if we would have 2 charging sessions on 1 day?

           { #7
                "Unit": self.DEVICEENERGY,
                "Name": "Session Energy",
                "Type": 243,
                "Subtype": 33,
                "Switchtype": 0,
                "Options": {
                          "DisableLogAutoUpdate" : "true",
                          "AddDBLogEntry" : "true",
#                          "Custom": "1;kWh"
                    }
            },
lokonli commented 1 year ago

That will indeed not work when there are two sessions on one day.

A PR was already created, which I just merged.

With this new version of the plugin (0.0.2) a new Domoticz device will be created which will give total energy counter.

Can you test version 0.0.2?

sincze commented 1 year ago

hehe I first need to enable allow new hardware otherwise this plugin does not create the devices.

image
lokonli commented 1 year ago

I'll close this issue.