11 dockerized BleBox device emulators - designed to help integration developers and maintainers (who may not own actual BleBox devices).
Based on actual BleBox home automation products.
(Only minimal features are implemented - to help quickly and reliably create and test basic integrations).
Based on API docs here: https://technical.blebox.eu
- Create the docker network
blebox_sensors
:
$ docker network create blebox_sensors
- Start the devices:
$ docker-compose up
- List the devices:
$ docker network inspect blebox_sensors
or, if you have jq
installed:
$ docker network inspect blebox_sensors | jq '.[0]["Containers"] | map(.IPv4Address + " " + .Name)'
- Detect the device type/product:
$ curl -s http://172.20.0.4:80/api/device/state | jq
{
"device": {
"deviceName": "My sauna 1",
"type": "saunaBox",
"fv": "0.176",
"hv": "0.6",
"apiLevel": "20180604",
"id": "aafe34db94f7",
"ip": "172.20.0.4"
}
}
- Get the status with the product-specific API:
$ curl -s http://172.20.0.4:80/api/heat/state | jq
{
"heat": {
"state": 1,
"desiredTemp": 7126,
"sensors": [
{
"type": "temperature",
"id": 0,
"value": 7126,
"trend": 0,
"state": 2,
"elapsedTimeS": 0
}
]
}
}
- Interact with the product:
$ curl -d '{"heat": { "state": 1, "desiredTemp": 6300 }}' -si "http://172.20.0.4:80/api/heat/set"
-
when stopping the containers, press Ctrl-C twice for faster shutdown
-
use the
find_box
script to return the current IP addresses with matching names:$ find_box "sauna" # prints e.g. 172.20.0.5
or, use a command that always works:
$ curl -d '{"heat": { "state": 1, "desiredTemp": 6300 }}' -si "http://$(./find_box 'sauna'):80/api/heat/set"
- error codes may not be the same (not an issue in practice)
- doesn't implement specific hardware/firmare versions (but BleBox maintains backward compatibility and upgrading firmware is recommended always)
- default functionality is emulated (actual BleBox devices are highly configurable and rich with features - but those are better set using the BleBox Android/iOS apps)
- lots of features are missing (the current ones should be sufficient - if not, let me know or create a PR)
- no integration tests (yet)
The usual. Open an issue, submit a PR, etc.
Please let me know if there are any differences from the way real BleBox devices behave.