A lamp simulated device to test DomoticASW
Docker Hub - fracarluccii/domoticasw-lamp
To run the lamp device using Docker, you can use the following commands:
docker run fracarluccii/domoticasw-lamp The following configurations can be passed to the container as environment variables
| Variable name | Default value | Explanation |
|---|---|---|
| ID | lamp-01 | lamp ID |
| NAME | Lamp | lamp name |
| DEVICE_PORT | 8093 | Port used by the lamp device |
| SERVER_ADDRESS | / | Address:port of the server |
| DISCOVERY_ADDRESS | 255.255.255.255 | Address for discovery broadcasts |
| DISCOVERY_PORT | 30000 | Port for discovery broadcasts |
At first send <<device-address>>/register request to the device to register it in the server.
- state: The current state of the lamp (on/off).
- brightness: The current brightness level of the lamp (0-100).
- color: The current color of the lamp in RGB format.
<<device-address>>/execute/switch: Switch the state of the lamp.<<device-address>>/execute/set-brightness: Set the desired brightness level on the lamp.<<device-address>>/execute/set-color: Set the desired color on the lamp.
Body example for set-brightness:
{
"input": 50
}Body example for set-color:
{
"input":
{
"r" : 127,
"g" : 127,
"b" : 127
}
}- turned-on: Triggered when the lamp is turned on.
- turned-off: Triggered when the lamp is turned off.
- brightness-changed: Triggered when the brightness level changes.
- color-changed: Triggered when the color changes.