tschamm / boschshc-hass

Home Assistant component for accessing Bosch Smart Home Controller using boschshcpy python library.
Other
157 stars 24 forks source link

Rollladensteuerung II - Jalousie/Raffstore Unterstützung (Neigung) + Rawscan Abfrage über HA? #100

Closed Matze89x closed 10 months ago

Matze89x commented 1 year ago

Hello to you, thanks again for providing this addon.

I would like to ask for a function, and that is to additionally include the tilt angle for blinds and external venetian blinds in the shutter control II. (For cover.open_cover_tilt, cover.close_cover_tilt, cover.stop_cover_tilt, cover.toggle_tilt).

Very much I would like to do a rawscan (I have run quite a few attempts.... [tschamm/boschshcpy/issues/29]. Is there any possibility to query via home assistant or via ssh in HA?

Thanks a lot


Hallo an euch, nochmals vielen Dank für die Bereitstellung dieses Addons.

Gerne würde ich um eine Funktion bitten, und zwar bei der Rolladensteuerung II zusätzlich den Neigungswinkel mit einzubinden für Jalousien und Raffstores. (Für cover.open_cover_tilt, cover.close_cover_tilt, cover.stop_cover_tilt, cover.toggle_tilt)

Sehr gerne würde ich ein Rawscan machen (ich habe etliche Versuche ausgeführt... [tschamm/boschshcpy/issues/29]. Besteht die Möglichkeit einer Abfrage über Home Assistant oder per ssh in HA?

Vielen Dank

imageimage

current_position: 0
device_class: shutter
friendly_name: Raffstore Wohnzimmer Rechts
supported_features: 15
Matze89x commented 1 year ago

Hello, please add the "tilt" in Home Assistant. I have the rawcodes.

the first is a normal shutter (example) and the second the Raffstore (Jalousie) with tilt:

Normal Shutter - device + services

   {
        "@type": "device",
        "rootDeviceId": "64-da-a0-40-05-d8",
        "id": "hdm:ZigBee:dc8e95fffeb5d89c",
        "deviceServiceIds": [
            "ShutterControl",
            "CommunicationQuality",
            "PowerMeter",
            "ChildProtection",
            "SwitchConfiguration"
        ],
        "manufacturer": "BOSCH",
        "roomId": "hz_11",
        "deviceModel": "MICROMODULE_SHUTTER",
        "serial": "DC8E95FFFEB5D89C",
        "profile": "GENERIC",
        "name": "Rollo KiZi Rechts",
        "status": "AVAILABLE",
        "childDeviceIds": [],
        "supportedProfiles": []
    }

...
[
    {
        "@type": "DeviceServiceData",
        "id": "ShutterControl",
        "deviceId": "hdm:ZigBee:dc8e95fffeb5d89c",
        "state": {
            "@type": "shutterControlState",
            "calibrated": true,
            "referenceMovingTimes": {
                "movingTimeTopToBottomInMillis": 23100,
                "movingTimeBottomToTopInMillis": 23100
            },
            "level": 1.0,
            "operationState": "STOPPED",
            "endPositionAutoDetect": true,
            "endPositionSupported": true,
            "delayCompensationTime": 0.3,
            "delayCompensationSupported": true,
            "automaticDelayCompensation": true
        },
        "operations": [
            "decrementOpenLevel",
            "incrementOpenLevel"
        ],
        "path": "/devices/hdm:ZigBee:dc8e95fffeb5d89c/services/ShutterControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "CommunicationQuality",
        "deviceId": "hdm:ZigBee:dc8e95fffeb5d89c",
        "state": {
            "@type": "communicationQualityState",
            "quality": "UNKNOWN"
        },
        "path": "/devices/hdm:ZigBee:dc8e95fffeb5d89c/services/CommunicationQuality"
    },
    {
        "@type": "DeviceServiceData",
        "id": "SwitchConfiguration",
        "deviceId": "hdm:ZigBee:dc8e95fffeb5d89c",
        "state": {
            "@type": "SwitchConfigurationState",
            "switchType": "PUSHBUTTON",
            "swapInputs": false
        },
        "path": "/devices/hdm:ZigBee:dc8e95fffeb5d89c/services/SwitchConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ChildProtection",
        "deviceId": "hdm:ZigBee:dc8e95fffeb5d89c",
        "state": {
            "@type": "ChildProtectionState",
            "childLockActive": false
        },
        "path": "/devices/hdm:ZigBee:dc8e95fffeb5d89c/services/ChildProtection"
    },
    {
        "@type": "DeviceServiceData",
        "id": "PowerMeter",
        "deviceId": "hdm:ZigBee:dc8e95fffeb5d89c",
        "state": {
            "@type": "powerMeterState",
            "powerConsumption": 0.0,
            "energyConsumption": 1900.0
        },
        "path": "/devices/hdm:ZigBee:dc8e95fffeb5d89c/services/PowerMeter"
    }
]

and here with Raffstore (Jalousie)

   {
        "@type": "device",
        "rootDeviceId": "64-da-a0-40-05-d8",
        "id": "hdm:ZigBee:f4b3b1fffe005e20",
        "deviceServiceIds": [
            "PowerMeter",
            "CommunicationQuality",
            "ShutterControl",
            "ChildProtection",
            "BlindsControl",
            "SwitchConfiguration",
            "BlindsSceneControl"
        ],
        "manufacturer": "BOSCH",
        "roomId": "hz_1",
        "deviceModel": "MICROMODULE_BLINDS",
        "serial": "F4B3B1FFFE005E20",
        "profile": "GENERIC",
        "name": "Raffstore WoZi links",
        "status": "AVAILABLE",
        "childDeviceIds": [],
        "supportedProfiles": []
    }
...
[
    {
        "@type": "DeviceServiceData",
        "id": "PowerMeter",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "powerMeterState",
            "powerConsumption": 0.0,
            "energyConsumption": 2500.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/PowerMeter"
    },
    {
        "@type": "DeviceServiceData",
        "id": "CommunicationQuality",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "communicationQualityState",
            "quality": "UNKNOWN"
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/CommunicationQuality"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsControlState",
            "targetAngle": 0.0,
            "currentAngle": 0.0,
            "blindsType": "DEGREE_90",
            "bladeAdjustmentTimeInMillis": 1000
        },
        "operations": [
            "decrementAngle",
            "incrementAngle"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ShutterControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "shutterControlState",
            "calibrated": true,
            "referenceMovingTimes": {
                "movingTimeTopToBottomInMillis": 54000,
                "movingTimeBottomToTopInMillis": 54000
            },
            "level": 1.0,
            "operationState": "STOPPED",
            "endPositionAutoDetect": true,
            "endPositionSupported": true,
            "delayCompensationTime": 0.2,
            "delayCompensationSupported": true,
            "automaticDelayCompensation": true
        },
        "operations": [
            "decrementOpenLevel",
            "incrementOpenLevel"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ShutterControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ChildProtection",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "ChildProtectionState",
            "childLockActive": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ChildProtection"
    },
    {
        "@type": "DeviceServiceData",
        "id": "SwitchConfiguration",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "SwitchConfigurationState",
            "switchType": "PUSHBUTTON",
            "swapInputs": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/SwitchConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsSceneControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsSceneControlState",
            "level": 1.0,
            "angle": 0.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsSceneControl"
    }
]

Thank you :-) 👍

and here the Raffstore of 50% and change Tilt

[
    {
        "@type": "DeviceServiceData",
        "id": "PowerMeter",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "powerMeterState",
            "powerConsumption": 0.0,
            "energyConsumption": 2500.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/PowerMeter"
    },
    {
        "@type": "DeviceServiceData",
        "id": "CommunicationQuality",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "communicationQualityState",
            "quality": "UNKNOWN"
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/CommunicationQuality"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsControlState",
            "targetAngle": 0.0,
            "currentAngle": 0.0,
            "blindsType": "DEGREE_90",
            "bladeAdjustmentTimeInMillis": 1000
        },
        "operations": [
            "decrementAngle",
            "incrementAngle"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ShutterControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "shutterControlState",
            "calibrated": true,
            "referenceMovingTimes": {
                "movingTimeTopToBottomInMillis": 54000,
                "movingTimeBottomToTopInMillis": 54000
            },
            "level": 0.5,
            "operationState": "STOPPED",
            "endPositionAutoDetect": true,
            "endPositionSupported": true,
            "delayCompensationTime": 0.2,
            "delayCompensationSupported": true,
            "automaticDelayCompensation": true
        },
        "operations": [
            "decrementOpenLevel",
            "incrementOpenLevel"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ShutterControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ChildProtection",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "ChildProtectionState",
            "childLockActive": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ChildProtection"
    },
    {
        "@type": "DeviceServiceData",
        "id": "SwitchConfiguration",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "SwitchConfigurationState",
            "switchType": "PUSHBUTTON",
            "swapInputs": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/SwitchConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsSceneControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsSceneControlState",
            "level": 0.5,
            "angle": 0.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsSceneControl"
    }
tschamm commented 1 year ago

I started to implement, but you need to provide a few more measurements for the Raffstore. Positioning is clear for me (level from 0.0 to 1.0), but what would be the range for the angle (Angle set to 45°, Angle set to 90°)? By the way, with the current master, I added a HA service "trigger_rawscan" where you can output the rawscan in the info logstream :-)

Matze89x commented 1 year ago

gerne teste ich es gerade im Livebetrieb. Ttatsächlich hatte er bei beidem die gleiche Neigung eingestellt gehabt:

Ich teste mit 50% Absenkung und Neigung geschlossen:

[
    {
        "@type": "DeviceServiceData",
        "id": "PowerMeter",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "powerMeterState",
            "powerConsumption": 35.0,
            "energyConsumption": 2500.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/PowerMeter"
    },
    {
        "@type": "DeviceServiceData",
        "id": "CommunicationQuality",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "communicationQualityState",
            "quality": "UNKNOWN"
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/CommunicationQuality"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsControlState",
            "targetAngle": 1.0,
            "currentAngle": 1.0,
            "blindsType": "DEGREE_90",
            "bladeAdjustmentTimeInMillis": 1000
        },
        "operations": [
            "decrementAngle",
            "incrementAngle"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ShutterControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "shutterControlState",
            "calibrated": true,
            "referenceMovingTimes": {
                "movingTimeTopToBottomInMillis": 54000,
                "movingTimeBottomToTopInMillis": 54000
            },
            "level": 0.5,
            "operationState": "STOPPED",
            "endPositionAutoDetect": true,
            "endPositionSupported": true,
            "delayCompensationTime": 0.2,
            "delayCompensationSupported": true,
            "automaticDelayCompensation": true
        },
        "operations": [
            "decrementOpenLevel",
            "incrementOpenLevel"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ShutterControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ChildProtection",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "ChildProtectionState",
            "childLockActive": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ChildProtection"
    },
    {
        "@type": "DeviceServiceData",
        "id": "SwitchConfiguration",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "SwitchConfigurationState",
            "switchType": "PUSHBUTTON",
            "swapInputs": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/SwitchConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsSceneControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsSceneControlState",
            "level": 0.5,
            "angle": 1.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsSceneControl"
    }
]

und Screenshot in BSH: image

und bei 50% und Neigung geöffnet (also oben):

[
    {
        "@type": "DeviceServiceData",
        "id": "PowerMeter",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "powerMeterState",
            "powerConsumption": 84.0,
            "energyConsumption": 2500.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/PowerMeter"
    },
    {
        "@type": "DeviceServiceData",
        "id": "CommunicationQuality",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "communicationQualityState",
            "quality": "UNKNOWN"
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/CommunicationQuality"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsControlState",
            "targetAngle": 0.0,
            "currentAngle": 0.0,
            "blindsType": "DEGREE_90",
            "bladeAdjustmentTimeInMillis": 1000
        },
        "operations": [
            "decrementAngle",
            "incrementAngle"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ShutterControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "shutterControlState",
            "calibrated": true,
            "referenceMovingTimes": {
                "movingTimeTopToBottomInMillis": 54000,
                "movingTimeBottomToTopInMillis": 54000
            },
            "level": 0.5,
            "operationState": "STOPPED",
            "endPositionAutoDetect": true,
            "endPositionSupported": true,
            "delayCompensationTime": 0.2,
            "delayCompensationSupported": true,
            "automaticDelayCompensation": true
        },
        "operations": [
            "decrementOpenLevel",
            "incrementOpenLevel"
        ],
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ShutterControl"
    },
    {
        "@type": "DeviceServiceData",
        "id": "ChildProtection",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "ChildProtectionState",
            "childLockActive": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/ChildProtection"
    },
    {
        "@type": "DeviceServiceData",
        "id": "SwitchConfiguration",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "SwitchConfigurationState",
            "switchType": "PUSHBUTTON",
            "swapInputs": false
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/SwitchConfiguration"
    },
    {
        "@type": "DeviceServiceData",
        "id": "BlindsSceneControl",
        "deviceId": "hdm:ZigBee:f4b3b1fffe005e20",
        "state": {
            "@type": "blindsSceneControlState",
            "level": 0.5,
            "angle": 0.0
        },
        "path": "/devices/hdm:ZigBee:f4b3b1fffe005e20/services/BlindsSceneControl"
    }
]

mit der Einstellung in Bosch Smart Home: image

Kurz Zusammengefasst: von:

            "@type": "blindsControlState",
            "targetAngle": 1.0,
            "currentAngle": 1.0,

auf:

            "@type": "blindsControlState",
            "targetAngle": 0.0,
            "currentAngle": 0.0,

und von:

            "@type": "blindsSceneControlState",
            "level": 0.5,
            "angle": 1.0

auf:

            "@type": "blindsSceneControlState",
            "level": 0.5,
            "angle": 0.0
Matze89x commented 1 year ago

I started to implement, but you need to provide a few more measurements for the Raffstore. Positioning is clear for me (level from 0.0 to 1.0), but what would be the range for the angle (Angle set to 45°, Angle set to 90°)? By the way, with the current master, I added a HA service "trigger_rawscan" where you can output the rawscan in the info logstream :-)

okay, ich installier gerade die letzte Version (vor einer Stunde) + gerne simuliere ich die unterschiedlichen Neigungen: Allerdings; In den Einstellungen bei Postion in der BSH-App gibt es nur "Neigung Jalousie 90° und 180° zur Auswahl. Ich nutze standardmäßig bei Raffstore 90°. - So sind auch die Rawdaten.

tschamm commented 1 year ago

That setting makes no real difference, as the value is between 0.0 and 1.0. I just added the tilt functionality, feel free to test it (version 0.4.53). I'm missing the API to stop the tilt position, maybe we have to ask the Bosch team if the Blinds support this.

tschamm commented 1 year ago

I raised an issue here: https://github.com/BoschSmartHome/bosch-shc-api-docs/issues/87

Matze89x commented 1 year ago

nach der Installation und ein Neustart von Home Assistant, sind alle Cover - MICROMODULE_SHUTTER und MICROMODULE_BLINDS nicht mehr verfügbar und funktionieren nicht mehr. Hier DEBUG Protokoll:

Logs:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/bosch_shc/cover.py", line 53, in async_setup_entry
    BlindsControlCover(
  File "/config/custom_components/bosch_shc/cover.py", line 126, in __init__
    super().__init__(device, parent_id, entry_id)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/models_impl.py", line 337, in __init__
    super().__init__(api, raw_device, raw_device_services)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/device.py", line 21, in __init__
    self._init_services(raw_device_services)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/device.py", line 37, in _init_services
    device_service = build(self._api, raw_device_service_data)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/services_impl.py", line 839, in build
    device_service_id = raw_device_service["id"]
                        ~~~~~~~~~~~~~~~~~~^^^^^^
TypeError: string indices must be integers, not 'str'
tschamm commented 1 year ago

Welche Version der bosch_shc Komponente hast du? Bei mir gehen zumindest noch die MICROMODULE_SHUTTER.

Matze89x commented 1 year ago

ca60512

über HACS > bosch_shc > Erneut herunterladen > Version auswählen > Master

tschamm commented 1 year ago

Ok. There was a bug, I inherited from the wrong class. It should be fixed (hopefully) now :-)

