Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

QuickApp - P1 Monitor power consumption ⚡️


SmartHomeEddy
 Share

Question

This Quickapp retrieves energy consumption, energy production, gas and water usage from the (P1 Monitor) energy, gas and water meter. 

 

Child Devices for Consumption (Watt), Production (Watt), Todays Consumption (kWh), Todays Production (kWh), Gross Consumption (Watt), Device Consumption (Watt), Waterflow (Liter), Consumption High (kWh), Consumption Low (kWh), Production High (kWh), Production Low (kWh), Consumption L1 L2 L3 (Watt), Production L1 L2 and L3 (Watt), Ampere L1 L2 L3 (Amp), Voltage L1 L2 L3 (Volt), Total Gas (m³) and Total Waterflow (m³). 

 

Energy consumption and energy production is added to the (new) HC3 energy panel. 

 

All power consumption of all HomeCenter devices is summarized. The difference between the total power consumption and the power consumption of the HomeCenter devices is put in a unused device (unless the powerID = 0 or empty). 

 

The Child device Todays Consumption can be selected in the Generals Settings as "Main energy meter". Doing so, the summary consumption will be from this device. If not, the consumption will come from the Child device Consumption High, the Child device Consumption Low and all your energy registering Z-wave devices and there values will be counted twice unless you change the Energy panel setting of each energy registering Z-wave device. 

 

Please login or register to see this attachment.

 

Interval: 

It is now possible to process messages from the smart meter every second. Of course, this is only possible if the smart meter actually sends a message every second. This can be turned on via the ztatz software P1 port configuration page via the "maximum processing speed" option. Note that this gives a high(er) load on the Rpi. It has been tested on the Rpi3/Rpi4 and works well on it. Older or other RPIs have not been tested.


BTW The P1 Monitor QuickApp uses 2 API calls each cycle, and if you also use Waterflow, 3 API calls each cycle. With an interval setting of 10 seconds there is an API call every 5 seconds (and with Waterflow enabled, every 3.33 seconds). So the fastest interval setting will probably be 3 seconds with Waterflow and 2 seconds without Waterflow. 
 

 

ToDo as soon as the Yubii Mobile App supports all device types:

  • water -> com.fibaro.waterMeter 
  • ampere/voltage -> com.fibaro.electricMeter
  • gas -> com.fibaro.gasMeter
  • devices with power values (Watt) --> com.fibaro.powerMeter

 


Version 1.5 (4th September 2021)

  • Support of new Energy Panel: 
    • Changed Child device Net Consumption to Main device with type com.fibaro.powerSensor (value can be positive or negative)
    • Added Child device Todays Consumption to show the daily energy consumption in kWh
    • Added Child device Todays Production to show the daily energy production in kWh
    • Changed Child device Consumption High and Low to com.fibaro.energyMeter (kWh in property "value"; "rateType" = consumption). These values will be shown in the new energy panel. 
    • Changed Child device Production High and Low to com.fibaro.energyMeter (kWh in property "value"; "rateType" = production). These values will be shown in the new energy panel. 
    • Added automaticaly change rateType interface of Child device Consumption High and Low to "consumption" and Production High and Low to "production
    • Changed Child device Consumption and Production to type com.fibaro.powerSensor (Watt) to show power graphs
    • Changed Child device Consumption L1, L2 and L3 and Production L1, L2 and L3 to type com.fibaro.powerSensor (Watt) to show power graphs
  • Additional changes:
    • Added todays Maximum consumption and todays Maximum production and timestamp to the label text and Child device log text
    • Added todays Maximum consumption and todays Maximum production automatic format measurement to W, Kw, MW or GW
    • Added todays Consumption low and high (kWh) and todays Production low and high (kWh) to the label text and Child devices log text
    • Added todays Consumption of gas in the label text and Child device log text
    • Added Timestamp in format dd-mm-yyyy hh:mm:ss to log of Main device and labels
    • Placed production below consumption in the labels
    • Solved bug when Production is higher than Consumption with calculation of Gross Consumption (Gross Consumption = Net Consumption minus or plus Device Consumption)

 

Version 1.4 (11th April 2021)

  • Added Child Devices Waterflow and Total Waterflow

 

Version 1.3 (13th February 2021)

  • Added Child Devices for Voltage L1 L2 L3

 

Version 1.2 (6th February 2021)

  • Added a lot of Child Device

 

Version 1.1 (18th January 2021)

  • Solved a bug when powerID = 0

 

Version 1.0 (15th Januari 2021)

  • Changed routine te get Energy Device ID's fast (no more maxNodeID needed)
  • Added "Update Devicelist" button to update the Energy devicelist
  • Added Tarifcode High and Low (and empty for flat fee)
  • Rounded Consumption and Production to zero digits Watt
  • Added Quickapp variable for debug level (1=some, 2=few, 3=all). Recommended default value is 1. 
  • Re-aranged the labels
  • Cleaned up some code

 

Version 0.3 (16th August 2020)

  • Added Quickapp variables for easy configuration
  • Added Power Production
  • Changed method of adding QuickApp variables, so they can be edited


