Skip to content

Powerwall - cannot retrieve the mode #131

Description

@HeraldCoupe

I've just upgraded to the lastest version but I am no longer able to retrieve the Powerwall mode. It looks as though the output of get_battery_data() no longer contains "default_real_mode" or "operation".

Please can you advise how I can get the mode now?

Thanks for your help.

Activity

  1. DaveTBlake commented on Jun 9, 2023

    @DaveTBlake

    Yes facing the same issue here, "default_real_mode" produces error. Would like advice on getting mode.

  2. DaveTBlake commented on Jun 9, 2023

    @DaveTBlake

    While get_battery_data() no longer retrieves "default_real_mode" or "operation" (that always seemed to be the same as "default_real_mode"), I have found from experimenting that getting data from the endpoint api/1/energy_sites/{site_id}/site_info does return "default_real_mode". I don't know if this is new, or if it has always done so as this is not an endpoint I have used.

    To access that I added the following method to the Battery class in init.py

    def get_site_info(self):
            """ Retrieve current site config information"""
            self.update(self.api('SITE_CONFIG')['response'])
            return self
    

    Powerwall mode is then given by product.get_site_info()["default_real_mode"]

  3. HeraldCoupe commented on Jun 22, 2023

    @HeraldCoupe
    Author

    def get_site_info(self):
    """ Retrieve current site config information"""
    self.update(self.api('SITE_CONFIG')['response'])
    return self

    Thanks for this. After some fidding around I got it to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions