Line 125: |
Line 125: |
| } | | } |
| </syntaxhighlight> | | </syntaxhighlight> |
| + | |
| + | ==CURL== <!--T:2--> |
| + | |
| + | <!-- Part from logic.xml --> |
| + | <syntaxhighlight lang="xml" line> |
| + | <item addr="585:16" auto-period="1" cfgid="4" name="color-temp dimmer" type="dimer-lamp"/> |
| + | <item addr="585:17" name="main dimmer" type="dimer-lamp" auto-period="600" color-temp="585:16"/> |
| + | </syntaxhighlight> |
| + | <!-- END Part from logic.xml --> |
| + | |
| + | 1. Use request to get detailed info about element with "status":"detailed" |
| + | curl --header 'Content-Type: application/json' --data '{"request":"status-get", "API-KEY":"8010920395573775", "addr":"585:17", "status":"detailed"}' 'http://de-mg.local/API2/' |
| + | |
| + | |
| + | 2. Use request to set brightness for dimmer element |
| + | curl --header 'Content-Type: application/json' --data '{"request":"status-set","API-KEY":"8010920395573775", "addr":"585:17", "status":{"level":10}}' 'http://de-mg.local/API2/' |
| + | |
| + | |
| + | 3. Use request to set color-temp for dimmer element |
| + | curl --header 'Content-Type: application/json' --data '{"request":"status-set","API-KEY":".................","addr":"585:17", "status":{"color-temp":100}}' 'http://de-mg.local/API2/' |
| + | |
| </translate> | | </translate> |