Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Daikin heat pump date and time #7

Open
remy-lavabre opened this issue Oct 29, 2023 · 3 comments
Open

Update Daikin heat pump date and time #7

remy-lavabre opened this issue Oct 29, 2023 · 3 comments

Comments

@remy-lavabre
Copy link
Contributor

@property
def unit_datetime(self) -> datetime.datetime:
    """ Returns the current date of the unit. Takes time to refresh """
    d = self._requestValueHP("0/DateTime/la", "/m2m:rsp/pc/m2m:cin/con")
    return datetime.datetime.strptime(d, '%Y%m%dT%H%M%SZ')

With this function, ok we can get the date/time of the PAC (Format 20231029T180710Z)
Is it possible in reverse, to write (instead of reading) a date/time group in the PAC ? And how... ?

Thank-you

@Frankkkkk
Copy link
Owner

Hi,
I tried with the following, but it doesn't seem to work:

    def set_unit_datetime(self, d: datetime.datetime):
        """Sets the current date of the unit. XXX Doesn't work rn"""
        date_str = datetime.datetime.strftime(d, self.DATETIME_FMT)

        payload = {
            "con": date_str,
            "cnf": "text/plain:0",
        }

        d = self._requestValueHP("/0/DateTime", "/", payload)

@remy-lavabre
Copy link
Contributor Author

Request is d = self._requestValueHP("/0/DateTime", "/", payload)
or d = self._requestValueHP("0/DateTime", "/", payload) (without the "/" before the 0) ???

But in fact that doesn't change the problem...

@Frankkkkk
Copy link
Owner

So looking at the reverse engineered code of the phone app, if the d._unit_api route does not return a "DateTime": {"DateTimeAdjustable": true} entry, it is not possible to set the date time.

The correct route would be /0/DateTime and the format "%Y%m%dT%H%M%SZ".

On my heat pump, however, the field does not exist and indeed it does not change the time given the command.

Hopefully it works on yours... I've release 0.3.1 for those that the setting works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants