briancmpbll / home_assistant_custom_envoy

171 stars 76 forks source link

Binary Sensor Grid Status no longer available #192

Open malcolmx100 opened 3 months ago

malcolmx100 commented 3 months ago

Only the grid status entity is no longer available through this integration. However the home.json local API is also missing the variable now. ie value_json[‘enpower’][‘grid_status’] }}”

Enphase Software Version: D8.2.127 (b9a901) Software Build Date14 Dec, 2023 8:41 AM

catsmanac commented 3 months ago

There is logic in the code since v0.0.18 of last September to detect if the grid_status is still reported by the Envoy or not. It disappeared from envoy home endpoint with one of the 7.x firmware releases.

Your observation is correct and the integration should handle it without errors. But the data for grid_status will show as unavailable.

malcolmx100 commented 2 months ago

Thanks so much for confirming, is there something else I can request of Enphase to make it available again? The integration was pulling from a Json file vs the API? As I cannot discern from the API document where this value could be pulled from https://enphase.com/download/accessing-iq-gateway-local-apis-or-local-ui-token-based-authentication

catsmanac commented 2 months ago

The home.json actually comes from the api, even though it has the .json added to differentiate it from an original html home page.

The grid status came from enpower. I found an old Home example and it had:

"enpower":{"connected":false,"grid_status":"closed"}

That piece of information is available in /ivp/ensemble/inventory ìn the ENPOWER section as mains_oper_state

    {
        "type": "ENPOWER",
        "devices": [
            {
                "part_num": "865-00378-r27",
                "serial_num": "12345678901001",
                "installed": 1709657837,
                "device_status": [
                    "envoy.global.ok",
                    "prop.done"
                ],
                "last_rpt_date": 1709829514,
                "admin_state": 24,
                "admin_state_str": "ENPWR_STATE_OPER_CLOSED",
                "created_date": 1709657837,
                "img_load_date": 1709657837,
                "img_pnum_running": "3.0.5654_rel/31.13",
                "communicating": true,
                "temperature": 72,
                "comm_level_sub_ghz": 0,
                "comm_level_2_4_ghz": 0,
                "mains_admin_state": "closed",
                "mains_oper_state": "closed",
                "Enpwr_grid_mode": "multimode-ongrid",
                "Enchg_grid_mode": "multimode-ongrid",
                "Enpwr_relay_state_bm": 15868,
                "Enpwr_curr_state_id": 16
            }
        ]
    }

If you have Enpower you might have a look at the Home Assistant Core integration as it has way more implemented for batteries and has relay and switch states and options the change the switches.

@Matthew1471 has lots of information on what can be found where .