Wow, great job with th new release and the new features and improvements. I’ll have a busy weekend driving kids around to their sports and next week we are on a holiday.
I’ll provide you with feedback next month when I’m back home.
Hi,
The Nikobus integration was working before while I was testing it.
Because I still used OpenHAB for some other things that I still had to implement, I still used OpenHAB.
Today I wanted to switch over to HA, and did all the upgrades, Nikobus integration give an error.
Normaly I changed all my config-files, when there was an upgrade that needed that.
I get this error
I bought also a RS232 to IP module, but the RS232 to USB and RS232 to IP give both the same error.
How can I see the problem?
Here are some error logs
Deze fout is ontstaan door een aangepaste integratie.
Logger: homeassistant
Bron: custom_components/nikobus/coordinator.py:118
integratie: Nikobus (documentatie, problemen)
Eerst voorgekomen: 15:24:33 (2 gebeurtenissen)
Laatst gelogd: 15:25:23
Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/config/custom_components/nikobus/__init__.py", line 56, in async_update_options
await coordinator.async_config_entry_updated(entry)
File "/config/custom_components/nikobus/coordinator.py", line 106, in async_config_entry_updated
await self._async_update_coordinator_settings()
File "/config/custom_components/nikobus/coordinator.py", line 118, in _async_update_coordinator_settings
self.update_method = self._get_update_method()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NikobusDataCoordinator' object has no attribute '_get_update_method'. Did you mean: 'update_method'?
Deze fout is ontstaan door een aangepaste integratie.
Logger: custom_components.nikobus.config_flow
Bron: custom_components/nikobus/config_flow.py:39
integratie: Nikobus (documentatie, problemen)
Eerst voorgekomen: 15:22:58 (3 gebeurtenissen)
Laatst gelogd: 15:25:17
IP/Port validation error: not enough values to unpack (expected 2, got 1)
IP/Port validation error: [Errno 113] Host is unreachable
Logger: homeassistant.config_entries
Bron: config_entries.py:594
Eerst voorgekomen: 15:21:42 (1 gebeurtenissen)
Laatst gelogd: 15:21:42
Error setting up entry Nikobus for nikobus
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nikobus/__init__.py", line 44, in async_setup_entry
await coordinator.initial_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NikobusDataCoordinator' object has no attribute 'initial_update_data'
Thanks,
Bug found, new release available
Thank you. It’s working fine now.
Hi,
It’s very strange. everything is working fine, but if a look a the integrations-page, I notice that the Nikobus addon gives an error.
This is the error-log.
Logger: homeassistant.config_entries
Bron: config_entries.py:594
Eerst voorgekomen: 12:03:18 (1 gebeurtenissen)
Laatst gelogd: 12:03:18
Error setting up entry Nikobus - 200.200.1.81:503 for nikobus
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/nikobus/__init__.py", line 44, in async_setup_entry
await coordinator.initial_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NikobusDataCoordinator' object has no attribute 'initial_update_data'
Interesting, I see the why you get this error. Will correct.
What I do not get is why I do not have the same, anyway, new version soon.
New release available, I see why I do not get the same, I have a feedback module so I do not use the same refresh mechanism as you.
Hi,
Now I don’t get the error.
I have a a little question (request)
In OpenHAB there aren’t a lot of updates, but in Home Assistant, the are a lot (what is very nice). Everytime HA or one of the addon’s have an update, I do the updates.
The only problem is that the Nikobus-component ‘forget’ the status of the shutters.
I know I can give the initial position in the config, but is’n it posilible to restore the last position, since it is stored in the history database?
Yes, should not be a problem to restore last know state.
The last release includes a lot of new features, I’m still gathering feedback and correcting bugs, while stable I will look at restoring last know cover state.
The integration has grown, and it impossible for me now to test all possible scenario’s.
Thanks to a great user community I’m getting a lot of feedback that helps troubleshoot and fix new features as old ones.
I have a problem with update up the shutters, when I press the real buttons.
If I press them, HA doesn’t show the action.
In the button-file, I fill the correct address in the ‘impacted_module’-variable.
It’s working fine with the lights (Switch Modules).
I’m on vacation this week away from home. will be checking next week.
Could you enable debuglog, press the physical button, disable debuglog and share it with me. thanks !
if you want to restore last cover state, will be part of next release…
Still wondering how this play with the “initial_position” ? do we keep it ? do we replace it ?
Open for suggestion
in cover.py
1- Add to import
from homeassistant.helpers.restore_state import RestoreEntity
2- Modify class NikobusCoverEntity to add RestoreEntity
class NikobusCoverEntity(CoordinatorEntity, CoverEntity, RestoreEntity):
3- Modify async_added_to_hass as follow
async def async_added_to_hass(self):
"""Register callbacks when entity is added to hass."""
await super().async_added_to_hass()
# Restore the previous state
if (last_state := await self.async_get_last_state()) and ATTR_POSITION in last_state.attributes:
self._position = float(last_state.attributes[ATTR_POSITION])
_LOGGER.debug("Restored position for %s to %s", self._attr_name, self._position)
# Subscribe to nikobus_button_pressed event
self.hass.bus.async_listen('nikobus_button_pressed', self._handle_nikobus_button_event)`
Hi,
It’s very strange, after rebooting HA, the feedback of the shutters where working.
According to me, there is no need anymore for “initial_position”.
Before I was not using it also, because then you could see that the status is maybe different then the one that is shown.
@dewildep do you use “initial_position” or shall I replace it will last know state ? at integration setup, the initial state will be “open” then at each restart the last know state (position) will be restored.
Let me know.
Hi,
i tried “initial_position” but for me it is only beneficial if I know that I will restart the integration and I first need to set all my rollers manually to the state defined in the “initial_position”.
So i don’t use it anymore.
For me it is ok to replace it with the last know state.
How to Debug Cover Integration
-
Set debug mode for Nikobus:
-
Restart Home Assistant
Then check the log for messages like this:
[custom_components.nikobus.cover] PositionEstimator initialized with duration: 45.0 seconds
[custom_components.nikobus.cover] NikobusCoverEntity initialized for Salon Volet Terrasse (address: 9105, channel: 2)
[custom_components.nikobus.cover] PositionEstimator initialized with duration: 48.0 seconds
[custom_components.nikobus.cover] NikobusCoverEntity initialized for Salon Volet Jardin (address: 9105, channel: 3)
[custom_components.nikobus.cover] PositionEstimator initialized with duration: 29.0 seconds
[custom_components.nikobus.cover] NikobusCoverEntity initialized for Salon Volet Sofa (address: 9105, channel: 4)
You should see a PositionEstimator instance for each cover with the correct operation time. Ensure everything is set up as it should be.
Next, check the state restore of the cover:
- Position should be between 0 (fully closed) and 100 (fully open)
- State should be:
- 0: Stopped
- 1: Opening
- 2: Closing
If you see anything other than 0, it may indicate Home Assistant restarted while a cover was moving.
[custom_components.nikobus.cover] Restored position for Salon Volet Terrasse to 100.0
[custom_components.nikobus.cover] Initialized previous state for Salon Volet Terrasse to 0
[custom_components.nikobus.cover] Restored position for Salon Volet Jardin to 100.0
[custom_components.nikobus.cover] Initialized previous state for Salon Volet Jardin to 0
[custom_components.nikobus.cover] Restored position for Salon Volet Sofa to 100.0
[custom_components.nikobus.cover] Initialized previous state for Salon Volet Sofa to 0
You may also see periodic data refreshes like this:
[custom_components.nikobus.cover] Coordinator update received for Salon Volet Terrasse. Current state: 0 Position: 100.0
[custom_components.nikobus.cover] No state change detected for Salon Volet Terrasse. Skipping update.
[custom_components.nikobus.cover] Coordinator update received for Salon Volet Jardin. Current state: 0 Position: 100.0
[custom_components.nikobus.cover] No state change detected for Salon Volet Jardin. Skipping update.
[custom_components.nikobus.cover] Coordinator update received for Salon Volet Sofa. Current state: 0 Position: 100.0
[custom_components.nikobus.cover] No state change detected for Salon Volet Sofa. Skipping update.
If the data looks correct, you’re ready to test the integration.
If not, please post the relevant data here for further review.
Thanks!