robertraaijmakers / com.iungo

Homey Iungo app
1 stars 1 forks source link

Iungo - Homey - Sun total #21

Open MarcelZwolle opened 2 years ago

MarcelZwolle commented 2 years ago

I have a question / problem with the Iungo app on Homey. I have a lot of electricity meters (11, and the P1 used for total) everything is working OK, Except the sun meter and 'back delivery' on the P1 meter. When I go to the Iungo page I can see the total energy my sun-installation has delivered, when I go to the app, I only the the actual kWh and a '-' at the total. (Better can explain it by pictures: https://i.postimg.cc/bJKjnd0t/Knipsel.png total from the webpage from Iungo, see 'eletriciteit' and 'zon' https://i.postimg.cc/Hs0CJYrr/Knipsel1.png no total, only actual. https://i.postimg.cc/y69M51XL/Knipsel2.png other meters are working OK (for using energy, only delivering to the supplier wont work)

Did I do something wrong? Or is there an error in the app?

robertraaijmakers commented 2 years ago

Hi Marcel,

The total is not available directly in the Iungo API and has to be calculated by the Iungo App for Homey. This is done based on three values available in the Iungo API. The formula is: offset + (pulstotal / ppkwh) If one of these 3 values is not available in the API the formula can't be calculated and thus the - can show up in your screen.

You can try to see what response you get on the following URL: <>/iungo/api_request/objmgr_get_objects_init You can find your solar device somewhere in the big JSON that is returned and there you can verify if you see the offset, pulstotal and ppkwh values filled. If any of those is empty, then that is the issue of the value not being displayed.

If they are all filled, then I have to look a bit further to see if I can find anything why this is happening.

robertraaijmakers commented 2 years ago

@MarcelZwolle what kind of devices do you use to measure your energy consumption per group (and even per device; your cooking plate)? And how did they end up in Homey?

MarcelZwolle commented 2 years ago

You can try to see what response you get on the following URL: <>/iungo/api_request/objmgr_get_objects_init You can find your solar device somewhere in the big JSON that is returned and there you can verify if you see the offset, pulstotal and ppkwh values filled. If any of those is empty, then that is the issue of the value not being displayed.

If they are all filled, then I have to look a bit further to see if I can find anything why this is happening.

I only get this string in return: {"ok":false,"type":"response","time":3.125099465251e-05,"rv":false,"error":"Error parsing JSON","systime":1646118172} Don't know what I'm seeing, hope you do...

@MarcelZwolle what kind of devices do you use to measure your energy consumption per group (and even per device; your cooking plate)? And how did they end up in Homey?

I have 11 kWh meters connected by modbus to the Iungo (every group has its own meter, so that's why you see cooking (its using 2 groups, so 2 meters..), dishwasher and so on on seperate readouts in Iungo) and I only used your app to connect the Iungo on Homey! (And they are all there!)

robertraaijmakers commented 1 year ago

Hi @MarcelZwolle it has been quite some time. If you still want I can have a look to see if I can add some things. I figured that the browser thing doesn't work anymore. Can you execute the following steps?

  1. Open the developer tools (F12 als je in Chrome zit)
  2. Open the tab "Console"
  3. Past the following code there and update your IP to your Iungo IP (you can find your Iungo IP here: http://www.atedec.com/iungo/myiungoip)
    fetch('http://192.168.178.13/iungo/api_request', {
    method: 'POST',
    body: JSON.stringify({
    seq: 1,
    method: 'objmgr_get_objects_init',
    arguments: []
    }),
    headers: {
    'Content-type': 'application/json; charset=UTF-8'
    }
    })
    .then(res => res.json())
    .then(console.log)
  4. Share the result here
MarcelZwolle commented 1 year ago

Oeps, that didn't do any good.... Now non of the meters are working on the homey app anymore! (they still work on the iungo webpage) See these: https://postimg.cc/Tyr78Kkw https://postimg.cc/Sn9V8Xbr

Hope you have a solution!

robertraaijmakers commented 1 year ago

Hi Marcel, the query shouldn't have any influence on that as it simply requests something from a given IP. But maybe something else is wrong as well. Does your Iungo have a fixed IP in your network? If so, restarting Homey should bring your devices back online.

MarcelZwolle commented 1 year ago

The Iungo has a fixed IP adres. After a restart from the homey it worked again.

But still the 'problem' that if you take a look at the webpage of the Iungo you see the total of the amount (kWh) that you have delivered on the net, but not in the app through homey

robertraaijmakers commented 1 year ago

Mooi, laten we even naar NL overgaan, want anders ben ik NL en Engelse termen door elkaar aan het gebruiken :)

Voor de "Totaal Opbrengst" van de "Zonnepanelen" wordt onderwater een formule toegepast: solarMeter["meter_power"] = offset + (pulstotal / ppkwh);

Kan jij achterhalen welke waarden die variabelen hebben aan jouw kant? Dat zou dus moeten kunnen met die éne call van 3 dagen geleden, als je die uitvoert in de browser terwijl je in de Iungo app zit. Dan krijg je een lijst te zien met alle devices. Eén daarvan is de zon device, en daar zou je dan bovenstaande properties in moeten herkennen.

Als je geen respons krijgt zou je ook kunnen kijken of het lukt door de seq: 1 op te hogen naar b.v. seq: 999999.

Als je de waarden offset, pulstotal en ppkwh op een andere manier uit de Iungo app weet te destileren zou ook mooi zijn.

DionvanHulst commented 2 months ago

Hallo Robert, ik heb eenzelfde issue met mijn modbus kWh meter voor de zonnepanelen. als ik de http://ip/iungo/api_request/objmgr_get_objects_init run krijg ik indedaad een grote json, hierin kan ik van de modbus kWh meter diverse waardes vinden vermogen, import, export, phase power en voltage. Zou je deze kunnen toevoegen aan de app zodat deze inzichtelijk worden in homey?

hierbij ook een sectie van de JSON waar de data van de modbus meter staat. {"driver":"energy-solar-sdm630-modbus", "name":"Meter_Solar", "oid":"xxxxxxxx", "propsval":[ {"id":"name","value":"Meter_Solar"}, {"id":"solar","value":-0}, {"id":"import","value":8.553}, {"id":"export","value":9398.043}, {"id":"L1P","value":0}, {"id":"L2P","value":0}, {"id":"L3P","value":0}, {"id":"inverted","value":false}, {"id":"logu","value":false}, {"id":"connection","value":"-"}, {"id":"functiongroup","value":"solar"} ], "propertyInfo":[ {"type":"string","label":"Name","id":"name","writable":true,"persistent":true}, {"type":"number","label":"Energy output","id":"solar","log":true,"unit":"W"}, {"type":"number","label":"import","id":"import","writable":false,"persistent":true,"unit":"kWh","default":0,"log":true,"cumulative":true}, {"type":"number","label":"export","id":"export","writable":false,"persistent":true,"unit":"kWh","default":0,"log":true,"cumulative":true}, {"type":"number","label":"L1 Power","id":"L1P","log":true,"unit":"W"}, {"type":"number","label":"L2 Power","id":"L2P","log":true,"unit":"W"}, {"type":"number","label":"L3 Power","id":"L3P","log":true,"unit":"W"}, {"type":"number","label":"L1 Volt","id":"L1U","log":true,"unit":"V"}, {"type":"number","label":"L2 Volt","id":"L2U","log":true,"unit":"V"}, {"type":"number","label":"L3 Volt","id":"L3U","log":true,"unit":"V"}, {"type":"boolean","default":false,"label":"inverted","id":"inverted","writable":true,"persistent":true}, {"type":"boolean","default":false,"label":"log phase voltage","id":"logu","writable":true,"persistent":true}, {"type":"enum","default":"-","label":"Connection","id":"connection","writable":false,"range":"-","persistent":false}, {"type":"enum","default":"solar","label":"Functiongroup","id":"functiongroup","writable":true,"range":"solar,wind","persistent":true}],"uid":"2","type":"solar"}