This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Doorbell 2N IP (Intercom)
#17
(22.09.2025, 14:25)admin Wrote: Value must be a valid JSON. Strings must be enclosed in double quotes.

Good afternoon,
That is not the issue. I’ve changed the script to analyze what the Logic Machine returns, and for some reason, it only receives the first variable within the string. If I put addr first, it receives addr, and if I put value first, it receive value (without "").

With this write.lp:
Code:
<?
require('apps')
addr = getvar('addr') or ''
value = getvar('value') or ''

print("Addr: ", addr)
print("Value: ", value)
print("Type: ", type(value))

if value then
    print("Value: ", value)
    grp.write(addr, value)
end

If I send "http://192.168.2.205/public/write.lp?value=test&addr=35/1/12"
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:48:28 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff

Addr:
Value: test
Type: string
Value: test

If I send "http://192.168.2.205/public/write.lp?addr=35/1/12&value=test""
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:49:12 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff

Addr: 35/1/12
Value:
Type: string
Value:

If i send "http://192.168.2.205/public/write.lp?value=1"

Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:51:48 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff

Addr:
Value: 1
Type: string
Value: 1

If i send "http://192.168.2.205/public/write.lp?addr=35/1/12&valor="Test" (or 'Test')
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:55:35 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff

Addr: 35/1/12
Value:
Type: string
Value:
Reply


Messages In This Thread
Doorbell 2N IP (Intercom) - by KNXSeb - 29.01.2022, 21:49
RE: Doorbell 2N IP (Intercom) - by KNXSeb - 30.01.2022, 13:23
RE: Doorbell 2N IP (Intercom) - by Daniel - 30.06.2025, 07:46
RE: Doorbell 2N IP (Intercom) - by Daniel - 30.06.2025, 10:59
RE: Doorbell 2N IP (Intercom) - by DGrandes - 11.09.2025, 13:37
RE: Doorbell 2N IP (Intercom) - by admin - 11.09.2025, 14:05
RE: Doorbell 2N IP (Intercom) - by DGrandes - 22.09.2025, 09:03
RE: Doorbell 2N IP (Intercom) - by DGrandes - 22.09.2025, 10:39
RE: Doorbell 2N IP (Intercom) - by admin - 22.09.2025, 10:43
RE: Doorbell 2N IP (Intercom) - by DGrandes - 22.09.2025, 13:53
RE: Doorbell 2N IP (Intercom) - by admin - 22.09.2025, 14:25
RE: Doorbell 2N IP (Intercom) - by DGrandes - 22.09.2025, 15:56
RE: Doorbell 2N IP (Intercom) - by admin - 23.09.2025, 08:17
RE: Doorbell 2N IP (Intercom) - by DGrandes - 23.09.2025, 11:22

Forum Jump: