peribeir / homeassistant-rademacher

This custom integration provides access to Rademacher Devices connected to a HomePilot (or Start2Smart) bridge.
GNU General Public License v3.0
65 stars 13 forks source link

Set tilt position with DuoFern tubular motor actuator for venetian blinds #46

Closed rhedenser closed 2 years ago

rhedenser commented 2 years ago

Hello, first of all, thank you for your integration...my rollotube s-line duofern shutters work fine whithin HASS. Now I want to set the tilt position for the venetian blinds ( Raffstore ) which are connected to a duofern tabular motor actuator. I sniffed the command from the HomePilot web-app for setting the tilt position: {"name":"SET_SLAT_POS_CMD","value":51} for example. I See that there is a home assistant option for those covers "cover.set_cover_tilt_position". I did some ugly tests within the cover.py script from you. But it did not react on my tryouts. So can you give me some hints?

Please let me know If you need more informations.

peribeir commented 2 years ago

Hi Sorry for the late reply. I actually had been working on adding the tilt functionality to the cover entities. Since I don't actually have an actuator with tilt functionality I never got to test it. But maybe you can help me here. You got the command right, at least it matches what I have researched. What I actually need is to have the result from the status and capabilities commands, in order to reflect it in the entity state.

Can you please post the result of the following 2 GET requests? http://[homepilot-ip]/v4/devices?devtype=Actuator and http://[homepilot-ip]/devices/[deviceid]

rhedenser commented 2 years ago

Hi,

thank you for the reply. Here you have the answers to your requested requests: http://[homepilot-ip]/v4/devices?devtype=Actuator:

{ "response": "get_visible_devices", "devices": [ ...
{ "description": "Ihre Gerätebeschreibung", "deviceGroup": 2, "did": 10031, "hasErrors": 0, "iconSetInverted": 0, "iconSet": { "k": "iconset6" }, "messages": [], "name": "OG Raffstore Küche", "properties": { "closingContact": 3, "dawn": 3, "dusk": 3, "motion": 3, "rain": 3, "smartphone": 3, "smoke": 3, "sun": 3, "temperature": 3, "time": 3, "trigger": 3, "warning": 3, "wind": 3 }, "statusValid": true, "statusesMap": { "Manuellbetrieb": 0, "Position": 66, "slatposition": 0 }, "visible": true, "deviceNumber": "35000662", "uid": "4277d3_1", "voiceControlledBy": "", "origin": "HomePilot" }, ... ] }

http://[homepilot-ip]/devices/[deviceid]: { "error_description": "OK", "error_code": 0, "payload": { "device": { "capabilities": [ { "name": "WIND_STOP_CMD", "read_only": false, "timestamp": -1 }, { "name": "SET_SLAT_POS_CMD", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": -1 }, { "name": "INC_CMD", "read_only": false, "timestamp": -1 }, { "name": "PROD_CODE_DEVICE_LOC", "value": "35000662", "read_only": false, "timestamp": -1 }, { "name": "GOTO_VENTIL_POS_CMD", "read_only": false, "timestamp": -1 }, { "name": "REACHABILITY_EVT", "value": "true", "read_only": true, "timestamp": 1657795155 }, { "name": "CONTACT_OPEN_CMD", "read_only": false, "timestamp": -1 }, { "name": "NAME_DEVICE_LOC", "value": "OG Raffstore Küche", "read_only": false, "timestamp": -1 }, { "name": "REVERS_ON_POS_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "INTF_ID_DEVICE_LOC", "value": "3", "read_only": false, "timestamp": -1 }, { "name": "GOTO_DAWN_POS_CMD", "read_only": false, "timestamp": -1 }, { "name": "WIND_PROG_ACTIVE_EVT", "value": "false", "read_only": true, "timestamp": 1657795153 }, { "name": "RAIN_START_CMD", "read_only": false, "timestamp": -1 }, { "name": "REQ_STATUS_CMD", "read_only": false, "timestamp": -1 }, { "name": "AUTO_MODE_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "DAWN_AUTO_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "ID_DEVICE_LOC", "value": "10031", "read_only": false, "timestamp": -1 }, { "name": "PROTOCOL_ID_CFG", "value": "4277d3", "read_only": false, "timestamp": -1 }, { "name": "GOTO_POS_SLAT_CMD", "read_only": false, "timestamp": -1 }, { "name": "CONTACT_CLOSE_CMD", "read_only": false, "timestamp": -1 }, { "name": "WIND_DIR_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "GOTO_POS_CMD", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": -1 }, { "name": "SUN_STOP_CMD", "read_only": false, "timestamp": -1 }, { "name": "SUN_AUTO_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "STOP_CMD", "value": "false", "read_only": false, "timestamp": -1 }, { "name": "BLOCK_DET_EVT_PUSH_TEXT", "value": "", "read_only": false, "timestamp": -1 }, { "name": "VIS_DEVICE_LOC", "value": "true", "read_only": false, "timestamp": -1 }, { "name": "WIND_AUTO_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "BLOCK_DET_SENS_CFG", "value": "2", "min_value": "1", "max_value": "6", "read_only": false, "timestamp": 1657795155 }, { "name": "BLOCK_DET_CFG", "value": "false", "read_only": false, "timestamp": 1657795155 }, { "name": "WIND_START_CMD", "read_only": false, "timestamp": -1 }, { "name": "BLOCK_DET_EVT_PUSH_ENABLED", "value": "false", "read_only": false, "timestamp": -1 }, { "name": "MOTOR_REACT_TIME_CFG", "value": "0", "min_value": "0", "max_value": "1000", "step_size": "20", "read_only": false, "timestamp": -1 }, { "name": "BLOCK_DET_EVT", "value": "false", "read_only": true, "timestamp": 1657795153 }, { "name": "POS_DOWN_CMD", "read_only": false, "timestamp": -1 }, { "name": "DESCR_DEVICE_LOC", "value": "Ihre Gerätebeschreibung", "read_only": false, "timestamp": -1 }, { "name": "REVERS_AFTER_STOP_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "CURR_POS_CFG", "value": "66", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "POS_UP_CMD", "read_only": false, "timestamp": -1 }, { "name": "SLAT_RUNTIME_CFG", "value": "0.9", "min_value": "0.1", "max_value": "5.0", "step_size": "0.1", "read_only": false, "timestamp": 1657795153 }, { "name": "VERSION_CFG", "value": "4.7-1", "read_only": false, "timestamp": 1657795155 }, { "name": "RESET_WO_PAIR_CMD", "read_only": false, "timestamp": -1 }, { "name": "PROT_ID_DEVICE_LOC", "value": "4277d3_1", "read_only": false, "timestamp": -1 }, { "name": "MOTOR_REACT_FIX_TIMES_CFG", "value": "0", "min_value": "0", "max_value": "3", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "REVERS_ON_SUN_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "CURR_SLAT_POS_CFG", "value": "0", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "VENTIL_POS_MODE_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "ICONSET_LOC", "value": "iconset6", "read_only": false, "timestamp": -1 }, { "name": "JAL_MODE_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "DEVICE_TYPE_LOC", "value": "2", "read_only": false, "timestamp": -1 }, { "name": "RUNTIME_MOTOR_CFG", "value": "149", "min_value": "2", "max_value": "255", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "ICONSET_INV_LOC", "value": "false", "read_only": false, "timestamp": -1 }, { "name": "ROTATE_DIR_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "SUN_POS_CFG", "value": "50", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "RAIN_STOP_CMD", "read_only": false, "timestamp": -1 }, { "name": "RMT_STOP_PAIR_CMD", "read_only": false, "timestamp": -1 }, { "name": "VOICE_CONTROLLED_LOC", "value": "", "read_only": false, "timestamp": -1 }, { "name": "DUSK_AUTO_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "VENTIL_POS_CFG", "value": "80", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "RESET_FULL_CMD", "read_only": false, "timestamp": -1 }, { "name": "PUSH_CMD", "read_only": false, "timestamp": -1 }, { "name": "PAIRING_CONFIRMED_LOC", "value": "true", "read_only": false, "timestamp": -1 }, { "name": "RMT_START_PAIR_CMD", "read_only": false, "timestamp": -1 }, { "name": "DFLT_SLAT_POS_CFG", "value": "0", "min_value": "0", "max_value": "100", "step_size": "1", "read_only": false, "timestamp": 1657795153 }, { "name": "SUN_PROG_ACTIVE_EVT", "value": "false", "read_only": true, "timestamp": 1657795153 }, { "name": "GOTO_DUSK_POS_CMD", "read_only": false, "timestamp": -1 }, { "name": "SUN_START_CMD", "read_only": false, "timestamp": -1 }, { "name": "RAIN_PROG_ACTIVE_EVT", "value": "false", "read_only": true, "timestamp": 1657795153 }, { "name": "RAIN_AUTO_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "REVERS_ON_VENTIL_CFG", "value": "false", "read_only": false, "timestamp": 1657795153 }, { "name": "BLOCK_DET_REVERSING_CFG", "value": "false", "read_only": false, "timestamp": 1657795155 }, { "name": "RMT_START_UNPAIR_CMD", "read_only": false, "timestamp": -1 }, { "name": "RAIN_DIR_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "BLOCK_DET_MOTOR_TYPE_CFG", "value": "5", "min_value": "1", "max_value": "7", "read_only": false, "timestamp": 1657795155 }, { "name": "TIME_AUTO_CFG", "value": "true", "read_only": false, "timestamp": 1657795153 }, { "name": "PING_CMD", "read_only": false, "timestamp": -1 }, { "name": "DEC_CMD", "read_only": false, "timestamp": -1 } ], "scenes": [ { "id": 5014, "name": "OG Raffstore runter", "description": "Ihre Beschreibung" }, { "id": 5015, "name": "OG Raffstore hoch", "description": "Ihre Beschreibung" } ] } } }

