bosch-shc-api-docs icon indicating copy to clipboard operation
bosch-shc-api-docs copied to clipboard

Bosch Smart Home Local API for Light Control II funktioniert nicht wie spezifiziert

Open angryc opened this issue 1 year ago • 4 comments

Hallo, ich nutze die Bosch Smart Home API erfolgreich, um meine Markise zu steuern und die Temperatur von einem Wandthermostat auszulesen. Aber das mit dem Licht funktioniert nicht. Weder im Python Code noch mit Postman.

Meine Anfrage:

url = "https://192.168.178.29:8444/smarthome/devices/hdm:ZigBee:70ac08fffef0842e#3/services/PowerSwitch/sta..." payload = {} headers = { 'Content-Type': 'application/json', 'api-version': '3.2' } response = requests.request("GET", url, headers=headers, data=payload)

Ich bekomme diese Antwort:

{ "@type": "device", "rootDeviceId": "64-da-a0-40-5d-52", "id": "hdm:ZigBee:70ac08fffef0842e", "deviceServiceIds": [ "CommunicationQuality", "PowerMeter", "ElectricalFaults", "SwitchConfiguration" ], "manufacturer": "BOSCH", "deviceModel": "MICROMODULE_LIGHT_CONTROL", "serial": "70AC08FFFEF0842E", "profile": "GENERIC", "name": "LightMM_70ac08fffef0842e", "status": "AVAILABLE", "childDeviceIds": [ "hdm:ZigBee:70ac08fffef0842e#3", "hdm:ZigBee:70ac08fffef0842e#2" ], "supportedProfiles": [] }

Laut Spezifikation sollte sowas kommen: { "@type": "powerSwitchState", "switchState": "OFF", "automaticPowerOffTime": 0 }

angryc avatar Aug 25 '24 08:08 angryc

Works as expected, you perform a REST GET, and what you get is a response. If you perform a REST PUT you should be able to set the state of the power switch.

tschamm avatar Aug 25 '24 10:08 tschamm

But with GET I should get the state (ON / OFF) but I get the services of the parent device.

angryc avatar Aug 25 '24 11:08 angryc

I think you need to escape the # in the api call, replace the hash symbol by %23

tschamm avatar Aug 26 '24 05:08 tschamm

Yes, it works. Thank you!

angryc avatar Aug 26 '24 13:08 angryc