Matze89x commented 1 year ago

wow super, nochmal neu heruntergeladen die master-version - Restart. Es funktioniert; Ganz kleine Korrektur noch: Womöglich anders herum? - Es ist aktuell auf 50% und die Lamellen sind zu; Allerdings zeigt Home Assistant 50% und Neigung offen an... also nur einmal umdrehen bitte ;-)

Matze89x commented 1 year ago

image image

tschamm commented 1 year ago

Die Definition in Home Assistant ist wie folgt:

def current_cover_tilt_position(self) -> int | None:
    """Return current position of cover tilt.

    None is unknown, 0 is closed, 100 is fully open.
    """

Bei Bosch ist es umgekehrt, dh 1 ist geschlossen und 0 ist offen?

tschamm commented 1 year ago

Ok, ready to test :-)

Matze89x commented 1 year ago

moment, getestet sicherheitshalber: Raffstore: Ist zu 100% geschlossen Bosch App: Neigung 100% geschlossen Home Assistant: Neigung 0% - geöffnet

Device_Services: Ausgelesen: "@type": "blindsControlState", "targetAngle": 1.0, "currentAngle": 1.0, "blindsType": "DEGREE_90", "bladeAdjustmentTimeInMillis": 1000 "@type": "blindsSceneControlState", "level": 0.5, "angle": 1.0

