May 3, 2015

How to make the WPC work in Domoticz


Updated 2016-12-04: Updated to reflect Mattias new lua-script.


Here are some short steps to get the WPC working in Domoticz.

1. Enable the X10 protocol.
In Domoticz: Click Setup and then Hardware. Click Set Mode for the RFXtrx433(E). Check the X10 checkbox if not already checked.
The WPC should after this, be shown as a RFXMeter
(In Domoticz you can fully ignore the other type of protocol the WPC transmits. i.e. Temperature/Humidity sensor with ID 4600)

2. Turn on and find the WPC in Domoticz.
In this step, the WPC does not need to be mounted to your electrical meter or Gas meter or whatever you like to count. It just need to be powered on and within range of the RFXtrx433(E)
Click Setup then Devices. Click the button All Devices and locate the RFXMeter sensor in the list. The WPC transmits a signal immediately at power on, and the once every 60 seconds, so it should be found in the list.

3. Add the RFXMeter to your list of Used sensors.
Click the green circle with white arrow pointing to the right, on the right most side of the page.
If it is a blue circle, it is already added to your list of Used sensors.

4. Name your RFXMeter sensor.
Click on the tab Utility in the top. Locate the RFXMeter, and click Edit and give it a name of your choice. This name will be used further down in this list. Also choose Type Energy in the dropdown list (if that is what you like to measure).

5. Add device that show Power consumption [W].
To be able to not only see Energy [Wh] but also see the Power usage [W], please download this excellent lua-script from one of my customers (credit to Mattias Hedström), https://github.com/mrhedstrom/domoticz/blob/master/scripts/lua/script_device_ActualEnergy.lua
To make it work, you need to follow step 5.1 to 5.3 below.

5.1 Create an Electric virtual sensor.
Click Setup and then Hardware. As Type, choose Dummy... Add a name and click Add.
From the newly created Dummy-device, click Create Virtual Sensors. In the drop-down list choose Electric...
Click Setup and then Devices. Click All devices. You should be able to find your newly created Electric virtual sensor. Make note of its idx for later use.

5.2 Modify the script to fit your local settings.
energyCounter: This should be the same string as the name you gave to the RFXMeter in step 4 above.
dummyEnergyMeter: This should be the same string as the name you gave to the Electric Virtual Sensor created in step 5.1
dummyEnergyMeterid: Use the idx integer of the Electric Virtual Sensor created in step 5.1 above.
Now all the software is in place and you should get reports once every minute from the WPC to Domoticz.

5.3 Place the updated script in the Domoticz subfolder <path-to-domoticz>/scripts/lua/

6. Mount your WPC in a secure and light tight fashion onto your Energy meter and enjoy your graphs in Domoticz.


Credit to Mattias Hedström and Patrik Nordelind for helping out making this list.