vincentwolsink / home_assistant_micronova_agua_iot

Home Assistant integration controlling heating devices connected via the Agua IOT platform of Micronova
Apache License 2.0
25 stars 15 forks source link

Expose extra fans controls #32

Closed Pissouxxx closed 10 months ago

Pissouxxx commented 11 months ago

Hello,

I have a JollyMec Botero2 with additional fans to heat other rooms

I would like to use extra ventilation. The remote expose multiples options but I just need to control speed fan. I've exported diagnostic and found this values with a range from 0 to 5. Same values as the remote.

"Canalization_1_vent_set": { "reg_type": "SET", "offset": 32975, "formula": "#", "formula_inverse": "#", "format_string": "{0}", "set_min": 0, "set_max": 5, "mask": 65535, "value_off": 0, "raw_value": 5, "calculated_value": 5, "formatted_value": "5" }, "canalization_2_vent_set": { "reg_type": "SET", "offset": 32978, "formula": "#", "formula_inverse": "#", "format_string": "{0}", "set_min": 0, "set_max": 5, "mask": 65535, "value_off": 0, "raw_value": 0, "calculated_value": 0, "formatted_value": "0" },

Is this possible to expose this controls ? Sorry for my naive question but there is no way to dynamically add an entity in order to avoid requests like mine in the future ;)

Thanks for your Help.

vincentwolsink commented 11 months ago

Hi @Pissouxxx, yes this should be possible. I will need to expose them as separate fan entities in HA probably. Can you send me the full diagnostics file? Because I will probably need some other values too.

Pissouxxx commented 11 months ago

Thank you, your integration is really helpfull.

config_entry-aguaiot-6890d7fd8578b7146ae34413b2188e83.json.txt

vincentwolsink commented 11 months ago

Can you maybe also make a screenshot of the app, so I can check which settings are available in there?

The canalization values are also in some variant available for stoves that don't actually support them. So I need to find out what exactly specifies if they are available or not. To not show useless controls to everyone.

Pissouxxx commented 11 months ago

Line 1 : Main params 1 : Main power 2 : temp ambiant 3 : stand-by mode ON/OFF