tschamm commented 1 year ago

Genau, Bosch und HA interpretieren es umgekehrt.

Matze89x commented 1 year ago
Protokolldetails (FEHLER)
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/bosch_shc/cover.py:151
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 22:12:02 (4 occurrences)
Last logged: 22:12:41

[547858799424] SHC Error (message: API call returned non-OK result (code 503)!: b'{"@type":"JsonRestExceptionResponseEntity","errorCode":"SERVICE_INVOCATION_FAILED","statusCode":503}')
[547685093056] SHC Error (message: API call returned non-OK result (code 503)!: b'{"@type":"JsonRestExceptionResponseEntity","errorCode":"SERVICE_INVOCATION_FAILED","statusCode":503}')
[547685094336] SHC Error (message: API call returned non-OK result (code 503)!: b'{"@type":"JsonRestExceptionResponseEntity","errorCode":"SERVICE_INVOCATION_FAILED","statusCode":503}')
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/cover/__init__.py", line 405, in async_set_cover_tilt_position
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bosch_shc/cover.py", line 151, in set_cover_tilt_positionr i
    self._device.target_angle = (1.0 - tilt_position) / 100.0
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/models_impl.py", line 426, in target_angle
    self._blindscontrol_service.target_angle = value
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/services_impl.py", line 490, in target_angle
    self.put_state_element("targetAngle", value)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/device_service.py", line 49, in put_state_element
    self.put_state({key: value})
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/device_service.py", line 44, in put_state
    self._api.put_device_service_state(
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/api.py", line 178, in put_device_service_state
    self._put_api_or_fail(api_url, state_update)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/api.py", line 102, in _put_api_or_fail
    self._process_nok_result(result)
  File "/usr/local/lib/python3.11/site-packages/boschshcpy/api.py", line 123, in _process_nok_result
    raise SHCSessionError(
boschshcpy.exceptions.SHCSessionError: SHC Error (message: API call returned non-OK result (code 503)!: b'{"@type":"JsonRestExceptionResponseEntity","errorCode":"SERVICE_INVOCATION_FAILED","statusCode":503}')

also er zeigt mir noch an den Schalter... Beim Bedienen funktionierte der Test nur einmalig von geschlossen auf offen - seitdem eine Fehlermeldung.

Nebenbei - Ich danke dir sehr für die Arbeit - ist keine selbstverständlichkeit.

tschamm commented 1 year ago

Ja, das ist schwierig ohne die entsprechenden Devices... Ich habe nochmals ein Update gemacht und die Neigungsinvertierung entfernt. Geht es denn damit mehrfach?

Matze89x commented 1 year ago

Also, zum testen jetzt: Es funktioniert einwandfrei... noch wichtig: - Bosch Smart home kann nur 10er Weise verstehen (80%, 70%) etc. verstehen, könnte man womöglich so einrichten? - Hier ein Wechsel bei 20%. - Wie gesagt (im Test), HA versteht das noch falsch herum:

            "@type": "blindsSceneControlState",
            "level": 0.5,
            "angle": 0.2

            "@type": "blindsControlState",
            "targetAngle": 0.20000000298023224,
            "currentAngle": 0.2,
            "blindsType": "DEGREE_90",
            "bladeAdjustmentTimeInMillis": 1000

image image

tschamm commented 1 year ago

Bitte probiere es nochmals. Ich hatte vermutlich den Invert falsch berechnet

self._device.target_angle = (1.0 - tilt_position) / 100.0

Richtig ist:

self._device.target_angle = 1.0 - (tilt_position / 100.0)
Matze89x commented 1 year ago

Es funktioniert perfekt, vielen herzlichen Dank für deine Arbeit. Auch mehrere % Abfolgen getestet, und in der App überprüft. Wird immer auf den 10%-Bereich interpretiert. :-)

OFFTOPIC: darf ich dich parallel noch an einer anderen Stelle hier gleich fragen, ob dies als kosmetische Änderung berücksichtigt werden kann beim neuen Release? Es geht um "MICROMODULE_LIGHT_ATTACHED" - Das sind ja die https://www.bosch-smarthome.com/de/de/produkte/geraete/lichtsteuerung/ Aktuell werden die immer als "switch"-Entität eingebunden. Eigentlich ist diese Funktion für Lampen, deswegen vorsichtig gefragt: Könntest du diese als Entität "light" einbinden, wenn dies keine große Angelegenheit wäre. Aktuell muss man mit einem Änderungs-Helper diese Schalter in Lichter umbauen für weitere Funktionen. Gerne stelle ich dies als neuen Thread, wenn es eine größere Angelegenheit ist.

image
tschamm commented 1 year ago

Ok, guter Hinweis. Das schaue ich mir noch an.

tschamm commented 1 year ago

Also die SwitchEntity und die LightEntity erben jeweils von der ToggleEntity. Insofern sollte es funktionieren, allerdings würde dies bei allen Nutzern zu einem Breaking Change führen, da die aktuelle Switch Entity gelöscht und eine neue Light Entity hinzugefügt wird. Alle erstellten Automatisierungen brechen damit. Was genau für weitere Funktionen bietet denn aus deiner Sicht das Licht ggü dem Schalter?

Matze89x commented 1 year ago

oh, wow - da hast du recht.

Tatsächlich ist das so, dass ich HomeKit und Alexa-Übergaben habe. Da muss es tatsächlich die richtige Entität besitzen. Was man beachten muss für die Zukunft: Der neue Assist in HA (Voice/Chat) ist darauf sehr empfindlich, was für eine Entität was ist: - Mache das Licht im Schlafzimmer aus, z.b. durchsucht die "lights" in Kategorie "Schlafzimmer"...

Klar wäre das für viele ein Break... Vielleicht lässt sich das auch später umsetzen, wenn eine größere Versionsnummer erfolgt oder normalerweise liest man nach einem Update über HACS auch den Changelog... darauf hinweisen? Du entscheidest. ;-)

