tadasdanielius / daikin_altherma

Daikin Altherma custom component for home assistant
MIT License
71 stars 5 forks source link

Failed to setup #24

Closed nicopieterse closed 2 years ago

nicopieterse commented 2 years ago

Hi Tadasdanielius Great project. Unfortunately, I can't get the integration running. I did connect my brp069a62 to the Daikin Hybrid Altherma (EHYHBH type) and connected it to my LAN. The device shows up at: http://altherma.local/. It also is discovered by your integration. And after "configure" (ID number) the integration shows failed to setup. The logs show the following:

2022-05-29 15:38:08 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Daikin HVAC controller (194800260) for daikin_altherma File "/config/custom_components/daikin_altherma/init.py", line 67, in async_setup_entry File "/config/custom_components/daikin_altherma/init.py", line 46, in setup_api_instance File "/config/custom_components/daikin_altherma/init.py", line 147, in api_init

Ok. I found out how it works. I had to update the firmware and wait half an our to initialize. Now the integration is added !!

tadasdanielius commented 2 years ago

So all working fine now? If yes I am going to close this issue.

nicopieterse commented 2 years ago

Yes! Thanks.

How did you manage to "sniff" all the communication? There must be loads more things we must be able to change :)

Op ma 30 mei 2022 om 08:48 schreef Tadas Danielius @.***

:

So all working fine now? If yes I am going to close this issue.

— Reply to this email directly, view it on GitHub https://github.com/tadasdanielius/daikin_altherma/issues/24#issuecomment-1140765693, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUHSZGOYFYZYGBHIWCBPSHTVMRQFRANCNFSM5XIHGAMQ . You are receiving this because you authored the thread.Message ID: @.***>

tadasdanielius commented 2 years ago

There are some similar projects written in other languages. That was my starting point. Most important part was to get the unit profile info. That json data helped to see all "at least publicly exposed" operations and sensors. Using that info the query methods follows common pattern. Then, lot of trial and error experimentations :) helped to get there it is now. One thing what is not yet covered is schedules, but since we can integrate well with HA schedules are low priority, IMHO.

If you want to "get your hands dirty" you can uncomment some lines in the integration and see what your units are exposing. In the custom_components/daikin_altherma folder look for the file init.py. Uncomment the lines from 37 up to 44.

From:

    #try:
    #    for profile in unit_profiles:
    #        filepath: str = os.path.join(hass.config.config_dir, f'daikin_altherma_{profile["idx"]}.json')
    #        with open(filepath, 'w') as f:
    #            f.write(json.dumps(profile['profile']))
    #except Exception as e:
    #    _LOGGER.warning(f'Failed to save profile state to file {filepath}. It does not affect the operation of the integration.', exc_info=True)

To

    try:
        for profile in unit_profiles:
            filepath: str = os.path.join(hass.config.config_dir, f'daikin_altherma_{profile["idx"]}.json')
            with open(filepath, 'w') as f:
                f.write(json.dumps(profile['profile']))
    except Exception as e:
        _LOGGER.warning(f'Failed to save profile state to file {filepath}. It does not affect the operation of the integration.', exc_info=True)

(just remove #)

Restart the HA and check the config/ folder. If everything went well, you should see daikin_altherma_*.json check them out if there are anything interesting in there.

But, honestly, I think it is covered majority of the functionality and that adapter does not provide anything more. Another interesting project is ESPAltherma which provides much more info (but only read-only) and you actually need to open your device and connect ESP32.

nicopieterse commented 1 year ago

Hi Tadas

Thanks :) I found the init.py file (and the commented part) due to the error. What I was wondering: would it be possible to change all kinds of settings that normally are only exposed in the (installers) menu of the controller. Both devices (the A62 as well as the controller) live on the same P1 / P2 port. So, in theory, all settings should be available as well... That would be nice to change the AWT, weather dependent line, stop using Gas etc...

Greetings Nico

Op ma 30 mei 2022 om 09:58 schreef Tadas Danielius @.***

:

There are some similar projects written in other languages. That was my starting point. Most important part was to get the unit profile info. That json data helped to see all "at least publicly exposed" operations and sensors. Using that info the query methods follows common pattern. Then, lot of trial and error experimentations :) helped to get there it is now. One thing what is not yet covered is schedules, but since we can integrate well with HA schedules are low priority, IMHO.

If you want to "get your hands dirty" you can uncomment some lines in the integration and see what your units are exposing. In the custom_components/daikin_altherma folder look for the file init.py https://github.com/tadasdanielius/daikin_altherma/blob/9f62486d038517876a1241051c75c6e9719ec8a9/custom_components/daikin_altherma/__init__.py#L37. Uncomment the lines from 37 up to 44.

From:

#try:
#    for profile in unit_profiles:
#        filepath: str = os.path.join(hass.config.config_dir, f'daikin_altherma_{profile["idx"]}.json')
#        with open(filepath, 'w') as f:
#            f.write(json.dumps(profile['profile']))
#except Exception as e:
#    _LOGGER.warning(f'Failed to save profile state to file {filepath}. It does not affect the operation of the integration.', exc_info=True)

To

try:
    for profile in unit_profiles:
        filepath: str = os.path.join(hass.config.config_dir, f'daikin_altherma_{profile["idx"]}.json')
        with open(filepath, 'w') as f:
            f.write(json.dumps(profile['profile']))
except Exception as e:
    _LOGGER.warning(f'Failed to save profile state to file {filepath}. It does not affect the operation of the integration.', exc_info=True)

(just remove #)

Restart the HA and check the config/ folder. If everything went well, you should see daikinaltherma*.json check them out if there are anything interesting in there.

But, honestly, I think it is covered majority of the functionality and that adapter does not provide anything more. Another interesting project is ESPAltherma https://raomin.github.io/ESPAltherma/ which provides much more info (but only read-only) and you actually need to open your device and connect ESP32.

— Reply to this email directly, view it on GitHub https://github.com/tadasdanielius/daikin_altherma/issues/24#issuecomment-1140828384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUHSZGIHCA6SDNJE2UNUIXTVMRYLPANCNFSM5XIHGAMQ . You are receiving this because you authored the thread.Message ID: @.***>

tadasdanielius commented 1 year ago

Instead of using A62, probably it would be easier to build your own controller. Something like arduino or ESP32 based devices and stik to P1/P2. It seems like the A62 "do not ask much" from the device and does not expose to the public all that good stuff. I wonder if we could get hands on the firmware file of the A62 maybe we could find some hidden gems, but that is just my wishful thinking :)

nicopieterse commented 1 year ago

Looks like Arnold Niessen already has something up and running: https://github.com/Arnold-n/P1P2Serial

Op di 11 okt. 2022 om 09:08 schreef Tadas Danielius < @.***>:

Instead of using A62, probably it would be easier to build your own controller. Something like arduino or ESP32 based devices and stik to P1/P2. It seems like the A62 "do not ask much" from the device and does not expose to the public all that good stuff. I wonder if we could get hands on the firmware file of the A62 maybe we could find some hidden gems, but that is just my wishful thinking :)

— Reply to this email directly, view it on GitHub https://github.com/tadasdanielius/daikin_altherma/issues/24#issuecomment-1274186935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUHSZGJGDSI4A3KRSGN5MYTWCUG5VANCNFSM5XIHGAMQ . You are receiving this because you authored the thread.Message ID: @.***>