Line 2 concerns the Fan 2 ("canalization_1..." in diag) 4 : Mode fan 2 (manual / semi-auto / auto) 5 : Temp fan 2 6 : speed fan 2 (what I'm waiting for)

Line 3 concerns the Fan 3 ("canalization_2..." in diag) 7 : same as 4 8 : same as 5 9 : same as 6

Screenshot_20230914-160119_Jolly Mec Wi Fi

marc-cizeron commented 11 months ago

I Have jollyMec too. With additional fans to heat other rooms. Verry interested with the solution.

Available for beta test if nedded.

Pissouxxx commented 11 months ago

Sorry I didn't read your entire response. On my app I can control fan 3 (canalization 2). But you should know that I haven't asked my installer to put it in yet. So, in my opinion, no information goes back to the application to inform it if equipment is there or not... Actually I only have "canalization_1" (vent 2).

Pissouxxx commented 11 months ago

I Have jollyMec too. With additional fans to heat other rooms. Verry interested with the solution.

Available for beta test if nedded.

Bonjour Marc, je profite du fait que vous ayez aussi un Jolly-Mec et que vous parliez Français, je suis plus à l'aise. J'ai lancé un démarrage depuis HA et surveillé les status.. chez moi ça me sort un peu n'importe quoi. Le "Start" et le "Flame light" sont ok. Tout le reste n'a pas vraiment de sens. Le "Ignition failed" semble correspondre au moment où j'ai demandé au poele de s'arrêter, pourtant la séquence de démarrage était bien terminée. Je n'ai fait qu'un seul essai, mais ça m'interroge. Chez-vous aussi c'est pareil ?

A noter que j'ai mixé l'usage de la télécommande, HA Aqua IOT et l'application téléphone pour voir si tout était synchro. Je ne vois pas le rapport mais bon. A ce sujet autant sur HA et l'appli mobile la température est synchro, autant sur la télécommande ça ne change pas. Quoiqu'on fasse sur les deux autres. Etrange. Bref le but n'est pas d'utiliser tout ça de façon mixée, c'était juste pour voir mais ça m'étonne.

image

marc-cizeron commented 11 months ago

Salut,

Je n'utilise pas mon poêle en se moment, donc je ne peut pas vérifier/tester. En revanche l'hiver dernier j'ai bien constater des incohérances sur le device_status. Donc pour le contourner voici ce que j'ai fait :

- platform: template
  sensors:
    poele_alert_code: 
      friendly_name: 'Code alarme' 
      value_template: >-
        {% set t = state_attr('climate.poele', 'alarm_code') | int(0) %}
        {% set values =
            ['-', 'Démarrage', 'Préchauffe',
            'Chargement pellets allumage', 'Allumage bougie', 'Allumage initial',
            'Finallisation allumage', 'Chauffage en cours', 'Demande extinction',
            'Nettoyage final', 'Attente de Standby', 'Standby',
            'Alerte: Plus de pellet', 'Alerte: Nettoyer brasier'] %}
        {{ values[t] }}

Je récupère l'attribut alarm_code de l'entité climate.poele créer par l'intégration. Puis j'ai fais une correspondance entre le code alarme et l'affichage sur l'application.

@vincentwolsink maybe it is possible to add another attribute who could be alarm_code_human with the matching data abbove ?

vincentwolsink commented 11 months ago

I need the human states above in English to see what is different. I would be sad if each brand would implement different states for the codes, but I can implement that if needed.

marc-cizeron commented 11 months ago

I would be sad if each brand would implement different states for the codes

I see, it could be a nightmare!

Here a possible translation :

'-', 'Startup', 'Preheat', 'Loading pellets ignition', 'Ignition Spark plug', 'Initial ignition', 'Finallisation allumage', 'Ignition finalisation', 'Request for extinction', 'Final cleaning', 'Waiting for Standby', 'Standby', 'Alert: Out of pellet', 'Alert: Clean up inferno'

But keep in mind that the french label could be wrong, so the translation too. But I think its a good start !

Pissouxxx commented 11 months ago

I'll try it, it seems to be what i'm searching for. Thank you Marc. I've build dozens applications for my job in C#, Java, Air, NodeJs etc. But HA, Github and Python is new for me... This is helpfull.

jipem01 commented 11 months ago

Hello Marc,Since last winter we've corrected many things, including status. Personally i've pick up corrections from another fork and also based on my nobis stove. But you're true, trabslation could ve hazardous (italian to french to english...)From what i've seen, parameters/commands could vary between brands (i don't known inside a brand?), status seems coherent across brands.

vincentwolsink commented 11 months ago

I am currently completely rewriting the aguaiot interface. Since the API exposes more than py-agua-iot currently does. I also managed to get canalization in the integration. Just trying to figure out the details.

vincentwolsink commented 11 months ago

@Pissouxxx one more question, you can set the temperature for each canalization, but can you also see the actual current temperature? How does it measure that? I cannot find a register that exposes that information.

Pissouxxx commented 11 months ago

Salut,

Je n'utilise pas mon poêle en se moment, donc je ne peut pas vérifier/tester. En revanche l'hiver dernier j'ai bien constater des incohérances sur le device_status. Donc pour le contourner voici ce que j'ai fait :

- platform: template
  sensors:
    poele_alert_code: 
      friendly_name: 'Code alarme' 
      value_template: >-
        {% set t = state_attr('climate.poele', 'alarm_code') | int(0) %}
        {% set values =
            ['-', 'Démarrage', 'Préchauffe',
            'Chargement pellets allumage', 'Allumage bougie', 'Allumage initial',
            'Finallisation allumage', 'Chauffage en cours', 'Demande extinction',
            'Nettoyage final', 'Attente de Standby', 'Standby',
            'Alerte: Plus de pellet', 'Alerte: Nettoyer brasier'] %}
        {{ values[t] }}

Je récupère l'attribut alarm_code de l'entité climate.poele créer par l'intégration. Puis j'ai fais une correspondance entre le code alarme et l'affichage sur l'application.

@vincentwolsink maybe it is possible to add another attribute who could be alarm_code_human with the matching data abbove ?

I changed "alarm_code" to "device_status", and it works. THANKS. What's interesting is that I have more information on the startup sequence than on the application or the remote control. I have not yet encountered the last two "alert" items. I'll see when it comes up.

for newbies like me, add the following in your /config/configuration.yaml file

- platform: template
  sensors:
    poele_device_status: 
      friendly_name: 'MY FRIENDLY NAME' 
      value_template: >-
        {% set t =  state_attr('climate.DEVICE_NAME', 'device_status')%}
        {% set values =
            ['OFF', 'Démarrage', 'Préchauffe',
            'Chargement pellets allumage', 'Allumage bougie', 'Allumage initial',
            'Finalisation allumage', 'Chauffage en cours', 'Demande extinction',
            'Nettoyage final', 'Attente de Standby', 'Standby',
            'Alerte: Plus de pellet', 'Alerte: Nettoyer brasier'] %}
        {{ values[t] }}

at this moment I have not yet managed to use these custom sensor values ​​in an automation.

Pissouxxx commented 11 months ago

@Pissouxxx one more question, you can set the temperature for each canalization, but can you also see the actual current temperature? How does it measure that? I cannot find a register that exposes that information.

I don't remember where I read that, but I seem to remember that you can buy a room thermometer. Which I didn't do because I already have everything I need on homeassistant. On the stove, I can change the temperature of the canalization... but it doesn't change anything because I don't have the equipment that goes with it. That's why I only need fan speed control, because I leave the canalization in "manual" mode.

vincentwolsink commented 11 months ago

First beta (attempt): v0.2.0-beta1

Please not this beta release (most probably) will contain bugs, due to the changes and also specifically since my stove does not support canalization so I currently do not have a proper way to test the code.

Pissouxxx commented 11 months ago

I'would like to try now, sorry for this stupid question but how do I install beta from HACS ?

vincentwolsink commented 11 months ago

See the HACS FAQ 🙂

Pissouxxx commented 11 months ago

Ok thx :) then : canalization 1 has only a "mode" button with one choice "fan only" canalization 2 has a button "Fan Mode" : [OFF, P1,..., P5]

Il I click on anything it returns something like image

I'm not at Home. But the common climate seems to work. if I change stove temp in HA, I get back the change on mobile app.

I don't have the time to look at other features now, but others sensors appears. It's nice. Thanks a lot for your work !

LOG :

Logger: homeassistant.components.websocket_api.http.connection
Source: components/climate/__init__.py:481
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 3:05:32 PM (7 occurrences)
Last logged: 3:33:25 PM

    [1701165096]
    [1531415592]
    [1571709352]

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 485, in async_set_fan_mode
    await self.hass.async_add_executor_job(self.set_fan_mode, fan_mode)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 481, in set_fan_mode
    raise NotImplementedError()
NotImplementedError
Pissouxxx commented 11 months ago

Other detail, my device names "Poele a Granules" (stove in french), as you cas see on the screenshot, climate names "salon canalization 2". "Salon" is the area where is the stove "Poele a Granules". It's seems strange for me. But, maybe that's the way HA works.

marc-cizeron commented 11 months ago

Good cleaning job, thanks a lot. I see the new sensors and at first glance they look good :)