tschamm commented 1 year ago

Bitte probiere mal folgendes: Wähle den Schalter (die Entity) aus (zB Deckenlicht), dann gehe auf Einstellungen -> Anzeigen Als -> Licht. Damit wird eine weitere Entität hinzugefügt und mit dem Switch gekoppelt. Das könnte für die Sprachsteuerung helfen. Es muss allerdings pro Entität gemacht werden...

Bildschirmfoto 2023-08-15 um 23 29 11
tschamm commented 1 year ago

Diese Funktion könnte ich evtl auch in die Integration einbauen, dh den Switch weiterhin erzeugen und verstecken, und zusätzlich die Light Entity erstellen. Ich behalte es mal im Hinterkopf.

Matze89x commented 1 year ago

Ja korrekt, so habe ich das auch gemacht anfangs. (Oben hab ich ein Bild angehängt) Es geht so oder bei Helper, wird gleich angelegt. Vielleicht wäre das für die Zukunft relevant bei einem größeren Update. Ich meine: der "MICROMODULE_LIGHT_ATTACHED" ist ja auch so von BSH für Licht vermarktet... Klar, könnte man ihn umfunktionieren ;-) - Aber hey... nur kosmetisch und man kann es ja umändern, wie du sagtest.

Nochmal für all deine Arbeit: Vielen Dank. Ich schließe dieses Thema.

