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

? Reading out the all-over energy status and inputting it into HC2


rowi

Question

Hi there,

 

I just got my poweropti from

Please login or register to see this link.

. This device reads out the current power consumption of the whole house via infrared on the measurement device. There is an API (German manual

Please login or register to see this link.

) so I thought about reading this out every now and then and inputting it into my HC2, so I have the overall consumption status. 

To be honest, I have no clue on how I can do this.

Please login or register to see this link.

is a german manual in how to connect this to OpenHAB. Are there any similarities between OpenHAB and fibaro HC2, so I could adapt this script to my HC2?

 

Would be great if somebody could give me a hint!

 

Best regards,

Rolf

Link to comment
Share on other sites

Recommended Posts

  • 1

You could start with studying this VD. I read actual power usage and put it in a “spare” device (but with a different P1 power monitor). 
 

I think with some copy, past and adjust you could get it running. 
 

 

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • I still didn't get it work. As of now I already get what I want from my energy meter, especially the current amount of Watts I'm pulling. 

    I thought of simply using a http-request to the HC2 for inputting it every 10 seconds, something like described here:

     

    Please login or register to see this link.

     

    But using something like http://192.168.111.111/api/energy/now-3600/now/single/devices/power/999 just reads out from the HC2, but I need it the other way around.

     

    Isn't there an easier way so even I could do this? 

    Edited by rowi
    Link to comment
    Share on other sites

    • 1

    In the VD I calculate the difference between the power used by z-wave devices and the total power usage. The difference I put in a double switch (I only use one of the two) so the HC2 can use it in the energy panel. 
     

    This is the line to put the power usage in a device:

     

    Please login or register to see this code.


    (powerID is the device to put the power usage in, delta_power is the variable that contains the power usage I calculated)

    Link to comment
    Share on other sites

    • 1

    I calculate the power consumption from all devices with this lines of code. (I know the total power consumption from the P1 Meter, so I can calculate the power consumption from the other devices in the house.) 

     

    Please login or register to see this code.

     

    I don't think, but I don't know much from Hue, Hue devices have a power property you can read out this way. 

     

    Link to comment
    Share on other sites

    • 0

    Hue devices do not have power property as far as I know

    I get my total power through 2 Youless and VD's I created so I have total power, solar output and even water

    There is always a difference in total power from the HC2 and the P1 port in my case because the HUE is not monitored

    I notice the HUE has power so I can put it into the HUE maybe, i will try

    Link to comment
    Share on other sites

    • 0

    If I do:

    api.put("/devices/"..728, {["properties"]={["power"]=10}})

    that is the exact code to put 10W into device 728, right?

    Link to comment
    Share on other sites

    • 0

    It stays 0 with that code or do I have to put something above of does the HC2 LUA recognize api.put in a scene like that?

    Link to comment
    Share on other sites

    • 1
    5 hours ago, Twannie said:

    api.put("/devices/"..728, {["properties"]={["power"]=10}})

     

    Please login or register to see this code.

     

    They look the same. I don't think the difference in variables versus the value will change the behavior. I use(d) it in a VD (now in a QuickApp). 

    Link to comment
    Share on other sites

    • 1

    It was a VD, to measure every 10 seconds the power usage from the P1 Monitor and the power usage calculation from all devices. 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Now I simplified the original code as much as I could to understand. I have an external server where ich can get a value (just three bytes like "123", this is the amount of watts I'm currently using in my house). I now get it from the server (every 3 or so seconds, can I change this?) but I can't put it as a green value in the lower left corner of the VD, so it doesn't get recognized as a value. I'm aware my other devices will simply add to that overall amount and I would need to subtract, but I just wanna get stared here first.

     

    Please login or register to see this code.

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 1
    On 11/18/2020 at 7:23 PM, Twannie said:

    And what sort of device is POWERID in your case?


    (it is the device where you put the power measurement in)

    Link to comment
    Share on other sites

    • 1
    18 minutes ago, rowi said:

    I now get it from the server (every 3 or so seconds, can I change this?)


    you can put in

    Please login or register to see this code.

    For a 8 second pauze, for example

     

    20 minutes ago, rowi said:

    but I can't put it as a green value in the lower left corner of the VD, so it doesn't get recognized as a value

     

    maybe you have to make it a value with

    Please login or register to see this code.

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Still doesn't work. I just have imported the .vfib from the working example, not the LUA. Is that a problem? 

    I read somewhere that you need to have a "power capable device" to use power metering, so some people used another device that is capable but is not using that. I just use my virtual device, nothing else. Is that the problem?

     

    I guess I'm really close to my solution, just the power consumption needs to be recognized as such in the virtual device. 

     

    Anything else I can do? Also printed out the device ID, this is correct.

    Maybe there's a http request where I can check the device? 

     

    Edit: http://192.168.1.100/api/energy/now-3600/now/single/devices/power/234 gives me:
    {"id":1,"kWh":0.0,"W":0.0,"min":0.0,"max":0.0,"avg":0.0}

     

    but an existing device on ID 20 (fibaro wallplug gives me):

    {"id":1,"kWh":0.03,"W":35.5,"min":17.3,"max":73.3,"avg":0.0}

     

    Is this a must to fill out all of the values that it works?

     

    I use the HC2, Ver 4.600

    Edited by rowi
    Additional info
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 hour ago, SmartHomeEddy said:

    I use a double switch, one of it I don’t use, to put the power consumption in. 

    So the power switch needs to be configured in the system and then I physically disconnect it, put it back in the shelf but use the data which is still there?

    I tried to just send data to an existing ID of a device (fibaro wallplug) but this didn't work.

    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.

    ×
    ×
    • Create New...