BoschSmartHome / bosch-shc-api-docs

Bosch Smart Home Controller Local REST API
Other
210 stars 44 forks source link

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

Open angryc opened 2 weeks ago

angryc commented 2 weeks ago

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 }

tschamm commented 2 weeks ago

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.

angryc commented 2 weeks ago

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

tschamm commented 2 weeks ago

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

angryc commented 2 weeks ago

Yes, it works. Thank you!