Matze89x commented 10 months ago

Hallo Tschamm und Community,

möchte noch gerne eine Kleinigkeit, die außer Acht gelassen habe ergänzen:

Nachdem wir die Veränderung der Raffstore/Jalousie von MICROMODULE_SHUTTER auf MICROMODULE_BLINDS geändert haben, sind leider auch die Entitäten für Power, Leistung und Kindersicherung ohne Funktion. Womöglich müsste man diese 3 weiteren Entitäten auch dem MICROMODULE_BLINDS zugewiesen werden? Diese werden seit der Änderung nicht mehr dargestellt.

Hier ein Foto von einem MICROMODULE_SHUTTER image und hier noch ein Foto von den neuen MICROMODULE_BLINDS image

tschamm commented 10 months ago

Hi @Matze89x can you check version 0.4.59, whether

Thank you!

Matze89x commented 10 months ago

Hallo tschamm,

ich hoffe es ist okay, wenn ich mich kurz auf deutsch melde. Es läuft perfekt. Alles getestet (Mit master-version 41a6800), Entitäten sind wieder vorhanden.

Dankeschön

Matze89x commented 5 months ago

Hallo tschamm,

leider muss ich diesen Thread nochmal öffnen wegen einer Besonderheit: Leider hat sich anscheinend was an der manuellen Laufrichtung beim Tastendrücken am Schalter verändert. Ich habe bemerkt, dass wenn ich die Taste drücke für "Rollo hoch", der Rollo hochbewegt - allerdings HA mir mitteilt, dass der rolle am schließen ist... genau das gleiche umgekehrt bei manuellem betätigen von "Rollo runter"-taste - zeigt HA an, dass der Rollo geöffnet wird... - Können das andere auch bei sich mal testen?

Im übrigen ist auch der "Taste tauschen"-Befehl deaktiviert. Gruß Matthias. - Werde am Wochenende weitere Screenshots und berichten, wenn gewünscht.

Wenn ich in der App folgendes mache: Ich bin das Rollo über App am hochfahren im Moment: 2024-02-22 19:38:10.146 INFO (MainThread) [custom_components.bosch_shc] {'@type': 'DeviceServiceData', 'id': 'ShutterControl', 'deviceId': 'hdm:ZigBee:f4b3b1fffe0c05bb', 'state': {'@type': 'shutterControlState', 'calibrated': True, 'referenceMovingTimes': {'movingTimeTopToBottomInMillis': 23200, 'movingTimeBottomToTopInMillis': 23200}, 'level': 1.0, 'operationState': 'MOVING', 'endPositionAutoDetect': True, 'endPositionSupported': True, 'delayCompensationTime': 0.3, 'delayCompensationSupported': True, 'automaticDelayCompensation': True}, 'operations': ['decrementOpenLevel', 'incrementOpenLevel'], 'path': '/devices/hdm:ZigBee:f4b3b1fffe0c05bb/services/ShutterControl'}

Das Rollo habe ich bei 11% gestoppt. 2024-02-22 19:42:48.991 INFO (MainThread) [custom_components.bosch_shc] {'@type': 'DeviceServiceData', 'id': 'ShutterControl', 'deviceId': 'hdm:ZigBee:f4b3b1fffe0c05bb', 'state': {'@type': 'shutterControlState', 'calibrated': True, 'referenceMovingTimes': {'movingTimeTopToBottomInMillis': 23200, 'movingTimeBottomToTopInMillis': 23200}, 'level': 0.11, 'operationState': 'STOPPED', 'endPositionAutoDetect': True, 'endPositionSupported': True, 'delayCompensationTime': 0.3, 'delayCompensationSupported': True, 'automaticDelayCompensation': True}, 'operations': ['decrementOpenLevel', 'incrementOpenLevel'], 'path': '/devices/hdm:ZigBee:f4b3b1fffe0c05bb/services/ShutterControl'}

Ich fahre das Rollo über App wieder herunter im Moment: 2024-02-22 19:43:46.452 INFO (MainThread) [custom_components.bosch_shc] {'@type': 'DeviceServiceData', 'id': 'ShutterControl', 'deviceId': 'hdm:ZigBee:f4b3b1fffe0c05bb', 'state': {'@type': 'shutterControlState', 'calibrated': True, 'referenceMovingTimes': {'movingTimeTopToBottomInMillis': 23200, 'movingTimeBottomToTopInMillis': 23200}, 'level': 0.0, 'operationState': 'MOVING', 'endPositionAutoDetect': True, 'endPositionSupported': True, 'delayCompensationTime': 0.3, 'delayCompensationSupported': True, 'automaticDelayCompensation': True}, 'operations': ['decrementOpenLevel', 'incrementOpenLevel'], 'path': '/devices/hdm:ZigBee:f4b3b1fffe0c05bb/services/ShutterControl'}

Jetzt über den Schalter an der Wand manuell beträgt: Rollo fahre ich über Schalter hoch: 2024-02-22 19:47:52.634 INFO (MainThread) [custom_components.bosch_shc] {'@type': 'DeviceServiceData', 'id': 'ShutterControl', 'deviceId': 'hdm:ZigBee:f4b3b1fffe0c05bb', 'state': {'@type': 'shutterControlState', 'calibrated': True, 'referenceMovingTimes': {'movingTimeTopToBottomInMillis': 23200, 'movingTimeBottomToTopInMillis': 23200}, 'level': 0.0, 'operationState': 'MOVING', 'endPositionAutoDetect': True, 'endPositionSupported': True, 'delayCompensationTime': 0.3, 'delayCompensationSupported': True, 'automaticDelayCompensation': True}, 'operations': ['decrementOpenLevel', 'incrementOpenLevel'], 'path': '/devices/hdm:ZigBee:f4b3b1fffe0c05bb/services/ShutterControl'}

Schalter - Rollo pausiere ich bei 15% 2024-02-22 19:47:59.076 INFO (MainThread) [custom_components.bosch_shc] {'@type': 'DeviceServiceData', 'id': 'ShutterControl', 'deviceId': 'hdm:ZigBee:f4b3b1fffe0c05bb', 'state': {'@type': 'shutterControlState', 'calibrated': True, 'referenceMovingTimes': {'movingTimeTopToBottomInMillis': 23200, 'movingTimeBottomToTopInMillis': 23200}, 'level': 0.15, 'operationState': 'STOPPED', 'endPositionAutoDetect': True, 'endPositionSupported': True, 'delayCompensationTime': 0.3, 'delayCompensationSupported': True, 'automaticDelayCompensation': True}, 'operations': ['decrementOpenLevel', 'incrementOpenLevel'], 'path': '/devices/hdm:ZigBee:f4b3b1fffe0c05bb/services/ShutterControl'}

Rollo fahre ich manuell über Schalter herunter: 2024-02-22 19:48:06.737 INFO (MainThread) [custom_components.bosch_shc] {'@type': 'DeviceServiceData', 'id': 'ShutterControl', 'deviceId': 'hdm:ZigBee:f4b3b1fffe0c05bb', 'state': {'@type': 'shutterControlState', 'calibrated': True, 'referenceMovingTimes': {'movingTimeTopToBottomInMillis': 23200, 'movingTimeBottomToTopInMillis': 23200}, 'level': 0.15, 'operationState': 'MOVING', 'endPositionAutoDetect': True, 'endPositionSupported': True, 'delayCompensationTime': 0.3, 'delayCompensationSupported': True, 'automaticDelayCompensation': True}, 'operations': ['decrementOpenLevel', 'incrementOpenLevel'], 'path': '/devices/hdm:ZigBee:f4b3b1fffe0c05bb/services/ShutterControl'}