Changes

1,201 bytes added ,  13:16, 16 August 2023
no edit summary
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"
 +
<syntaxhighlight lang="json" line>
 +
curl --header 'Content-Type: application/json' --data '{"request":"status-get", "API-KEY":"ENTER_API_KEY", "addr":"585:17", "status":"detailed"}' 'http://de-mg.local/API2/'
 +
</syntaxhighlight>
 +
 +
 +
 +
2. Use request to set brightness for dimmer element
 +
<syntaxhighlight lang="json" line>
 +
curl --header 'Content-Type: application/json' --data '{"request":"status-set","API-KEY":"ENTER_API_KEY", "addr":"585:17", "status":{"level":10}}' 'http://de-mg.local/API2/'
 +
</syntaxhighlight>
 +
 +
 +
 +
3. Use request to set color-temp for dimmer element
 +
<syntaxhighlight lang="json" line>
 +
curl --header 'Content-Type: application/json' --data '{"request":"status-set","API-KEY":"ENTER_API_KEY","addr":"585:17", "status":{"color-temp":100}}' 'http://de-mg.local/API2/'
 +
</syntaxhighlight>
 +
 +
 
</translate>
 
</translate>
editor, Interface administrators, Administrators, translation-admin, translator
9,706

edits