Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
angryc opened this issue Aug 25, 2024 · 4 comments

Comments

@angryc
Copy link

angryc commented Aug 25, 2024

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
Copy link

tschamm commented Aug 25, 2024

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
Copy link
Author

angryc commented Aug 25, 2024

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

@tschamm
Copy link

tschamm commented Aug 26, 2024

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

@angryc
Copy link
Author

angryc commented Aug 26, 2024

Yes, it works. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants