Daikin AC Integration BRP069C4x

Hi, please help me.
I get tokenset.json correctly put in the same folder of configuration.yaml, for an heat pump Altherma 3 but in HA i have 1 device and one entity unvailable.

this is my log:
`
Logger: homeassistant.components.climate
Source: custom_components/daikin_residential/daikin_base.py:101
Integration: Climate (documentation, issues)
First occurred: 10:59:43 PM (1 occurrences)
Last logged: 10:59:43 PM

Error while setting up daikin_residential platform for climate
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 205, in _async_setup_platform
await asyncio.shield(task)
File “/config/custom_components/daikin_residential/climate.py”, line 84, in async_setup_entry
async_add_entities([DaikinClimate(device)], update_before_add=True)
File “/config/custom_components/daikin_residential/climate.py”, line 98, in init
ATTR_SWING_MODE: self._device.swing_modes,
File “/config/custom_components/daikin_residential/daikin_base.py”, line 239, in swing_modes
hMode = self.getData(ATTR_HSWING_MODE)
File “/config/custom_components/daikin_residential/daikin_base.py”, line 106, in getData
cmd_set = self.getCommandSet(param)
File “/config/custom_components/daikin_residential/daikin_base.py”, line 101, in getCommandSet
cmd_set[2] = cmd_set[2].replace("%operationMode%", operation_mode)
TypeError: replace() argument 2 must be str, not None
and
Logger: homeassistant.components.sensor
Source: custom_components/daikin_residential/daikin_base.py:286
Integration: Sensor (documentation, issues)
First occurred: 10:59:43 PM (2 occurrences)
Last logged: 10:59:43 PM

Error adding entities for domain sensor with platform daikin_residential
Error while setting up daikin_residential platform for sensor
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 322, in async_add_entities
await asyncio.gather(*tasks)
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 514, in _async_add_entity
await entity.add_to_platform_finish()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 547, in add_to_platform_finish
self.async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 310, in async_write_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 334, in _async_write_ha_state
sstate = self.state
File “/config/custom_components/daikin_residential/sensor.py”, line 132, in state
return self._device.inside_temperature
File “/config/custom_components/daikin_residential/daikin_base.py”, line 286, in inside_temperature
return float(self.getValue(ATTR_INSIDE_TEMPERATURE))
TypeError: float() argument must be a string or a number, not ‘NoneType’
`

what i do wrong?
how integration can connet to daikin servers only with token? There’s a place to config email and password?
Thanks…

Hi,
the procedure worked for me but i have to report some strange behavior of some of my machines.
I have 2 perfera and 1 Stylish model, all of them are bought in 2021 whit BRP c version.

Sems that randomly one of the AC goes offline and notify a “conflict”
Am i doing something wrong or some of you did have the same behavior??
Thank in advance

Thank you @rospogrigio @Apollon77 @ gigatexel for make it possible! Good work!

Now is time to to write daikin for ask about the AP anouncement… it has no sense and is quite annoying.

2 Likes

Major Japanese air conditioners support the echonet lite protocol. echonet lite is a unified standard for smart homes in Japan, but it is not well known because it is not even widely used in Japan.

I’m curious if Daikin air conditioners in other regions support the echonet lite protocol. I live in Japan, so I can’t check the behavior of air conditioners in other regions.

I have heard from other users that mitsubishi_hass can be used with newer Daikin air conditioners sold in Japan. mitsubishi_hass is a component that controls Mitsubishi air conditioners with the echonet lite protocol.

1 Like

Any chance that this integration can be tweaked slightly so that the power consumption is exposed in the correct way to be added to the new power feature of HA 2021.8?

If you add the device_class, the state_class and reset date through the customize option, it works. Just an intermediary solution if need be.

Can you give a bit more information how you did this? @Cazimbo

You need to add those attributes to the customize.yaml file and then include it in your configuration.yaml. I’ve added what i’ve used.

customize.yaml

sensor.daikin_kamer_adriaan_daily_cool_energy_consumption:
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
  state_class: measurement
sensor.daikin_kamer_adriaan_daily_heat_energy_consumption:
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
  state_class: measurement
sensor.daikin_slaapkamer_daily_cool_energy_consumption:
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
  state_class: measurement
sensor.daikin_slaapkamer_daily_heat_energy_consumption:
  last_reset: '1970-01-01T00:00:00+00:00'
  device_class: energy
  state_class: measurement
configuration.yaml

homeassistant:
  customize: !include customize.yaml

just not sure how correct it’s working as i’ve got negative usage stats for today. So need to take a closer look to that.

1 Like

Exactly that :wink:

The stats are calculated by Daikin I think so not much the integration can do about that.

1 Like

Easiest way to get a daily consumption in the new energy dashboard is to add an energy meter with the following config:

utility_meter:
  atticac_energy:
    source: sensor.attic_ac_daily_cool_energy_consumption
    cycle: daily
    name: Attic AC Energy

And then use the newly created sensor in the dashboard.

It may take a while for it to be available.

1 Like

Please create an Issue in my repo to track this problem and I’ll give it a look.
In the meantime, you should try to install this PR (Introduced dumping of JSON data received by rospogrigio · Pull Request #6 · rospogrigio/daikin_residential · GitHub ), which will store a dump of the JSON data of your devices, obfuscate sensitive data and send it to me or post it in the Issue you’ll open. Bye

Thanks rospogrigio, it seems thath the error is before…
“daikin_data.json” file is not written…

raceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 249, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/config/custom_components/daikin_residential/init.py”, line 58, in async_setup_entry
devices = await daikin_api.getCloudDevices()
File “/config/custom_components/daikin_residential/daikin_api.py”, line 155, in getCloudDevices
json.dump(devices, jsonFile, indent=4, sort_keys=True)
NameError: name ‘devices’ is not defined

issue created, maybe my model BRP069A78 (Altherma 3 heat pump) is not supported.
i’m awaiting your opinion.
thanks

Hello!

I just got this error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/daikin_residential/__init__.py", line 56, in async_setup_entry
    await daikin_api.getCloudDeviceDetails()
  File "/config/custom_components/daikin_residential/daikin_api.py", line 147, in getCloudDeviceDetails
    return await self.doBearerRequest("/v1/gateway-devices")
  File "/config/custom_components/daikin_residential/daikin_api.py", line 88, in doBearerRequest
    await self.refreshAccessToken()
  File "/config/custom_components/daikin_residential/daikin_api.py", line 119, in refreshAccessToken
    res_json["AuthenticationResult"] is not None
KeyError: 'AuthenticationResult'

Hello @stefdewilde i got this error yesterday and I resolved issuing a new tokenset.json.
May be the token has an expiry date ?

1 Like

Yeah new token fixed it! Thanks mate

1 Like

Just noticed th same on my installation while on vacation :see_no_evil::rofl:… you should be able to see the expiry date in the json token I think? https://token.dev/

I also saw that there is an option in 0.2.0 to get redirected to the login page? No clue how it works as, does anyone know? :grimacing:

Also had my token expire, renewing worked.

@Apollon77, maybe you can clarify your instructions a bit about when you get to the 127.0.0.1 page and on your Github?
I was confused, thinking I just had to log in and the token would be retrieved, since you don’t put the login step as an actually step (there is no number). So we still need to do the certs import and use the proxy. Still faster than before (so don’t take my comment as criticism), but I was just confused, thinking just logging in was enough.

As a general tip for others: if it doesn’t seem to work try to use your browser in incognito mode so all add-ons are disabled and your cache is clean.

Ok, it seems I need to update readme (done)

Wit 0.2.0 a new way was added that should work without Proxy at all.

Try too call

node tokensave.js "[email protected]" "mypassword"

(or without node in front if you use the binary)

Replace the data with your login credentials please

Also a user from Japan here. Although I haven’t updated the WiFi modules to their latest firmware versions, I just tested the mitsubishi_hass Echonet Lite custom component, and I can confirm that it indeed works with the Daikin modules as well, at least for the Japanese model! Daikin continues to advertise that their modules are compatible with the Echonet Lite protocol, so I assume it would work fine even after updating these modules and possibly losing the Daikin local communication method.

1 Like