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

Energy manager connected to a smart meter, Values in a VD


Question

Posted

Just started with the HC2 and for sure completly new to LUA.
I already had an Iungo Energy manager to get the usage on electricity and gas from the smart meter, and also the water usage.
At this stage I managed to get a reponse from the energy manager, but didn't succeed to get the values for use in a virtual device.
 
I hope someone can give me a suggestion to put me in the right direction on how to get the values from the response.

Please login or register to see this code.

Response received is:

 

[DEBUG] 15:07:30: 200
[DEBUG] 15:07:30: 0

[DEBUG] 15:07:30: ENCODE RESULT :"{\"ok\":true,\"type\":\"response\",\"time\":0.001937499968335,\"rv\":{\"propsval\":[{\"id\":\"name\",\"value\":\"Smart meter\"},{\"id\":\"usage\",\"value\":362},{\"id\":\"T1\",\"value\":4113.167},{\"id\":\"T2\",\"value\":2884.556},{\"id\":\"-T1\",\"value\":0},{\"id\":\"-T2\",\"value\":0},{\"id\":\"L1I\",\"value\":1},{\"id\":\"L1Pimp\",\"value\":0.362},{\"id\":\"L1Pexp\",\"value\":0},{\"id\":\"c_tariff\",\"value\":2},{\"id\":\"gas_usage\",\"value\":0},{\"id\":\"gas\",\"value\":1681.49},{\"id\":\"Cost-T1\",\"value\":0.2166},{\"id\":\"Cost-T2\",\"value\":0.2166},{\"id\":\"Cost-nT1\",\"value\":0},{\"id\":\"Cost-nT2\",\"value\":0},{\"id\":\"Cost-gas\",\"value\":0.597},{\"id\":\"Client-blob\",\"value\":\"\"},{\"id\":\"available\",\"value\":true}]},\"systime\":1456149950,\"seq\":1,\"error\":false}"

 

Recommended Posts

  • 0
Posted

sorry, I don't can't help you. I have the iungo Lite and no support for ZWave. Therefore I have the Fibaro HC2.

One ZWave controller is enough...

Nice site you have, and Dutch no probleem "Leest voor mij ook een stuk makkelijker:-)) 

 

Twan

  • 0
Posted

To those who want to look through the api of the IUNGO, here are the acces links;

 

in your webbrowser type the following URL;

 

<local IUNGO IP>/iungo/control?cmd=api_list (for all API requests supported bij the API)

 

<local IUNGO IP>/iungo/control?cmd=graph (overview of all connected devices and their OID)

 

<local IUNGO IP>/iungo/control?cmd=objects (for webinterface connecting to all objects in the API)

 

WARNING; This will give you unrestricted access to the IUNGO and changes made may result in a disfunctioning device!

 

Hope this is usefull for some of you!

 

Henk

 

  • 0
Posted
On 25-2-2016 at 10:53 PM, Mr Jack said:
Strange behaviour of the virtual device that I made.

 

It stops exactly after 34 minutes.

 

 

When I save it, it starts again and after 34 minutes it stops.

 

 

Tested it 5 times this evening.

 

 

 

 

 

Somebody any idea what could cause this?

 

Mr Jack, a virtual device does not support pausing as in a scène.

 

i have removed the sleep command and created a scène that triggers the button that contains the code in the VD

If you set the scène to run automatically and have it start when the HC starts, you are done.

here is my example

 

Please login or register to see this code.

2

Please login or register to see this code.

3

Please login or register to see this code.

4

Please login or register to see this code.

5

Please login or register to see this code.

6

Please login or register to see this code.

7

Please login or register to see this code.

8

Please login or register to see this code.

9

Please login or register to see this code.

10

Please login or register to see this code.

11

Please login or register to see this code.

12

Please login or register to see this code.

13

Please login or register to see this code.

14

Please login or register to see this code.

15

Please login or register to see this code.

16

Please login or register to see this code.

17

Please login or register to see this code.

18

Please login or register to see this code.

19

Please login or register to see this code.

 

 

  • 0
Posted (edited)

see post from Jack; scene stops after 30 minutes;

 

I had the same issue in the beginning.

The first part of the code needs to be the following

 

f(smartmeter==nil) then

smartmeter=Net.FHttp('xxx.xxx.xxx.xx'); --IP Address Iungo
else

 

