08.08.2023, 10:57
I'm trying to sent a command to a homewizzard socket, to put him on and off, but really don't know how to sent the command.
I can read the value's but don;t know to sent it on and off.
hope someone can help me?
this is what i use to read
this is what the site said about the command.
what i get when read the url:
P1 HomeWizzard TEST 08.08.2023 12:57:02
* string: HW socket: Televisie: State{"power_on":true,"switch_lock":false,"brightness":0}
I can read the value's but don;t know to sent it on and off.
hope someone can help me?
this is what i use to read
Code:
require('socket.http')
ip = '192.168.99.73' --Ip adres of the socket
socket.http.TIMEOUT = 5
data = socket.http.request('http://'..ip..'/api/v1/state')
--{"power_on":true,"switch_lock":true,"brightness":0}
if data then
log('HW socket: Televisie: State'..data)
end
this is what the site said about the command.
Code:
Turn on socket
<Request>
PUT http://{IP address}/api/v1/state HTTP/1.1
Content-Type: application/json
Content-Length: <length>
{
"power_on": true
}
<Response>
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: <length>
{[url=https://homewizard-energy-api.readthedocs.io/endpoints.html]page of HomeWizzard[/url]
"power_on": true
}
what i get when read the url:
P1 HomeWizzard TEST 08.08.2023 12:57:02
* string: HW socket: Televisie: State{"power_on":true,"switch_lock":false,"brightness":0}