Open remy-lavabre opened 8 months ago
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)
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...
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
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