Created
March 16, 2017 22:52
-
-
Save dhcgn/efcc310ca5cc6f682801f08fdb128e18 to your computer and use it in GitHub Desktop.
Init the event callback fot the ccu2 (homematic basis station)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$homematicUrl = 'http://192.168.10.21:2001' | |
$destination = 'http://192.168.10.105:5050' | |
$interfaceId = '1' | |
$body = @' | |
<?xml version="1.0"?> | |
<methodCall> | |
<methodName>init</methodName> | |
<params> | |
<param> | |
<value><string>{0}</string></value> | |
</param> | |
<param> | |
<value><string>{1}</string></value> | |
</param> | |
</params> | |
</methodCall> | |
'@ | |
$body = $body -f $destination, $interfaceId | |
$body | |
$response = Invoke-WebRequest -Uri $homematicUrl -Method Post -Body $body | |
# Pretty Print | |
$doc= New-Object System.Xml.XmlDataDocument | |
$doc.LoadXml($response) | |
$sw= New-Object System.Io.Stringwriter | |
$writer = New-Object System.Xml.XmlTextWriter($sw) | |
$writer.Formatting = [System.Xml.Formatting]::Indented | |
$doc.WriteContentTo($writer) | |
$sw.ToString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$homematicUrl = 'http://192.168.10.21:2001' | |
$destination = 'http://192.168.10.105:5050' | |
$body = @' | |
<?xml version="1.0"?> | |
<methodCall> | |
<methodName>init</methodName> | |
<params> | |
<param> | |
<value><string>{0}</string></value> | |
</param> | |
</params> | |
</methodCall> | |
'@ | |
$body = $body -f $destination | |
$body | |
$response = Invoke-WebRequest -Uri $homematicUrl -Method Post -Body $body | |
# Pretty Print | |
$doc= New-Object System.Xml.XmlDataDocument | |
$doc.LoadXml($response) | |
$sw= New-Object System.Io.Stringwriter | |
$writer = New-Object System.Xml.XmlTextWriter($sw) | |
$writer.Formatting = [System.Xml.Formatting]::Indented | |
$doc.WriteContentTo($writer) | |
$sw.ToString() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment