Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
This library implements the local communication REST API for the Bosch Smart Home Controller system. It supports both long and short polling. The API documentation is available here.
The following device services are implemented:
TemperatureLevel
HumidityLevel
RoomClimateControl
ShutterContact
ValveTappet
PowerSwitch
PowerMeter
Routing
PowerSwitchProgram
PresenceSimulationConfiguration
BinarySwitch
SmokeDetectorCheck
Alarm
ShutterControl
CameraLight
PrivacyMode
CameraNotification
IntrusionDetectionControl
Keypad
LatestMotion
AirQualityLevel
SurveillanceAlarm
BatteryLevel
Thermostat
WaterLeakageSensor
WaterLeakageSensorTilt
The following device models are implemented, using the above services:
ShutterContact
, ShutterContact2
ShutterControl
, Micromodule Shutter
SmartPlug
SmartPlugCompact
LightControl
, Micromodule Light Control
, Micromodule Light Attached
, Micromodule Relay
SmokeDetector
CameraEyes
, Camera360
IntrusionDetectionSystem
RoomClimateControl
Thermostat
, Thermostat2
WallThermostat
UniversalSwitch
MotionDetector
PresenceSimulationSystem
Twinguard
WaterLeakageSensor
python
(>=3.10) environment on your computer.boschshcpy
, you should have at least version>=0.2.45
.pip install boschshcpy
To register a new client, use the script boschshc_registerclient
:
boschshc_registerclient -ip _your_shc_ip_ -pw _your_shc_password_
This will register your client and will write the associated certificate/key pair into your working directory. See also Usage Guide
To make a rawscan of your devices, use the script boschshc_rawscan
boschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ public_information
boschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ devices
device_id
boschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ device _your_device_id_
An exemplary output looks as follows:
{
"@type": "device",
"rootDeviceId": "xx-xx-xx-xx-xx-xx",
"id": "hdm:HomeMaticIP:30xxx",
"deviceServiceIds": [
"Thermostat",
"BatteryLevel",
"ValveTappet",
"SilentMode",
"TemperatureLevel",
"Linking",
"TemperatureOffset"
],
"manufacturer": "BOSCH",
"roomId": "hz_8",
"deviceModel": "TRV",
"serial": "30xxx",
"profile": "GENERIC",
"name": "Test Thermostat",
"status": "AVAILABLE",
"parentDeviceId": "roomClimateControl_hz_8",
"childDeviceIds": []
},
boschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ device_services _your_device_id_
The exemplary output will look as follows:
[
{
"@type": "DeviceServiceData",
"id": "BatteryLevel",
"deviceId": "hdm:HomeMaticIP:30xxx",
"path": "/devices/hdm:HomeMaticIP:30xxx/services/BatteryLevel"
},
{
"@type": "DeviceServiceData",
"id": "Thermostat",
"deviceId": "hdm:HomeMaticIP:30xxx",
"state": {
"@type": "childLockState",
"childLock": "OFF"
},
"path": "/devices/hdm:HomeMaticIP:30xxx/services/Thermostat"
},
...
]
device_id
as well as the service_id
are knownboschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ device_service _your_device_id_ _your_service_id
boschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ scenarios
boschshc_rawscan -ip _your_shc_ip_ -cert _your_shc_cert_file_ -key _your_shc_key_file_ rooms
boschshcpy
libraryimport boschshcpy
# Create session
session = boschshcpy.SHCSession(controller_ip="192.168.25.51", certificate='cert.pem', key='key.pem')
session.information.summary()
device = session.device('roomClimateControl_hz_5')
service = device.device_service('TemperatureLevel')
print(service.temperature)
# Update this service's state
service.short_poll()
# Start long polling thread in background
session.start_polling()
# Do work here
...
# Stop polling
session.stop_polling()
# Trigger intrusion detection system
intrusion_control = session.intrusion_system
intrusion_control.arm()
# Get rawscan of devices
scan_result = session.rawscan(command="devices")
Before accessing the Bosch Smart Home Controller, a client must be registered on the controller. For this a valid cert/key pair must be provided to the controller. To start the client registration, press and hold the button on the controller until the led starts flashing. More information here.
FAQs
Bosch Smart Home Controller API Python Library
We found that boschshcpy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.