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

Is there a way to detect if the local city grid is down? #142

Closed eleventhaus closed 1 month ago

eleventhaus commented 1 month ago

On the enphase web portal and on the enphase app, there is a indicator for the local municipal grid.

Screenshot 2024-07-25 at 10 01 53 AM

Is there a way to expose this indicator in the plugin as a sensor which reflects the status of the municipal grid?

A sensor would make it easy to create shortcuts using homekit in iOS, where a certain set of actions could be run if the local grid goes down.

grzegorz914 commented 1 month ago

Yes, the sensor can be created in Ensemble - Enpower or Solar section IMG_0996

eleventhaus commented 1 month ago

I have the following sensors created in the plugin config: Enpower Grid On, Enpower Grid Off, Enpower Multimode On, Enpower Multimode Off

https://github.com/user-attachments/assets/9d50d8fb-ceab-4a0c-a222-22c388af82fb

This is what my homekit looks like: self-consumption_Screenshot 2024-07-26 at 10 00 37 AM

This is what my enphase portal looks like: Screenshot 2024-07-26 at 10 06 37 AM

If I have Enpower Grid On active as a sensor in the plugin config, why is it off in Homekit?

Will the Grid On sensor not work with my system because I have solar and storage? Should I only use multimode grid then?

grzegorz914 commented 1 month ago

Yes, You need use multimode-grid on or off sensor for Your purpose.

eleventhaus commented 1 month ago

Thought everything was working well but this morning I noted that although my system is on the grid and everthing is working as expected, all of the sensors I created in homekit using the plugin are reading as closed or off

Screenshot 2024-07-27 at 9 57 34 AM

Screenshot 2024-07-27 at 9 58 07 AM

These are all enpower sensors Screenshot 2024-07-27 at 10 00 17 AM

grzegorz914 commented 1 month ago

Can you get me debug log, go to plugin settings advanced settings>>system>>debug enable it and restart plugin then after a while download and post the log file.

eleventhaus commented 1 month ago

(removed config log)

grzegorz914 commented 1 month ago

Should be fixed in 8.0.2, try and let me know

grzegorz914 commented 1 month ago

You can also try beta 9.0.0, here is added support for Homebridge 2.0 and new sensor profiles to select , Grid Tiedand Grid Forming

eleventhaus commented 1 month ago

Just to confirm:

grzegorz914 commented 1 month ago

in release v8.1.1 fixed display and publish ensemble status. Also fixed encharge and solar grid mode sensors, please update and get me the debug please

eleventhaus commented 1 month ago

Updated to 8.1.1

I see the new light switches for each profile (full-backup, self-consumption, savings). I'm currently on Self-consumption but the light switch shows as off on homekit.

Screenshot 2024-08-04 at 9 50 09 AM

(removed config log)

grzegorz914 commented 1 month ago

Encharge profile are in experimental phase and not working yet, please disable it in plugin config Ensemble>>Encharge>>Profile

eleventhaus commented 1 month ago

I'm not sure the Grid Tied/Forming or Multimode sensors can be used to indicate if the utility is online or offline.

In my case, Grid Tied shows as off/Multimode shows as on when my system starts using battery power regardless of utility grid status. When utility grid is off none of the indicators reflect that.

I need a sensor that will indicate when the ultility is down. Is that possible?

grzegorz914 commented 1 month ago

I Don’t have ensemble in my system, Please post debug log if grid is off, also if grid is on

grzegorz914 commented 1 month ago

HI @eleventhaus in latest 9.0 beta im added empower grid state sensor which represent Grid ON/OFF state, please try it and let mi know.

eleventhaus commented 1 month ago

I updated to the latest beta and I'm getting the following error: "Device: 192.168.107.60 Envoy, Start error: Requesting ensemble inventory error: ReferenceError: enpwrGridMode is not defined., trying again in 15s."

(removed config log)

grzegorz914 commented 1 month ago

fixed, beta 132 added also Enpower Grid State control enable it in enpower section

eleventhaus commented 1 month ago

Fixed the last error.

New error: "Device: 192.168.107.60 Envoy, Start error: Requesting ensemble status error: TypeError: parseFloat is not a function., trying again in 15s."

(removed config log)

grzegorz914 commented 1 month ago

try 134

eleventhaus commented 1 month ago

