maheus / fumis_integration

Homeassistant Fumis Integration
10 stars 3 forks source link

Fumis no entities #4

Closed Lirik-JuKi closed 2 years ago

Lirik-JuKi commented 2 years ago

I did the integration without any problems, but no entities or devices appear to me. for curl curl -H 'username:0016D00+++++' -H 'password:++++' https://api.fumis.si/v1/status/ have answer: {"apiVersion":"1.0","unit":{"id":"0016D00

maheus commented 2 years ago

hi @Lirik-JuKi ,

do you have any errors in homeassitant log ?

Lirik-JuKi commented 2 years ago

yes. `Logger: homeassistant.components.sensor Source: custom_components/fumis/fumis/models.py:103 Integration: Сенсор (documentation, issues) First occurred: 12:18:27 (5 occurrences) Last logged: 12:18:27

fumis: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 718, in async_device_update await task File "/config/custom_components/fumis/sensor.py", line 140, in async_update self.info = await self.fumis.update_info() File "/config/custom_components/fumis/fumis/fumis.py", line 123, in update_info self.info = Info.from_dict(data) File "/config/custom_components/fumis/fumis/models.py", line 103, in from_dict ecomode_type=int(ecoMode.get("ecoModeSetType", "Unknown")), TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'`

maheus commented 2 years ago

ok i think i understood

maheus commented 2 years ago

there is a problem with ecomode , please replace "Unknown" by -1

 ecomode_type=int(ecoMode.get("ecoModeSetType", -1)),

and restart

Lirik-JuKi commented 2 years ago

no any result. ` Logger: homeassistant.components.sensor Source: custom_components/fumis/fumis/models.py:103 Integration: Сенсор (documentation, issues) First occurred: 13:26:17 (15 occurrences) Last logged: 13:29:45

fumis: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 718, in async_device_update await task File "/config/custom_components/fumis/sensor.py", line 140, in async_update self.info = await self.fumis.update_info() File "/config/custom_components/fumis/fumis/fumis.py", line 123, in update_info self.info = Info.from_dict(data) File "/config/custom_components/fumis/fumis/models.py", line 103, in from_dict ecomode_type=int(ecoMode.get("ecoModeSetType", -1)), TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' `

maheus commented 2 years ago

:( same error , i suppose ecoModeSetType not send anything

maheus commented 2 years ago

in curl response , do you have :

    "ecoMode": {
      "ecoModeSetType": 1,
      "ecoModeEnable": 1
    },

?

Lirik-JuKi commented 2 years ago

i have

"ecoMode":{"ecoModeSetType":null,"ecoModeEnable":null},

maheus commented 2 years ago

ok thanks , i fix it this night

maheus commented 2 years ago

@Lirik-JuKi do you can test with new version please

rmpirescosta commented 2 years ago

I can also express the changes. mine doesn't change the temperature but as is the water the boiler doesn't bother me either. yes to turn it on and off.

Lirik-JuKi commented 2 years ago

@Lirik-JuKi do you can test with new version please yes, i can, some minnits, pls

Lirik-JuKi commented 2 years ago

The entities have appeared.

Screenshot 2022-03-02 162340

There is also a new error in the log

< Logger: homeassistant.components.climate Source: custom_components/fumis/climate.py:187 Integration: Климат (documentation, issues) First occurred: 16:21:02 (4 occurrences) Last logged: 16:22:43

Error adding entities for domain climate with platform fumis Error while setting up fumis platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 782, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 574, in _async_write_ha_state attr.update(self.state_attributes or {}) File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 302, in state_attributes data[ATTR_PRESET_MODE] = self.preset_mode File "/config/custom_components/fumis/climate.py", line 187, in preset_mode return FUMIS_PRESET_TO_HA[self._ecomode_state] KeyError: 'unknown'

maheus commented 2 years ago

I can also express the changes. mine doesn't change the temperature but as is the water the boiler doesn't bother me either. yes to turn it on and off.

yes i suppose the temperature change is different because you using a hybride mode (water), you can test with curl . (first curl and after change the temperature on the stove , renew curl and view differences )

maheus commented 2 years ago

thanks @Lirik-JuKi , i'm going to fix

maheus commented 2 years ago

fix pushed, i force ecomode to 0 if the api return None . temporarly fix for the moment @Lirik-JuKi

Lirik-JuKi commented 2 years ago

now it works. thanks.