Overkiz integration - Local API [Development / Testers topic]

This will already be handled by debug logging of an integration.

Quick question - will this support Tahoma Div Rail v2?

1 Like

Back in town

(mick, I do not know where i can post that on the GIT)

Just reconfigured back my installation with local API in debug mode and compared the two modes

Seems that they are not working the same way.

In Cloud mode there are much more attributes update commands that in local API one
I suppose this is a limitation of event handling in local API mode that is compensated by the Somfy cloud services in some ways.

This might be an issue for devices working in asynchronous IO mode (such as remote devices runing on batteries) that are reporting their updated attributes every 5 to 10 minutes to the box (the switch in my case) but that attributes updates do not seem to be sent back to HA when using local API. But if we reboot HA, we get the right attributes updated.

Regarding climates i have HeatingValveIOComponent in my system
They are prefectly recognised, configured…

BUT

They suffer the issue i just described above (requested temperature when updated on the device are only reported when i reboot HA, but they are reported)

AND

When the current temperature is received, there are some casting issues. I put additional debug message to better understand from where they are coming from in file valve_heating_temperature_interface i added two lines

    def current_temperature(self) -> float | None:
        LOGGER.debug('current temperature')
        LOGGER.debug(self.temperature_device.states[OverkizState.CORE_TEMPERATURE])
        """Return the current temperature."""
        if temperature := self.temperature_device.states[OverkizState.CORE_TEMPERATURE]:
            return temperature.value_as_float

        return None

Result was explaining the error… Integer with value 23.1

2023-09-03 11:33:03.384 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.156 seconds (success: True)

2023-09-03 11:33:03.385 DEBUG (MainThread) [custom_components.overkiz] current temperature

2023-09-03 11:33:03.385 DEBUG (MainThread) [custom_components.overkiz] State(name='core:TemperatureState', type=<DataType.FLOAT: 2>, value=23.1)

2023-09-03 11:33:03.403 DEBUG (MainThread) [custom_components.overkiz] current temperature

2023-09-03 11:33:03.404 DEBUG (MainThread) [custom_components.overkiz] State(name='core:TemperatureState', type=<DataType.FLOAT: 2>, value=23.3)

2023-09-03 11:33:03.417 DEBUG (MainThread) [custom_components.overkiz] current temperature

2023-09-03 11:33:03.417 DEBUG (MainThread) [custom_components.overkiz] State(name='core:TemperatureState', type=<DataType.INTEGER: 1>, value=23.1)

2023-09-03 11:33:03.424 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved

Traceback (most recent call last):

  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval

    await self._async_refresh(log_failures=True, scheduled=True)

  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh

    self.async_update_listeners()

  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners

    update_callback()

  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 431, in _handle_coordinator_update

    self.async_write_ha_state()

  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state

    self._async_write_ha_state()

  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in _async_write_ha_state

    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/overkiz/climate_entities/valve_heating_temperature_interface.py", line 102, in current_temperature

    return temperature.value_as_float

           ^^^^^^^^^^^^^^^^^^^^^^^^^^

Same when updating requested temperature from HA

Is this because the cloud version has a layer cleaning casting issues ? Like it seems they are cleaning event handling and propagation of attribute updates ?