Tested on

  • P1 Monitor version: 20211002 V1.4.1 (see: 

    Please login or register to see this link.

  • Raspberry Pi model: Raspberry Pi 4 Model B Rev 1.1
  • Linux-5.10.63-v7l+-armv7l-with-debian-10.10
  • Python versie: 3.7.3

 

I use a Smart Meter Cable Starter Kit

- Raspberry Pi 4 Model B Rev 1.1 2GB

- 8GB Micro SDHC

- Original Raspberry Pi 4B Enclosure

- Original Raspberry Pi USB-C 3A power supply

- Smart Meter cable 

- P1 Monitor software from: 

Please login or register to see this link.

 

- Water Flow Sensor (M18 8mm sensing DC 5V NPN NO LJ18A3-8-Z/BX-5V cylinder inductive proximity sensor switch work voltage 5VDC special for MCU)

 

 

 

Please login or register to see this image.

/monthly_2020_08/903B0D58-BD03-487D-B599-093590680363.jpeg.4c5501ca5fafa28892e0ac7c64e2c722.jpeg" />             waterflow-sensor.png.c6d38b52168dc6cd5e9aa0f0add2893f.png

 

 

 

 

P1-monitor-1.png.98df79a87caffc2b6a1bc8e44bc86bf1.png   P1-monitor-2.png.5409dba0d08866f2d127d69690c9ac90.png

 

 

Please login or register to see this attachment.

 

 

 

QuickApp variables (mandatory, they will be automatically added with the default values):

  • IPaddress = IP address of your P1 monitor
  • Interval = Number in seconds, the P1 Monitor normally is updated every 10 seconds
  • powerID = ID of the device where you want to capture the 'delta' power, use 0 if you don't want to store the energy consumption
  • debugLevel = Number (1=some, 2=few, 3=all) (default = 1)
  • waterMeter = Existance of watermeter true or false (default = false)

 

 

Download the QuickApp here (download the file and un-zip):

Please login or register to see this link.

or Fibaro Marketplace: 

Please login or register to see this link.

 

P1-monitor-logo.png.c3a78cf6227528f64f6a2aa204b1e5c9.png

 

How to install: 

  1. Open the Configuration Interface
  2. Go to Settings > Devices
  3. Click  +
  4. Choose Other Device
  5. Choose Upload File
  6. Choose file from your computer with .fqa

 

 

 

 

 

 

 

 

Edited by SmartHomeEddy
  • Like 3
Link to comment
Share on other sites

Recommended Posts

  • 1
  • Inquirer
  • Hi @marcelo pires

     

    If you use the P1 Monitor quickapp, you need to have a P1 Monitor with the ztatz.nl software running. The quickapp will try to get the data from the P1 Monitor. 
     

    The Quickapp will sum all energy consumption of your Fibaro devices, who register energy consumption. In de childdevice “device consumption” the energy usage is shown. 

    Link to comment
    Share on other sites

    • 0

    Hello, could you share this QA because I have the same problem with another device and it doesn't read to me from the table. If it works for you, I can do it for my use. Regards

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • A new version with al lot of changes is available:

    • Changed routine te get Energy Device ID's fast (no more maxNodeID needed)
    • Added "Update Devicelist" button to update the Energy devicelist
    • Added Tarifcode High and Low (and empty for flat fee)
    • Rounded Consumption and Production to zero digits Watt
    • Added Quickapp variable for debug level (1=some, 2=few, 3=all). Recommended default value is 1. 
    • Re-aranged the labels
    • Cleaned up some code

     

    Version 1.1:

    • And solved a bug when powerID = 0

     

     

    So to calculate the power consumption of your devices, the maxNodeID is no longer necessary. The Quickapp searches all devices with power consumption every time the Quickapp is started or whenever you use the  "Update Devicelist" button. 
     

    Please login or register to see this attachment.

     

     

    Edited by SmartHomeEddy
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Another new version of the P1 Monitor is available. This time a lot of Child Devices were added to monitor your energy consumption and production. 

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    wow, i wish a day i'll be able to code like you!

    one newby question, do you think can i use this code if i got a z-wave energy meter? 

    i have bought aeotec zw095-c 1p energy meter gen5, i want to make it work..

    what have i to set in your varible?

     

    IP address : have the only ID ad it does not have an IP address,

     

    power ID: aeon have id 245 so i filled 245

    interval 10

     

    debug 1

     

    i guess it's not possible to use this code in mine situation.. is it correct?

     

    got you any suggestion?

    tks!!!!!!!!!!!!

     

     

    Link to comment
    Share on other sites

    • 0

    what have you used? i think i'm going to throw it in the rubbish and buy another thing..

    i'm going to renovate the house.. have you got some suggestion about some din rail hardware or something that you know it's going to work?

    thank you again!

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I use a Smart Meter Cable Starter Kit

    - Raspberry Pi 4 Model B Rev 1.1 2GB

    - 8GB Micro SDHC

    - Original Raspberry Pi 4B Enclosure

    - Original Raspberry Pi USB-C 3A power supply

    - Smart Meter cable 

    - P1 Monitor software from: https://www.ztatz.nl 

     

     

     

    Please login or register to see this link.

    Link to comment
    Share on other sites

    • 0

    Hi @SmartHomeEddy, this sure looks nice!

    There is one thing i don't understand, The P1 just gives you the global usage. Where do you get the detailed usage from? From smart plugs?

     

    thks

    jn

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 4 minutes ago, okidoki said:

    Where do you get the detailed usage from?

    I am a wizzard :-) 

     

    No, the P1 Monitor has several API querys. Look on http://IPAddress/config-API.php. I don’t use any addons. 

    1 hour ago, MarcoSmartForYou said:

    and buy another thing..

    You can buy ready made Kits, see some links in the first post. Or you can order a Raspberry Pi and a cable from shops like AliExpress for less euro but longer delivery. 

    Link to comment
    Share on other sites

    • 0

    Super interesting, going to have a look around and order a Raspberry Pi to test this! Looks like a lot of information.

     

    Thank you for the contribution!

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Thanks @JaapvW You're welcome. 

     

    Those Raspberry Pi run smooth. Today @Winnetoe also got the Raspberry Pi running. In the next version of the quickapp also Voltage is included. I don't think there is much more to extract from the P1 Meter :-) 

     

     

    • Like 1
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Version 1.3 is available, now also with child devices for Voltage (L1, L2, L3)

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...