@Pissouxxx one more question, you can set the temperature for each canalization, but can you also see the actual current temperature? How does it measure that? I cannot find a register that exposes that information.

I don't remember where I read that, but I seem to remember that you can buy a room thermometer. Which I didn't do because I already have everything I need on homeassistant. On the stove, I can change the temperature of the canalization... but it doesn't change anything because I don't have the equipment that goes with it. That's why I only need fan speed control, because I leave the canalization in "manual" mode.

I've just read the manual on installing the pipe and it seems that you can add an NTC sensor or a thermostat for the pipe. It seems that for my installation it's an NTC sensor. So yes, the vent could be manual or not, and in my case i can't set it manual.

marc-cizeron commented 11 months ago

Here some bug traces :)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/__init__.py", line 80, in async_setup_entry
    await agua.connect()
  File "/config/custom_components/aguaiot/aguaiot.py", line 121, in connect
    await self.fetch_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 287, in fetch_device_information
    await dev.update()
  File "/config/custom_components/aguaiot/aguaiot.py", line 358, in update
    await self.__update_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 411, in __update_device_information
    raise Error("Error while fetching device information")
          ^^^^^
NameError: name 'Error' is not defined
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 248, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/__init__.py", line 94, in async_update_data
    await agua.fetch_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 287, in fetch_device_information
    await dev.update()
  File "/config/custom_components/aguaiot/aguaiot.py", line 358, in update
    await self.__update_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 407, in __update_device_information
    res = await self.__agua_iot.handle_webcall("GET", url, payload)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/aguaiot.py", line 322, in handle_webcall
    return await self.handle_webcall(method, url, payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/aguaiot.py", line 322, in handle_webcall
    return await self.handle_webcall(method, url, payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/aguaiot.py", line 322, in handle_webcall
    return await self.handle_webcall(method, url, payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 951 more times]
  File "/config/custom_components/aguaiot/aguaiot.py", line 321, in handle_webcall
    await self.do_refresh_token()
  File "/config/custom_components/aguaiot/aguaiot.py", line 224, in do_refresh_token
    response = await client.post(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1848, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1631, in send
    raise exc
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1625, in send
    await response.aread()
  File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 909, in aread
    self._content = b"".join([part async for part in self.aiter_bytes()])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 909, in <listcomp>
    self._content = b"".join([part async for part in self.aiter_bytes()])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 927, in aiter_bytes
    async for raw_bytes in self.aiter_raw():
  File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 993, in aiter_raw
    await self.aclose()
  File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 1006, in aclose
    await self.stream.aclose()
  File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 152, in aclose
    await self._stream.aclose()
  File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 244, in aclose
    await self._httpcore_stream.aclose()
  File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 356, in aclose
    await self._pool.response_closed(self._status)
  File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 306, in response_closed
    await self._close_expired_connections()
  File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 193, in _close_expired_connections
    if connection.has_expired():
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 183, in has_expired
    return self._connection.has_expired()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpcore/_async/http11.py", line 266, in has_expired
    and self._network_stream.get_extra_info("is_readable")
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 91, in get_extra_info
    sock = self._stream.extra(anyio.abc.SocketAttribute.raw_socket, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/_core/_typedattr.py", line 78, in extra
    return self.extra_attributes[attribute]()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 223, in extra_attributes
    **self.transport_stream.extra_attributes,
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/anyio/abc/_sockets.py", line 72, in extra_attributes
    if self._raw_socket.family in (AddressFamily.AF_INET, AddressFamily.AF_INET6):
       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/trsock.py", line 20, in family
    return self._sock.family
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 519, in family
    return _intenum_converter(super().family, AddressFamily)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 105, in _intenum_converter
    return enum_klass(value)
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 712, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 1101, in __new__
    return cls._value2member_map_[value]
           ^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object
marc-cizeron commented 11 months ago

And i remove the actual setup and start a new one. I can't login any more :

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 298, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 394, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/config_flow.py", line 77, in async_step_user
    agua = agua_iot(
           ^^^^^^^^
NameError: name 'agua_iot' is not defined
vincentwolsink commented 11 months ago

Released a new version which addresses most of the bugs reported, thanks!

@Pissouxxx The reason that canalization 1 does not show fan speeds, is because that is the only control in the whole dataset that starts with a capital C (Canalization_1_vent_set), I need to find a way around that without hardcoding it.

Pissouxxx commented 11 months ago

With beta 1, I had to disable and reenable HUB. (after a reboot) to load new sensors etc.

With Beta 2 : Now climates are unavailable. (others values like : smoke temp, real power, are ok). Reboot etc, doesn't change anything

image

Some logs :

Logger: homeassistant
Source: custom_components/aguaiot/aguaiot.py:504
Integration: Micronova Agua IOT ([documentation](https://github.com/vincentwolsink/home_assistant_micronova_agua_iot/), [issues](https://github.com/vincentwolsink/home_assistant_micronova_agua_iot/issues))
First occurred: 4:47:14 PM (2 occurrences)
Last logged: 4:47:54 PM
Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 235, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 392, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 473, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 730, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 830, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 773, in _async_generate_attributes
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 301, in state_attributes
    hass, self.current_temperature, temperature_unit, precision
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/climate.py", line 339, in current_temperature
    return self._device.get_register_value(f"{self._target}_temp_air_get")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/aguaiot.py", line 504, in get_register_value
    return self.get_register(key).get("value")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Logger: homeassistant.components.climate
Source: custom_components/aguaiot/aguaiot.py:504
Integration: Climate ([documentation](https://www.home-assistant.io/integrations/climate), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+climate%22))
First occurred: 4:45:44 PM (6 occurrences)
Last logged: 4:48:56 PM

    Error adding entities for domain climate with platform aguaiot
    Error while setting up aguaiot platform for climate
    aguaiot: Error on device update!

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1002, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 730, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 830, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 773, in _async_generate_attributes
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 301, in state_attributes
    hass, self.current_temperature, temperature_unit, precision
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/climate.py", line 339, in current_temperature
    return self._device.get_register_value(f"{self._target}_temp_air_get")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/aguaiot.py", line 504, in get_register_value
    return self.get_register(key).get("value")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
vincentwolsink commented 11 months ago

@Pissouxxx Released a new version with a fix. Can you maybe also send me your diagnostics output for the integration? I can then try to create some fixtures for testing.

Pissouxxx commented 11 months ago

Canalization 2 -> Fan mode works fine :) (but I don't have it) Temp doesn't SET. But the values are good.

I've two sensors (in double) that are unavailable. Maybe it comes from old config and I should delete it ? image

Diagnostic is joined. Thanks :)

config_entry-aguaiot-6890d7fd8578b7146ae34413b2188e83.json(1).txt

Pissouxxx commented 11 months ago

This is the error's log when I try to set Temp Canalization :

Logger: homeassistant.components.websocket_api.http.connection
Source: components/climate/__init__.py:463
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 6:42:46 PM (8 occurrences)
Last logged: 7:05:45 PM

    [1851342056]
    [1537405672]

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 617, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 467, in async_set_temperature
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 463, in set_temperature
    raise NotImplementedError()
NotImplementedError
vincentwolsink commented 11 months ago

Thanks again for the error logs. I released a new beta version. The old sensors become unavailable indeed, because of new more uniform sensor naming/ids. You can delete them.

vincentwolsink commented 11 months ago

Other detail, my device names "Poele a Granules" (stove in french), as you cas see on the screenshot, climate names "salon canalization 2". "Salon" is the area where is the stove "Poele a Granules". It's seems strange for me. But, maybe that's the way HA works.

Salon is the name of the stove in your Jolly Mec app (see also your screenshot from the app), so this is the name we receive from the api. But you can rename the sensors etc in HA 🙂

Pissouxxx commented 11 months ago

I released a new beta version.

I don't see it :-)

vincentwolsink commented 11 months ago

Oops, trying to fix this in between other things, didn't pay enough attention. It is there now.

Pissouxxx commented 11 months ago

I'm testing it, and I have to say that i'm really impressed because it works fine ! Temp & fan speed are working on Canalization 1 & 2. Thank you very much Vincent for the time you devoted to us. I'm looking to see if I can find a bug somewhere but so far it looks perfect.

Pissouxxx commented 11 months ago

@marc-cizeron can you confirm ? :)

Pissouxxx commented 11 months ago

Humm sorry but I can't stop de stove. I'm going to die dry :) An error occurs when I press "heat" or "OFF" on the main climate. (my son started de stove with the remote. That's why I did'nt realized it before).

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/aguaiot/aguaiot.py:547
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 10:30:24 PM (4 occurrences)
Last logged: 10:30:53 PM
[1543735400] 'NoneType' object has no attribute 'keys'

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/aguaiot/climate.py", line 147, in async_set_hvac_mode
    await self.async_turn_off()
  File "/config/custom_components/aguaiot/climate.py", line 172, in async_turn_off
    await self._device.set_register_value_description(
  File "/config/custom_components/aguaiot/aguaiot.py", line 547, in set_register_value_description
    value = list(options.keys())[
                 ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'keys'
vincentwolsink commented 11 months ago

If you are still alive.. a new beta is available. 😉

Pissouxxx commented 11 months ago

27° ! at the right time ! I found the strength to upgrade! All work as expected !

Just a detail, If a click on the fan it throws an error. But if I open the card I can click anyware without error. I don't care because this button is useless.

image

image

Logger: homeassistant.components.websocket_api.http.connection
Source: components/climate/__init__.py:489
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 11:40:45 PM (3 occurrences)
Last logged: 11:48:32 PM

    [1850058920]
    [1561399208]

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 493, in async_set_hvac_mode
    await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 489, in set_hvac_mode
    raise NotImplementedError()
NotImplementedError
marc-cizeron commented 11 months ago

I'm going to upgrade, but I can't test right now because the Agua API seems to be unavailable. From the mobile APP or via HA.

Cette erreur provient d'une intégration personnalisée

Logger: custom_components.aguaiot
Source: custom_components/aguaiot/__init__.py:88
Integration: Micronova Agua IOT (documentation, issues)
First occurred: 09:07:20 (1 occurrences)
Last logged: 09:07:20

Unknown Agua IOT error: Error while fetching device information

It happens regularly. Have you ever had this problem @Pissouxxx?

Anyway, as soon as the API is available I will make some test.

marc-cizeron commented 11 months ago

Yes, the API is available, so here som bug traces :

Cette erreur provient d'une intégration personnalisée

Logger: custom_components.aguaiot
Source: custom_components/aguaiot/__init__.py:108
Integration: Micronova Agua IOT (documentation, issues)
First occurred: 09:15:11 (5 occurrences)
Last logged: 09:19:57

Unexpected error fetching aguaiot data: name 'self' is not defined
Traceback (most recent call last):
  File "/config/custom_components/aguaiot/__init__.py", line 94, in async_update_data
    await agua.fetch_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 287, in fetch_device_information
    await dev.update()
  File "/config/custom_components/aguaiot/aguaiot.py", line 358, in update
    await self.__update_device_information()
  File "/config/custom_components/aguaiot/aguaiot.py", line 413, in __update_device_information
    raise AguaIOTError("Error while fetching device information")
custom_components.aguaiot.aguaiot.AguaIOTError: Error while fetching device information

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 248, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/aguaiot/__init__.py", line 108, in async_update_data
    self.name,
    ^^^^
NameError: name 'self' is not defined
Pissouxxx commented 11 months ago

I installed this integration a few days ago. Before, I had the EFESTO module. I haven't noticed any service issues. Except that I had a lot of trouble getting it to work stably on my box (Freebox). I managed to start it from the mobile app once. Between the click and the start it took 30 seconds. The rest of the time it just didn't work. I had bugs on the application. I contacted Jolly-Mec who explained to me that they were having a lot of problems with Freebox and the AQUA module. That I had to put another wifi terminal at home to test (my stove is next to my box, it's not a distance problem). So I added an Aruba wifi terminal in ethernet to my box, I connected the stove to it and ... I have had absolutely no problems since then.

marc-cizeron commented 11 months ago

Dam ! @Pissouxxx, thanks. I have a Freebox too. And i've had some strange problems with my connected food processor (thermomix). I had to create a guest WIFI network dedicated to the Thermomix with internet access only. I'm going to do the same with the stove.

Pissouxxx commented 11 months ago

Before calling support I created a DMZ, routed all the ports to the stove etc etc etc. Nothing to do ! I found it hard to believe that Freebox Wifi created a particular problem, I hadn't had one before. The stove was well connected to wifi and I could ping it... I connected my stove in wifi to my phone (connected to internet with 4G) and, immediately, the application Jolly-Mec worked correctly on another phone without lag...