Page 1 of 1

Managed meters

Posted: Thursday 27 February 2020 11:02
by Barberousse
Hello,

I create this topic to discuss the development of "managed" meters.

Following discussion in these PR :

https://github.com/domoticz/domoticz/pull/2271
https://github.com/domoticz/domoticz/pull/2272
https://github.com/domoticz/domoticz/pull/2417

And recently rejected PR :

https://github.com/domoticz/domoticz/pull/3877

The need : I have now access to official API of French Managed Linky meters. I can grab consumption and production data. These are not realtime data but data from the day before and the whole history. I want to :
  • Introduce data in Domoticz log from a Python plugin, for user to see their consumption easily from Domoticz interface
  • Prevent Domoticz to call UpdateMeter() and AddCalendarUpdateMeter() to do change on this device because it's done from the plugin
First I proposed some patch on existing device, this was not very clean so I created a new device : sTypeManagedCounter, very close to sTypeRFXMeterCount.

To be able to manage production data and 2 tariffs, the PR #3877 create another new device, to be consistent. For @gizmocuz, I should not create another device (I understand, it's cumbersome).

What would be the good strategy for my PR to be accepted: stick to P1 smart meter existing device, and add an option (a bit like #2272 but with no interface, option only accessible from plugins?) to prevent calendar update ?

If I want to be consistent, I would delete the sTypeManagedCounter counter (I think I'm the only one to use it today with https://github.com/guillaumezin/DomoticzLinky) and stick to RFX Meter Counter the same way.

What do you think?

Re: Managed meters

Posted: Thursday 27 February 2020 16:15
by FireWizard
Hi,

Isn't an idea to implement a node in Node Red?

See: https://github.com/PhilBri/Node-Linky.

From there you can send it to Domoticz, e.g. by using MQTT.

Regards

Re: Managed meters

Posted: Thursday 27 February 2020 16:40
by Barberousse
FireWizard wrote: Thursday 27 February 2020 16:15 Isn't an idea to implement a node in Node Red?
But how would I insert data in Domoticz history if no device permits that? The problem is not node-red/MQTT/Lua/Python/etc, the problem is to find a way to write Domoticz history DB using an acceptable and easily maintainable way.

Re: Managed meters

Posted: Sunday 01 March 2020 20:58
by FireWizard
Hi,

You wrote:
But how would I insert data in Domoticz history if no device permits that?
Sorry, I did not understand your question and the exact goal, as I do not know your Linky equipment.

If your goal is to insert data, collected in the past, in the Domoticz database, that is not possible.

However, if you create a virtual sensor of the type you need, you can write from Node Red, with e.g. MQTT, to that specific sensor.
In this case, Domoticz will build up historical data, as for all other type of sensors. But therefore you need more or less real-time data.

I understand, that you only will receive data from the previous day and not real-time.
In that case the received data is old and so you have to look for another solution to create a graph. Perhaps Influxdb and Grafana?
But actually the problem is at Linky and not Domoticz.

Regards

Re: Managed meters

Posted: Sunday 01 March 2020 22:00
by Barberousse
FireWizard wrote: Sunday 01 March 2020 20:58 If you goal is to insert data, collected in the past, in the Domoticz database, that is not possible.
Yes it is: some PR introducted sTypeManagedCounter for that, cf. Managed counter in https://www.domoticz.com/wiki/Developin ... hon_plugin

My question was about how to do the same thing a more generic way. I'm pushing some changes for that here: #3955