grzegorz914 / homebridge-enphase-envoy

Homebridge plugin for Photovoltaic Energy System manufactured by Enphase. Supported Envoy-IQ, Envoy-S and all peripheral devices.
MIT License
47 stars 9 forks source link

v4.0.0 = Device state error: TypeError: Cannot read property '0' of undefined #8

Closed hoefs closed 3 years ago

hoefs commented 3 years ago
[2/1/2021, 12:50:02 PM] [enphaseEnvoy] Device: 192.168.2.25 Envoy-S, update Device state error: TypeError: Cannot read property '0' of undefined
    at envoyDevice.updateDeviceState (/homebridge/node_modules/homebridge-enphase-envoy/index.js:823:77), state: Offline

Seems not working anymore... I cannot see the envoy in homekit

This is working: http://192.168.2.25/api/v1/production/inverters

[
  {
    "serialNumber": "121932016549",
    "lastReportDate": 1612180180,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 211
  },
  {
    "serialNumber": "121932039565",
    "lastReportDate": 1612180162,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 215
  },
  {
    "serialNumber": "121932039512",
    "lastReportDate": 1612180167,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 213
  },
  {
    "serialNumber": "121932034199",
    "lastReportDate": 1612180174,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 213
  },
  {
    "serialNumber": "121932043894",
    "lastReportDate": 1612180164,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 216
  },
  {
    "serialNumber": "121932033746",
    "lastReportDate": 1612180170,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 212
  },
  {
    "serialNumber": "121932039006",
    "lastReportDate": 1612180174,
    "devType": 1,
    "lastReportWatts": 17,
    "maxReportWatts": 208
  },
  {
    "serialNumber": "121932038960",
    "lastReportDate": 1612180166,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 214
  },
  {
    "serialNumber": "121932035604",
    "lastReportDate": 1612180170,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 216
  },
  {
    "serialNumber": "121931158966",
    "lastReportDate": 1612180176,
    "devType": 1,
    "lastReportWatts": 17,
    "maxReportWatts": 212
  },
  {
    "serialNumber": "121932016547",
    "lastReportDate": 1612180162,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 217
  },
  {
    "serialNumber": "121932043380",
    "lastReportDate": 1612180167,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 212
  },
  {
    "serialNumber": "121931157713",
    "lastReportDate": 1612180171,
    "devType": 1,
    "lastReportWatts": 18,
    "maxReportWatts": 211
  },
  {
    "serialNumber": "121932039459",
    "lastReportDate": 1612180180,
    "devType": 1,
    "lastReportWatts": 17,
    "maxReportWatts": 208
  }
]

My config:

    {
            "devices": [
                {
                    "name": "Envoy-S",
                    "host": "192.168.2.25",
                    "refreshInterval": 30,
                    "envoyUser": "envoy",
                    "envoyPasswd": "xxxxx",
                    "installerUser": "installer",
                    "installerPasswd": "xxxxxx",
                    "enchargeStorageOffset": 0,
                    "powerProductionMaxDetected": 3400,
                    "energyProductionLifetimeOffset": 0,
                    "powerConsumptionTotalMaxDetected": 0,
                    "energyConsumptionTotalLifetimeOffset": 0,
                    "powerConsumptionNetMaxDetected": 0,
                    "energyConsumptionNetLifetimeOffset": 0,
                    "manufacturer": "Enphase",
                    "modelName": "Envoy-S",
                    "serialNumber": "121921106049",
                    "firmwareRevision": "R4.10.35"
                }
            ],
            "platform": "enphaseEnvoy"
        }
grzegorz914 commented 3 years ago

Please update to latest version.

hoefs commented 3 years ago

Please update to latest version.

Same issue with homebridge-enphase-envoy v4.0.34?

[2/1/2021, 1:41:00 PM] [enphaseEnvoy] Device: 192.168.2.25 Envoy-S, update Device state error: TypeError: Cannot read property 'activeCount' of undefined
    at envoyDevice.updateDeviceState (/homebridge/node_modules/homebridge-enphase-envoy/index.js:631:74)
    at processTicksAndRejections (internal/process/task_queues.js:93:5), state: Offline
grzegorz914 commented 3 years ago

Please get The output for

http://envoy.local/production.json

hoefs commented 3 years ago

Please get The output for

http://envoy.local/production.json

{"production":[{"type":"inverters","activeCount":14,"readingTime":1612183759,"wNow":75,"whLifetime":4785715}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]}

grzegorz914 commented 3 years ago

OK I know What is wrong, will update The plugin asap. I have full system with all possible devices and with Your case The output is little different.

please also get response for: http://Envoy.local/ivp/meters

hoefs commented 3 years ago

OK I know What is wrong, will update The plugin asap. I have full system with all possible devices and with Your case The output is little different.

please also get response for: http://Envoy.local/ivp/meters

http://192.168.2.25/ivp/meters output is just 2 brackets

[]

grzegorz914 commented 3 years ago

Ok Thanks

grzegorz914 commented 3 years ago

Make update and test. 4.0.36

hoefs commented 3 years ago

Same type of error with homebridge-enphase-envoy v4.0.35

[2/1/2021, 2:12:27 PM] [enphaseEnvoy] Device: 192.168.2.25 Envoy-S, update Device state error: TypeError: Cannot read property 'count' of undefined
    at envoyDevice.updateDeviceState (/homebridge/node_modules/homebridge-enphase-envoy/index.js:633:21)
    at processTicksAndRejections (internal/process/task_queues.js:93:5), state: Offline
grzegorz914 commented 3 years ago

Update to 4.0.36

hoefs commented 3 years ago

Update to 4.0.36

Still have error...

[2/1/2021, 2:16:00 PM] [enphaseEnvoy] Device: 192.168.2.25 Envoy-S, update Device state error: ReferenceError: totalConsumtionMeterAvtiveCount is not defined
    at envoyDevice.updateDeviceState (/homebridge/node_modules/homebridge-enphase-envoy/index.js:705:7), state: Offline
grzegorz914 commented 3 years ago

Sorry, Try again

hoefs commented 3 years ago

Sorry, Try again

Seems to be working now!!! Why are the betas instantly available via homebridge?