2023-09-03 12:05:30.147 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.037 seconds (success: True)
2023-09-03 12:05:30.148 DEBUG (MainThread) [custom_components.overkiz] current temperature
2023-09-03 12:05:30.148 DEBUG (MainThread) [custom_components.overkiz] State(name='core:TemperatureState', type=<DataType.FLOAT: 2>, value=23.1)
2023-09-03 12:05:30.174 DEBUG (MainThread) [custom_components.overkiz] current temperature
2023-09-03 12:05:30.174 DEBUG (MainThread) [custom_components.overkiz] State(name='core:TemperatureState', type=<DataType.FLOAT: 2>, value=23.3)
2023-09-03 12:05:30.198 DEBUG (MainThread) [custom_components.overkiz] current temperature
2023-09-03 12:05:30.198 DEBUG (MainThread) [custom_components.overkiz] State(name='core:TemperatureState', type=<DataType.INTEGER: 1>, value=23.1)
2023-09-03 12:05:30.200 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140681185243712] core:TemperatureState is not a float
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2011, 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 "/config/custom_components/overkiz/climate_entities/valve_heating_temperature_interface.py", line 110, in async_set_temperature
    await self.executor.async_execute_command(
  File "/config/custom_components/overkiz/executor.py", line 103, in async_execute_command
    await self.coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 262, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 431, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in _async_write_ha_state
    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/overkiz/climate_entities/valve_heating_temperature_interface.py", line 102, in current_temperature
    return temperature.value_as_float
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyoverkiz/models.py", line 334, in value_as_float
    raise TypeError(f"{self.name} is not a float")
TypeError: core:TemperatureState is not a float

Hi @imick , I would like to ask you about the idea of decreasing UPDATE_INTERVAL for local API to a lower value, something like 5s? Or to decrease the interval just in cases when some device is in some movement state, like blinds/covers.
I suppose the state is periodically fetched by the client and the box doesn’t push any events directly to the client.

The latter is already built in (in cloud and local). When you execute a command, it will poll every second for state updates until execution is finished.

In regards to lowering the default polling interval for local API. This could be added later, first focus is to get the local API in HA. The reason we didn’t lower it yet, is because we got feedback on this in an early draft, that 30 seconds is the lowest interval that HA accepts. We will start this discussion later again. :wink:

What is your use-case here?

Hmm, it’s strange, You are right, if the cover is going up the state is updating every second, but if the cover is in the closing state / is going down the state isn’t updating and the state is updated after ~30 seconds. And this behavior is just in local API mode, not in the cloud mode.

My case is observing the closed state and setting the tilt position after that.

I sent logs to the PM.

It already does!
I’ve been using it for a year I think!

Been using the local test version for a while now, and still happy with it.
I did notice that the lights I have on my porch react quite fast when I give a command, but the state is updated only after a while (20 to 30 seconds)

Would be good to collect your log (with debug mode) turned on. If it takes 30 seconds, it means that something went wrong around the event handling.

Will do that!

Hello , I’m very interested by the local API , Thanks a lot for the job

I’m trying to configure the Local API, and I get an error in the log:

2023-09-13 16:16:01.583 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:01.587 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:01.595 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:01.596 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:01.599 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:01.603 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:01.607 WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum ‘UIWidget’>
2023-09-13 16:16:05.590 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry gateway-2035-7912-3242.local:8443 for overkiz
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/overkiz/init.py”, line 113, in async_setup_entry*
  • setup, scenarios = await asyncio.gather(*
  •                   ^^^^^^^^^^^^^^^^^^^^^*
    
  • File “/usr/local/lib/python3.11/site-packages/backoff/_async.py”, line 151, in retry*
  • ret = await target(*args, *kwargs)
  •      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py”, line 667, in get_scenarios*
  • response = await self.__get(“actionGroups”)*
  •           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*
    
  • File “/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py”, line 839, in __get*
  • await self.check_response(response)*
  • File “/usr/local/lib/python3.11/site-packages/pyoverkiz/client.py”, line 966, in check_response*
  • raise OverkizException(result)*
    pyoverkiz.exceptions.OverkizException: {‘error’: ‘Bus error’, ‘errorCode’: ‘DBUS_ERROR’}

I use the new motors RS100 solar
Thanks for your help

Which version do you use? Do you face the same issues with the cloud integration?

I will be working on this from October onwards, can you hit me up on Discord (_imick) so we can debug this? Haven’t seen this error yet.

when I use the cloud integration it’s OK
version:
“custom_components”: {
“overkiz”: {
“version”: “2023.8.20-T213739Z”,
“requirements”: [
“pyoverkiz==1.10.1”

Let’s discuss on Discord some day. Seems to go wrong on retrieving the action groups (scenes), which hub do you have?

I’ve a Tahoma switch, firmware : 2023.3.4
OK for Discord
It’s in my secondary residence and I’ve no remote access for the moment…

Hello @imick, is there a release date for the local mode in core ?

No. It is almost finished, but need to address some feedback and make the changes.

I am almost at the end of my holidays now, but when I return I will probably be busy, so I can’t give any ETA now.

4 Likes

Hi,

I also have the DynamicRollerShutter warning for my RS100 Solar io roller shutters, but no errors for me, only the warning.

WARNING (MainThread) [pyoverkiz.enums.ui] Unsupported value DynamicRollerShutter has been returned for <enum 'UIWidget'>

DEBUG (MainThread) [custom_components.overkiz] The following device has been retrieved. Report an issue if not supported correctly (Device(attributes=States(_states=[State(name='io:Features', type=<DataType.JSON_ARRAY: 10>, value=['closureSpeed', 'batteryLevel', 'batteryAutonomy']), State(name='core:SupportedManufacturerSettingsCommands', type=<DataType.JSON_ARRAY: 10>, value=['dead_man_up', 'dead_man_down', 'dead_man_stop', 'dead_man_impulse_up', 'dead_man_impulse_down', 'enter_settings_mode', 'save_upper_end_limit', 'save_lower_end_limit', 'set_auto_end_limits', 'set_auto_upper_end_limit', 'set_auto_lower_end_limit', 'save_settings', 'invert_rotation', 'save_my_position', 'delete_my_position', 'set_open_level', 'set_security_level', 'set_discreet_mode_speed', 'set_nominal_mode_speed', 'set_soft_start', 'set_soft_stop', 'set_smart_protect', 'reset_actuator', 'double_power_cut', 'eject_from_setting_mode', 'set_OEM_Battery_Reference', 'set_OEM_Battery_Name', 'set_OEM_SolarPanel_Reference', 'set_OEM_SolarPanel_Name']), State(name='core:Manufacturer', type=<DataType.STRING: 3>, value='Somfy'), State(name='core:FirmwareRevision', type=<DataType.STRING: 3>, value='5163338B05')]), available=True, enabled=True, label=** **, device_url=io://****-****-****/******#1, gateway_id=****-****-****, device_address=******, subsystem_id=1, is_sub_device=False, controllable_name='io:DynamicRollerShutterIOComponent', definition=Definition(commands=CommandDefinitions(_commands=[CommandDefinition(command_name='setDeployment', nparams=1), CommandDefinition(command_name='addLockLevel', nparams=1), CommandDefinition(command_name='down', nparams=0), CommandDefinition(command_name='startIdentify', nparams=0), CommandDefinition(command_name='up', nparams=0), CommandDefinition(command_name='identify', nparams=0), CommandDefinition(command_name='setClosureAndLinearSpeed', nparams=1), CommandDefinition(command_name='advancedRefresh', nparams=1), CommandDefinition(command_name='stop', nparams=0), CommandDefinition(command_name='delayedStopIdentify', nparams=1), CommandDefinition(command_name='runManufacturerSettingsCommand', nparams=2), CommandDefinition(command_name='open', nparams=0), CommandDefinition(command_name='unpairAllOneWayControllers', nparams=0), CommandDefinition(command_name='setConfigState', nparams=1), CommandDefinition(command_name='pairOneWayController', nparams=1), CommandDefinition(command_name='unpairAllOneWayControllersAndDeleteNode', nparams=0), CommandDefinition(command_name='setClosure', nparams=1), CommandDefinition(command_name='wink', nparams=1), CommandDefinition(command_name='stopIdentify', nparams=0), CommandDefinition(command_name='refreshMemorized1Position', nparams=0), CommandDefinition(command_name='sendIOKey', nparams=0), CommandDefinition(command_name='keepOneWayControllersAndDeleteNode', nparams=0), CommandDefinition(command_name='setPositionAndLinearSpeed', nparams=1), CommandDefinition(command_name='setMemorized1Position', nparams=1), CommandDefinition(command_name='getName', nparams=0), CommandDefinition(command_name='close', nparams=0), CommandDefinition(command_name='setName', nparams=1), CommandDefinition(command_name='setSecuredPosition', nparams=1), CommandDefinition(command_name='setPosition', nparams=1), CommandDefinition(command_name='unpairOneWayController', nparams=1), CommandDefinition(command_name='resetLockLevels', nparams=0), CommandDefinition(command_name='my', nparams=0), CommandDefinition(command_name='removeLockLevel', nparams=1)]), states=[StateDefinition(qualified_name='core:BatteryState', type=None, values=None), StateDefinition(qualified_name='core:BatteryLevelState', type=None, values=None), StateDefinition(qualified_name='core:AdditionalStatusState', type=None, values=None), StateDefinition(qualified_name='core:ClosureState', type=None, values=None), StateDefinition(qualified_name='core:TargetClosureState', type=None, values=None), StateDefinition(qualified_name='core:SecuredPositionState', type=None, values=None), StateDefinition(qualified_name='core:ManufacturerSettingsState', type=None, values=None), StateDefinition(qualified_name='core:OpenClosedState', type=None, values=None), StateDefinition(qualified_name='core:MovingState', type=None, values=None), StateDefinition(qualified_name='core:ManufacturerDiagnosticsState', type=None, values=None), StateDefinition(qualified_name='core:StatusState', type=None, values=None), StateDefinition(qualified_name='core:NameState', type=None, values=None), StateDefinition(qualified_name='core:Memorized1PositionState', type=None, values=None), StateDefinition(qualified_name='core:CommandLockLevelsState', type=None, values=None), StateDefinition(qualified_name='core:DiscreteRSSILevelState', type=None, values=None), StateDefinition(qualified_name='core:RSSILevelState', type=None, values=None)], widget_name='DynamicRollerShutter', ui_class='RollerShutter', qualified_name=None), data_properties=None, widget=<UIWidget.UNKNOWN: 'unknown'>, ui_class=<UIClass.ROLLER_SHUTTER: 'RollerShutter'>, states=States(_states=[State(name='core:StatusState', type=<DataType.STRING: 3>, value='available'), State(name='core:CommandLockLevelsState', type=<DataType.JSON_OBJECT: 11>, value=[]), State(name='core:DiscreteRSSILevelState', type=<DataType.STRING: 3>, value='good'), State(name='core:RSSILevelState', type=<DataType.INTEGER: 1>, value=98), State(name='core:BatteryState', type=<DataType.STRING: 3>, value='full'), State(name='core:BatteryLevelState', type=<DataType.INTEGER: 1>, value=100), State(name='core:ManufacturerSettingsState', type=<DataType.JSON_OBJECT: 11>, value={'current_position': 0}), State(name='core:ClosureState', type=<DataType.INTEGER: 1>, value=0), State(name='core:OpenClosedState', type=<DataType.STRING: 3>, value='open'), State(name='core:TargetClosureState', type=<DataType.INTEGER: 1>, value=0), State(name='core:MovingState', type=<DataType.BOOLEAN: 6>, value=False), State(name='core:NameState', type=<DataType.STRING: 3>, value='Volet'), State(name='core:Memorized1PositionState', type=<DataType.INTEGER: 1>, value=50)]), type=<ProductType.ACTUATOR: 1>, place_oid=None))

The devices work fine in HA.

2 Likes

As a side node, I have some UI translation issues with the position selection of my gate opener:

Another user also reported this on GitHub for the cloud integration, we will fix this warning in a bit.

This is related to the Custom Overkiz PR# method for installation. You won’t face this when you directly check-out the source / eventually in Home Assistant core.

2 Likes