joleys / niko-home-control-II

Home Assistant Custom Integration for Niko Home Control II

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Electrical Heating/HVAC issue

sgi3200 opened this issue · comments

commented

I hope this is not already known issue. Getting these messages to the log:

Logger: custom_components.nhc2.nhccoco.coco
Source: custom_components/nhc2/nhccoco/coco.py:119
Integration: Niko Home Control II ([documentation](https://github.com/joleys/niko-home-control-II/blob/master/README.md), [issues](https://github.com/joleys/niko-home-control-II/issues))
First occurred: 14:54:58 (9 occurrences)
Last logged: 14:54:58

Class CocoElectricalheatingAction not found module 'custom_components.nhc2.nhccoco.coco' has no attribute 'CocoElectricalheatingAction', device: [{'BasicState': 'Off'}]
Logger: homeassistant.components.climate
Source: custom_components/nhc2/entities/generic_hvac_climate.py:114
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: 14:54:59 (2 occurrences)
Last logged: 14:54:59

Error adding entities for domain climate with platform nhc2
Error while setting up nhc2 platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 504, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 700, in _async_add_entity
    capabilities=entity.capability_attributes,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 282, in capability_attributes
    data[ATTR_PRESET_MODES] = self.preset_modes
                              ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nhc2/entities/generic_hvac_climate.py", line 114, in preset_modes
    for program in self._device.possible_programs:
TypeError: 'NoneType' object is not iterable

@sgi3200 can you provide me with a device list please? See: https://github.com/joleys/niko-home-control-II#i-need-to-see-the-device-list
Can you also tell which HVAC system is linked to your Niko Home Control system?

commented

@tijsverkoyen thank you Tijs, all required data sent by email, in the case you will find something else what I could help with, just let me know

Thx. I will try to have a look later this week.

@sgi3200 I think the changes in #81 should resolve your issues. And you will see a new device "AC".

Are you able to apply these changes manually in your local Home Assistant installation, and confirm if it is working?

But I need to take a better look at the warning Class CocoElectricalheatingAction not found module 'custom_components.nhc2.nhccoco.coco' has no attribute 'CocoElectricalheatingAction', device: [{'BasicState': 'Off'}] as that is still present.

commented

many thanks @tijsverkoyen, changes to those 2 files applied, seems it really helped, no record in the logfile so far related to generic_hvac device / generic_hvac_climate entity after HA restarted

@sgi3200 I have another PR (#82) which adds support for Electralheating Actions.

I suspect (as I don't own such a device) that you will be able to use the button to activate your electrical heaters from within Home Assistant.

If you apply these changes manually and would be able to test that would be very kind!

commented

@tijsverkoyen thank you again, Tijs, you are really fast ;-) changes applied, it helped to resolve the issue with unecessary records in HA logfile but I think this topic requires more attention ;-)

"electricalheating" device based on mqtt devices list has 3 basic states: On, Off, Triggered.

It seems Niko developers let generic heating/cooling device depending on the vendor/partner based on the documentation (https://mynikohomecontrol.niko.eu/Content/hobbyapi/documentation.pdf), pages 70-71
Heating/cooling module has a H/C button for manul triggering heating or cooling:
https://guide.niko.eu/display/HGNHC2V2/Heating+or+cooling+module
so, implementation of button is aboslutely correct, even though I think it won't be used in real life.

Reagarding to binary sensor, maybe it would by better to create a sensor with state defined based on basic state of the physical device (on/off/triggered). I think the state "triggered" is handled by a thermostat, once there is a condition/demand for heating that has to be started (means room temperature is lower than required) a thermostat sends a signal to electrical heating and the basic state of "electricalheating" is changed to "triggered". But this is something what I have to check and confirm.

Another issue I have just found it the thermostat device. Available programs predefined by NHC thermostat are: Day, Night, Eco, Off, Cool, Prog1, Prog2, Prog3 but the integration entity provides the following attributes: Comfort, Sleep, Eco, Off, Cool, Prog1, Prog2, Prog3. I would also add the "demand" as an attribute for thermostat entity with the following options: Heating, Cooling, None.

I have to find a free time to check (thru NodeRed mqtt) what exactly I am getting from hobby/control/devices/evt topic once a heating is triggered by a related thermostat. Maybe this weekend I will spend some time on this and will contact you once I get some usable results.

Changes applied, it helped to resolve the issue with unecessary records in HA logfile but I think this topic requires more attention ;-)

"electricalheating" device based on mqtt devices list has 3 basic states: On, Off, Triggered.

That is correct, but the value Triggered is not an actual status, it will never have that status. It is only used to "trigger" the BasicState property of the device.
It works the same way as the NHC Mood Action, see page 53.

It seems Niko developers let generic heating/cooling device depending on the vendor/partner based on the documentation (https://mynikohomecontrol.niko.eu/Content/hobbyapi/documentation.pdf), pages 70-71
Heating/cooling module has a H/C button for manul triggering heating or cooling:
https://guide.niko.eu/display/HGNHC2V2/Heating+or+cooling+module
so, implementation of button is aboslutely correct, even though I think it won't be used in real life.

I think you are confusing some devices. The ne Electricalheating (Action) is not the "Generic Heating/Cooling Implementation"

Reagarding to binary sensor, maybe it would by better to create a sensor with state defined based on basic state of the physical device (on/off/triggered). I think the state "triggered" is handled by a thermostat, once there is a condition/demand for heating that has to be started (means room temperature is lower than required) a thermostat sends a signal to electrical heating and the basic state of "electricalheating" is changed to "triggered". But this is something what I have to check and confirm.

See above.

Another issue I have just found it the thermostat device. Available programs predefined by NHC thermostat are: Day, Night, Eco, Off, Cool, Prog1, Prog2, Prog3 but the integration entity provides the following attributes: Comfort, Sleep, Eco, Off, Cool, Prog1, Prog2, Prog3. I would also add the "demand" as an attribute for thermostat entity with the following options: Heating, Cooling, None.

I have to find a free time to check (thru NodeRed mqtt) what exactly I am getting from hobby/control/devices/evt topic once a heating is triggered by a related thermostat. Maybe this weekend I will spend some time on this and will contact you once I get some usable results.

Can you create another issue for this part please, but be aware that some programs are mapped/translated to the ones that are used by HomeAssistant, see https://developers.home-assistant.io/docs/core/entity/climate/#presets and https://github.com/joleys/niko-home-control-II/blob/master/custom_components/nhc2/entities/generic_hvac_climate.py#L119C48-L119C48

@sgi3200 I releases v3.1.2 which includes the bug fix. And also v3.2.0 which adds the support for Electrical Heating Action

If your are using HACS they will appear soon as an update. You can install it, it will overwrite your local changes.