Please let me know if you need someone to test or to get more informations about the actuator.

Best regards

peribeir commented 2 years ago

Checkout v1.9.0 and please test. I'll be waiting for feedback.

rhedenser commented 2 years ago

I did the update to Version 1.9.0. Now the Integration reports the following issue:

{

"Setup erneut versuchen" means "Try to redo the setup"

I tried to resolve issue by:

This issue completely blocks the integration and all devices.

Did I have to reinstall the integration? Or do you have any other ideas?

rhedenser commented 2 years ago

from home-assistant.log:

... File "/usr/local/lib/python3.10/xml/etree/ElementTree.py", line 1345, in XML return parser.close() xml.etree.ElementTree.ParseError: no element found: line 1, column 0 2022-07-15 08:37:22 ERROR (MainThread) [custom_components.rademacher] Unexpected error fetching rademacher data: 'slatposition' ... File "/config/custom_components/rademacher/init.py", line 67, in async_update_data return await manager.update_states() File "/usr/local/lib/python3.10/site-packages/homepilot/manager.py", line 88, in update_states device.update_state(states[did]) File "/usr/local/lib/python3.10/site-packages/homepilot/cover.py", line 101, in update_state self.cover_tilt_position = 100 - state["statusesMap"][ KeyError: 'slatposition'

peribeir commented 2 years ago

Please see if 1.9.1 fixes it.

rhedenser commented 2 years ago

I installed version v1.9.1 and version v1.9.2 and I get following message: "Setup erneut versuchen: can't set attribute 'has_tilt'"

from log: "Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.rademacher Source: custom_components/rademacher/init.py:67 Integration: Rademacher HomePilot (documentation, issues) First occurred: 21:34:34 (9 occurrences) Last logged: 21:39:03

Unexpected error fetching rademacher data: can't set attribute 'has_tilt' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/rademacher/init.py", line 67, in async_update_data return await manager.update_states() File "/usr/local/lib/python3.10/site-packages/homepilot/manager.py", line 88, in update_states device.update_state(states[did]) File "/usr/local/lib/python3.10/site-packages/homepilot/cover.py", line 103, in update_state self.has_tilt = False AttributeError: can't set attribute 'has_tilt'"

I saw issue #50 and I wonder why Maaaatze reported that the fix worked for him.

peribeir commented 2 years ago

The error you are mentioning was indeed a problem in 1.9.1. But it should really be fixed in 1.9.2. Did you restart Home Assistant after installing v1.9.2?

rhedenser commented 2 years ago

Ok maybe there was an issue when downloading the version with hacs. Because I downloaded version 1.9.2 and in the manifest there was still the version 1.9.1 mentioned.

Now I manually updated the integration. After the restart I get the following message: "Setup erneut versuchen: can't set attribute 'can_set_tilt_position'"

Logfile: "Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.rademacher Source: custom_components/rademacher/init.py:67 Integration: Rademacher HomePilot (documentation, issues) First occurred: 11:00:46 (10 occurrences) Last logged: 11:06:32

Unexpected error fetching rademacher data: can't set attribute 'can_set_tilt_position' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data return await self.update_method() File "/config/custom_components/rademacher/init.py", line 67, in async_update_data return await manager.update_states() File "/usr/local/lib/python3.10/site-packages/homepilot/manager.py", line 88, in update_states device.update_state(states[did]) File "/usr/local/lib/python3.10/site-packages/homepilot/cover.py", line 104, in update_state self.can_set_tilt_position = False AttributeError: can't set attribute 'can_set_tilt_position'"

So it is still not working for me. Best regards.

peribeir commented 2 years ago

Yes, you are right. Strange that it got reported as working. New version on the way

peribeir commented 2 years ago

Please check v1.9.3. Hope it finally solves the problem.

rhedenser commented 2 years ago

Thank you so much! I works and I am happy now.