Page 1 of 1

Using RFXMeter (Electric) from node-red

Posted: Thursday 27 August 2020 13:49
by Jordindc
Hi all,

I'm trying to use a RFXMeter counter (device type = 113, subtype = 0) to show the daily energy production and the total energy produced by my solar installation. I'm sending the next message to mqtt topic domoticz/in:

Code: Select all

{"type":"command","param":"udevice","idx":765,"nvalue":0,"svalue":"2772;7188405"}
and all I can get is, in this case, 2,772 kWh in the top right corner of the device box, and same quantity as total accumulated.

If I send another message later, with a new instant production in Watts and a current total energy produced (kWh), the new instant production is shown either in top right corner as in the middle of the device box.

No idea how RFXMeters are updated from MQTT (or via JSON API, the result is the same).

Any suggestions?

Thanks in advance,

Jordi

Re: Using RFXMeter (Electric) from node-red

Posted: Thursday 27 August 2020 16:02
by FireWizard
Hi,

@Jordindc

You wrote:
I'm trying to use a RFXMeter counter (device type = 113, subtype = 0) to show the daily energy production and the total energy produced by my solar installation.
As you have configured a virtual device of type Electric, you can read at: https://piandmore.wordpress.com/2019/02 ... -domoticz/ under
Electric
The electric sensor will show the current usage of electricity in Watt and the cumulative usage in kWh. You can add digits after the decimal if needed.

{"command":"udevice", "idx":1234, "svalue":"us;cu"}

where us is usage in Watt and cu is cumulative usage in Wh (even though it is displayed in kWh)
1.

As you can see, the command, you send from Node Red by MQTT is not correct. It should be:

Code: Select all

{"command":"udevice","idx":765,"nvalue":0,"svalue":"2772;7188405"}
2. After you have created your virtual sensor, like

Screenshot_Electric Counter1.png
Screenshot_Electric Counter1.png (37.78 KiB) Viewed 1928 times
you should "Edit" the device.

If your device sends the accumulated consumption, you have to set "Energy read" to "From device".

Screenshot_Electric Counter2.png
Screenshot_Electric Counter2.png (31.16 KiB) Viewed 1928 times

Regards

Re: Using RFXMeter (Electric) from node-red

Posted: Thursday 27 August 2020 16:33
by Jordindc
Hi FireWizard, Thanks for your fast reply.

I fixed the message I send, but what I'm getting is the current reading in the top right corner and the cumulative energy from the readings I sent in the Today total. In fact, what I created is a RFXMeter, devices that I'm already using in a python plugin, where what appears in the top right corner is the cumulative daily produced energy and in the middle the absolute total energy produced is shown. In my previous example, 2772 Watts would be aggregated to the daily produced energy and 7188.405 kWh would shown in the middle (with no legend or label).

Re: Using RFXMeter (Electric) from node-red

Posted: Thursday 27 August 2020 16:57
by FireWizard
Hi,

@Jordindc

If I understand you, you have created a "Counter Incremental" and "Energy".

Can you confirm?

Regards

Re: Using RFXMeter (Electric) from node-red

Posted: Thursday 27 August 2020 18:14
by Jordindc
@FireWizard

Hi,

The counter I created from virtual sensor hardware is an Electric (Instant + Counter) device. The RFXMeter is created using JSON url:

Code: Select all

[domoticz_ip:8080]/json.htm?type=createvirtualsensor&idx=29&sensorname=CounterRFX-test&sensortype=113
[domoticz_ip:8080]/json.htm?type=setused&idx=DEVICE_ID&name=RFXMeter&switchtype=0&used=true
In my python plugin I use RFXMeter (created from the plugin)

Regards,

JN

Re: Using RFXMeter (Electric) from node-red

Posted: Friday 28 August 2020 15:10
by FireWizard
Hi,

@Jordindc

I'm trying to use a RFXMeter counter (device type = 113, subtype = 0) to show the daily energy production and the total energy produced by my solar installation. I'm sending the next message to mqtt topic domoticz/in:

Code: Select all

{"type":"command","param":"udevice","idx":765,"nvalue":0,"svalue":"2772;7188405"}

and all I can get is, in this case, 2,772 kWh in the top right corner of the device box, and same quantity as total accumulated.

If I send another message later, with a new instant production in Watts and a current total energy produced (kWh), the new instant production is shown either in top right corner as in the middle of the device box.
I created a virtual device, exactly the way you did with a JSON call.
Tested it, and I noticed exactly the same behavior, as you described. It is according the Wiki: https://www.domoticz.com/wiki/Domoticz_ ... counter.29 and also: https://piandmore.wordpress.com/2019/02 ... -domoticz/

It is sufficient to send only the first value (2772). The second value (7188405) has no effect and is not used. You have already noticed that.

I think you have to use another device as a counter, which has been set to "Energy".

Perhaps P1 Smart meter?

Screenshot_RFX meter.png
Screenshot_RFX meter.png (131.65 KiB) Viewed 1868 times

However I have not figured out how to create a P1 Smart meter device with a JSON call.

Regards,