and then at the end of the code you need to add:   end

Edited by twanve
  • 0
Posted

Hello All,

 

Starting to implement Iungo with zero experience.

Tried the complete VD en changed ip address and object ID. Noting works (for me). So I started like Jack.

I did marked out water consumption for now, with "--" not used jet

 

got the message with debug:

[ERROR] 14:41:11: line 11: attempt to index global 'smartmeter' (a nil value)

Can someone help me in the write direction?

 

Please login or register to see this code.

 

  • 0
Posted

@Zaanhoeve;

 

check this first;

- go to: http://192.168.0.37/iungo/control?cmd=api_list

- click; object_list_props_values

- insert old: 2204995f (check this te right number)

- check the propval numbers in the value (counting from first line) are the same as below

Please login or register to see this code.

 
  • 0
Posted

or try this;

 

if(smartmeter==nil) then
smartmeter=Net.FHttp('192.168.0.37'); --IP Address Iungo
else

  • 0
  • Inquirer
  • Posted (edited)
    On 29-12-2016 at 10:24 AM, H.Lourens said:

    @twanve, correct, and this works.

    however I would like to extend the code. 

     

    Iungo supports Zwave powerplugs with metering and once connected to the gateway theorie values should also be retrievable from the API. To do that you need the unique OID for that device.

     

    therefore my question was how you could use the api to retrieve the OID's

     

    thx for the reaction though.

     

    see also for examples; 

    Please login or register to see this link.

     (sorry it is in dutch for all the international users) Not my personal website, just aan infosource.

     

     

     

    HC2 @ 4.100

    Hue inetgration

    SONOS integration

    Netatmo thermostat integration

    Logitech Harmony Hub integration

    IFTTT integration

     

    Hi H. Lourens,

     

    Did you manage to get the power plugs intergated?

    This is how I have done this.

    It;s part of my Iungo VD

    Please login or register to see this code.

    In the above, I write the values to variables that I use in an other VD

    EP01s is the status: On or Off

    EP01u is the actual usage in Watt

    EP01e is the enegry usages in kWh

     

    The OID for each switch can be found here <IP of your Inungo>/iungo/control?cmd=objects

     

    Edited by Mr Jack
    • 0
  • Inquirer
  • Posted

    BTW, I have also created VD's for the power plugs assigned to iungo.

    This will show you the state, (ON/OFF), power usage (W), and energy usage kWh in the HC2.

    It will also allow you to control the power plug in the HC2 through the Iungo.

     

    Please login or register to see this image.

    /monthly_2017_02/58a82756b6cec_VDPowerPlugviaIungo.PNG.a33ac2249ff839835b9fe89dd5482392.PNG" alt="VD PowerPlug via Iungo.PNG" />

     

    Please login or register to see this attachment.

    • 0
  • Inquirer
  • Posted

    @zaanhoeve

     Change HC2 to smartmeter in the beginning of your code. See below

    Please login or register to see this code.

    • 0
    Posted

    How to calculate daily usage?

     

    Say: it's now 7:00am morning : Usage from 0:00 till 7:00,  is now already 7kWh, then update every minute  till the day is over. So not a usages of 24 hours but a usage of a day. maybe this data can be taken out from the iungo box?

     

    • 0
  • Inquirer
  • Posted
    On 2017-5-5 at 2:51 PM, samuel said:

    How to calculate daily usage?

     

    Say: it's now 7:00am morning : Usage from 0:00 till 7:00,  is now already 7kWh, then update every minute  till the day is over. So not a usages of 24 hours but a usage of a day. maybe this data can be taken out from the iungo box?

     

    Hi Samuel,

     

    You already have that in Your Fibaro, if you have done the full integration of the iungo in the HC2.

     

     

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    • 0
    Posted (edited)

    where can i find the full intergration from iungo to hc2? which version of  VD is this ?

    Edited by samuel
    • 0
    Posted

    how can i display the values Kwh from yesterday in a VD and current usage from today in the VD ?

    like:

    yesterday: 5Kwh

    today:  3,5 Kwh  (from 0:00 this day, until now )

     

    Thanks for sharing and your help

    • 0
    Posted

    Hello, @Mr Jack

     

    Is there any way to use the vd for the power usage with an Aeotec energy meter? Thank you!

    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...