Overkiz integration - Local API [Development / Testers topic]

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

Hi guys, I tried to debug my weird behaviour and I found that

 response = await self.__post(f"events/{self.event_listener_id}/fetch")

returns empty events if it’s called immediately after async_execute_command but if I put some a little delay 1s so I get expected events. But this weird behaviour is just in the closing state.

edit: after some while observing of behaviour I found out the issue is for all states so I put sleep into async_execute_command and that fixed my “issue”

if command_name == OverkizCommand.SET_ORIENTATION or command_name == OverkizCommand.CLOSE or command_name == OverkizCommand.OPEN:
            time.sleep(2)

How can i install overkiz so it works local with somfy?

See instructions above :wink: .

Unfortunately something changed in core, and I need to write tests for diagnostics.py as well, and this is slowing down this PR. Didn’t figure out yet how to do this, and my time is quite limited :(.

I had problems that my local Somfy Tahoma Switch was some moments not available. I thought that it was something caused by my old network devices. But I have everything upgraded to new TP-Link Omada devices.

Unfortunately the problem still exists of not available entities on the Somfy Tahoma Switch.

image

I have 10 x covers (IO), 1 x awning (IO) and 6x smart smoke detector (IO) connected to the Tahoma switch.

This is in the log:

2023-10-30 00:05:24.631 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.119 seconds (success: True)
2023-10-30 00:05:54.616 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.104 seconds (success: True)
2023-10-30 00:06:24.616 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.104 seconds (success: True)
2023-10-30 00:06:54.640 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.112 seconds (success: True)
2023-10-30 00:07:24.729 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.215 seconds (success: True)
2023-10-30 00:07:54.519 ERROR (MainThread) [custom_components.overkiz] Error fetching device events data: Failed to connect.
2023-10-30 00:07:54.520 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.007 seconds (success: False)
2023-10-30 00:08:24.617 INFO (MainThread) [custom_components.overkiz] Fetching device events data recovered
2023-10-30 00:08:24.618 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.106 seconds (success: True)
2023-10-30 00:08:54.643 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.131 seconds (success: True)
2023-10-30 00:09:24.614 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.102 seconds (success: True)
2023-10-30 00:09:54.624 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.112 seconds (success: True)
2023-10-30 00:10:24.621 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.108 seconds (success: True)

2023-10-30 06:17:41.615 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.102 seconds (success: True)
2023-10-30 06:18:11.622 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.109 seconds (success: True)
2023-10-30 06:18:41.633 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.120 seconds (success: True)
2023-10-30 06:19:11.619 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.107 seconds (success: True)
2023-10-30 06:19:41.612 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.099 seconds (success: True)
2023-10-30 06:20:11.617 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.105 seconds (success: True)
2023-10-30 06:20:41.522 ERROR (MainThread) [custom_components.overkiz] Error fetching device events data: Failed to connect.
2023-10-30 06:20:41.523 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.010 seconds (success: False)
2023-10-30 06:21:11.625 INFO (MainThread) [custom_components.overkiz] Fetching device events data recovered
2023-10-30 06:21:11.626 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.114 seconds (success: True)
2023-10-30 06:21:41.621 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.110 seconds (success: True)
2023-10-30 06:22:11.615 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.103 seconds (success: True)
2023-10-30 06:22:41.625 DEBUG (MainThread) [custom_components.overkiz] Finished fetching device events data in 0.114 seconds (success: True)

Any idea why this is the case? Everything is local.