I'm on 135. I added the Grid State Control as a switch and Grid State Sensor as a contact sensor but not seeing them on homekit.

I noted that the plugin recommends updating to HB 2.0. Wondering if that's why it isn't working for me.

Screenshot 2024-08-08 at 12 32 46 PM

Screenshot 2024-08-08 at 12 25 50 PM

Screenshot 2024-08-08 at 12 25 56 PM

(removed config log)

grzegorz914 commented 1 month ago

136 fixed

eleventhaus commented 1 month ago

On 141

Still not seeing the Grid State Control ~or Grid State Sensor~ in homekit

Also, getting these non-critical errors on homebridge:

[08/08/2024, 16:07:01] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:07:15] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:07:30] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:07:45] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:08:00] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:08:15] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:08:30] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:08:45] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:09:00] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.
[08/08/2024, 16:09:15] [homebridge-enphase-envoy] This plugin generated a warning from the characteristic 'Rest power': characteristic value expected valid finite number and received "NaN" (number). See https://homebridge.io/w/JtMGR for more info.

(removed config log)

Edit: I am seeing the Grid Sensor State (utility status indicator) now and I tested it and it works 🎉 but not seeing the Grid State Control (utility control switch)

grzegorz914 commented 1 month ago

thanks for your patience, the control grid is fixed in 142, please test it and let me know with log

grzegorz914 commented 1 month ago

please post in this topic #144

eleventhaus commented 1 month ago

Geting error:

[10/08/2024, 09:23:14] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting ensemble status error: TypeError: Cannot set properties of undefined (setting 'status')., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

ok, try 196

eleventhaus commented 1 month ago

v202

[10/08/2024, 18:28:45] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting ensemble dry contacts error: AxiosError: Request failed with status code 404., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

203 fixes the wrong url to dry contacts

eleventhaus commented 1 month ago

On 203

[10/08/2024, 22:20:58] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting ensemble dry contacts error: AxiosError: Request failed with status code 404., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

fixed in 204

eleventhaus commented 1 month ago

[10/08/2024, 22:41:16] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Prepare accessory error: Error: Cannot add a Characteristic with the same UUID as another Characteristic in this Service: 00000254-000B-1000-8000-0026BB765291, trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

fixed in 205

grzegorz914 commented 1 month ago

plese post debug also if working correct

eleventhaus commented 1 month ago

On 206

Homekit sensors are finally working and showing correct status.

Getting the following error: [10/08/2024, 23:29:34] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Update ensemble error: Requesting ensemble encharge settings. error: TypeError: Cannot read properties of undefined (reading 'mode')..

(removed config log)

grzegorz914 commented 1 month ago

208 ready

eleventhaus commented 1 month ago

v 241

[11/08/2024, 08:02:57] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting ensemble status error: TypeError: Cannot read properties of undefined (reading 'forEach')., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

Fixed in 243

eleventhaus commented 1 month ago

243

[11/08/2024, 08:12:14] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting ensemble status error: TypeError: Cannot read properties of undefined (reading 'gridProfile')., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

Fixed 245

eleventhaus commented 1 month ago

[11/08/2024, 08:24:07] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting dry contacts error: ReferenceError: date is not defined., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

Fixed 247

eleventhaus commented 1 month ago

[11/08/2024, 08:47:38] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Prepare accessory error: TypeError: Cannot read properties of undefined (reading 'type'), trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

Fixed 248

eleventhaus commented 1 month ago

No critical errors and homekit is working ✅😌

Thank you!

(removed config log)

grzegorz914 commented 1 month ago

i have fixed some warnings, try 251 and post the log please

eleventhaus commented 1 month ago

270

[11/08/2024, 17:39:10] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting ensemble status error: TypeError: Cannot set properties of undefined (setting 'status')., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

fixed 271

eleventhaus commented 1 month ago

289

[12/08/2024, 08:35:10] [homebridge-enphase-envoy] Device: 192.168.107.60 Envoy, Start error: Requesting tariff. error: TypeError: Cannot read properties of undefined (reading 'code')., trying again in 15s.

(removed config log)

grzegorz914 commented 1 month ago

Fixed typo 290 ready

eleventhaus commented 1 month ago

Not seeing 290 on the version list for the plugin