ioBroker / AdapterRequests

This Place is used to track the status of new Adapter-Requests.
248 stars 36 forks source link

Adapter für GoodWe Inverter Wechselrichter #610

Open zonfacter opened 3 years ago

zonfacter commented 3 years ago

What kind of device or service you would like to see an adapter for? Add name and company of the device, including links to the device and any additional informations[...] GoodWe Solar Wechselrichter , https://de.goodwe.com/

Is an official API including documentation is available? If yes please add links and informations[...] http://sems.com.cn:82/Help/

Additional context Add any other context or screenshots about the feature request here. If the topic was discussed in ioBroker forum please include the link too.

https://github.com/search?q=goodwe

https://www.domoticz.com/forum/viewtopic.php?t=28983 Python Plugin: GoodWe solar inverter via SEMS API https://github.com/dylian94/domoticz-GoodWeSEMS https://forum.iobroker.net/topic/34626/goodwe-wechselrichter-und-iobroker https://github.com/mletenay/home-assistant-goodwe-inverter https://github.com/TimSoethout/goodwe-sems-home-assistant

https://github.com/jantenhove/GoodWeLogger Connecting RS485 converter to ESP8266

Es wäre schön wenn sich jemand findet der einen Adapter Zaubert.... Ich habe es nach der Anleitung von diesen Beitrag auch geschaft die daten in iobroker zu bekommen https://forum.iobroker.net/topic/34626/goodwe-wechselrichter-und-iobroker Ich denke das es aber auch schöner wäre dies über einen Adapter zu lösen.

micbuh commented 3 years ago

edit, changed script since goodwe suddenly changed the response from 'success' to 'successful'

hab das bei mir über ein Script gelöst. Da fehlt noch Errorhandling, aber es funktioniert.... Es werden nicht alle Daten der Sems API in Datenpunkte gewandelt. Ggf. diese Zeile anpassen: iter('0_userdata.0.goodwe.inverter_full', poll_response.data.inverter[0].invert_full);

var sems_account    = 'username';
var sems_password   = 'password';
var sems_station_id = 'xxxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxxxx'; 
/*****************************************************************************/

function iter(name, obj) {
    for(let i in obj) {
        if(typeof obj[i] == 'object')
            iter(name + '.' + i, obj[i]);
        else {
            if(existsObject(name + '.' + i)){ //existsState() fails.
                setState(name + '.' + i, obj[i]);
            } else { 
                createState(name + '.' + i, obj[i]); // type: "mixed"
            }
        }
    }
}

function poll_sems(){
    var request = require('request');
    var auth_options = {
        url: 'http://euapi.sems.com.cn:82/api/v1/Common/CrossLogin',
        method: 'POST',
        headers: {
                'Content-Type': 'application/json',
                'Accept': 'application/json',
                'token': JSON.stringify({client: "web", version: "v2.1.0",language: "en" })
        },
        form:{
            'account' : sems_account,
            'pwd' : sems_password
        }   
    };

    request(auth_options,function (error, response, body){
        var auth_response = JSON.parse(body);
        //log(auth_response);

        if(auth_response.msg.toLowerCase() == 'success' || auth_response.msg.toLowerCase() == 'successful'){
            log("sems login ok");
            var poll_options = {
                url: 'http://euapi.sems.com.cn:82/api/v1/PowerStation/GetMonitorDetailByPowerstationId',
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json',                                    
                    'token': JSON.stringify({   version   : 'v2.1.0',
                                                client    : 'web',
                                                language  : 'en',
                                                timestamp : auth_response.data.timestamp,
                                                uid       : auth_response.data.uid,
                                                token     : auth_response.data.token,
                                            })

                },
                form:{
                    'powerStationId' : sems_station_id,
                }   
            };

            request(poll_options,function (error, response, body){
                if (!error){
                    log("sems got data");
                    var poll_response = JSON.parse(body);
                    //log(poll_response);
                    iter('0_userdata.0.goodwe.inverter_full', poll_response.data.inverter[0].invert_full);

                }
            });

        } else {
            log("sems login failed");
        }
    });
}

poll_sems();
schedule("*/3 * * * *", poll_sems);
zonfacter commented 3 years ago

@micbuh Hey Super Script ! Funktioniert Sofort. Danke für das Teilen ! Wesentlich mehr Information die ich erhalte ! Klasse !

gidhap commented 3 years ago

Ich habe meinen Goodwe 5048EM mit der https://solaranzeige.de/phpBB3/solaranzeige.php angebunden. Da dort auch eine Influxdb und Grafana verwendet wird, lässt sich das gut mit ioBroker kombinieren. `AC Einspeisung_Bezug Frequenz Leistung Leistung_R Leistung_S Leistung_T Spannung Spannung_R Spannung_S Spannung_T Verbrauch

Batterie Leistung SOC Spannung Ladung Entladung

Info Datum Firmware Objekt Produkt Diagnose

PV PV1_Leistung PV1_Spannung PV2_Leistung PV2_Spannung PV3_Leistung PV3_Spannung PV_Leistung

Service BMS_Status Batterie_Mode MeterType WR_Mode

Statistik Bezeichnung Datum DieseWoche_TS DieserMonat_TS DiesesJahr_TS Gestern_TS Heute_TS Jahr LetzteWoche_TS LetzterMonat_TS LetztesJahr_TS Monat Stunde TagImJahr TagImMonat Wert Woche Wochentag

Summen Wh_EinspeisungGesamt Wh_NetzbezugHeute Wh_NetzeinspeisungHeute Wh_PVLeistungGesamt

aktuellesWetter Datum Himmel Luftdruck Luftfeuchte Regenmenge Schnee Sonnenaufgang Sonnenuntergang Temperatur Wind Windrichtung Wolkendichte

`