Search found 47 matches

by vespino
Saturday 07 February 2026 14:38
Forum: dzVents
Topic: Firing event on load interface
Replies: 0
Views: 42

Firing event on load interface

I currently run a dzVents script to update a value every minute. This value is the song currently playing on my Sonos speakers. As I only need this data when logging into the Domoticz interface and have no use for gathering this data over time, I was wondering if it were possible to fire this event ...
by vespino
Monday 23 December 2024 17:44
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

The values I’m posting here are only demo values as I don’t want to disclose the true urls of course. My goals was using POST as the variables are more clear in the code. I know, this is an OCD/first problem thing, but it should work but I can seem to find why it’s not.
by vespino
Sunday 22 December 2024 22:40
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

But then I would still be where I don’t want to be. Think I’ll let this rest for now as I’m also looking into a Python option for me endgoal.
by vespino
Sunday 22 December 2024 15:15
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

Don’t know. If I do this from the Docker/Domoticz bash, that does work:

Code: Select all

curl -d "param1=value1&param2=value2" -X POST http://localhost:3000/data
by vespino
Saturday 21 December 2024 15:03
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

Strange thing is that I’m losing all my parameters.
by vespino
Thursday 19 December 2024 20:13
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

@jvdz I didn’t change post to get, I was referring to the markup. I was hoping to use post so the variables are more clearly visible instead of one long string as with get.

@habahabahaba adding tostring doesn’t make a difference.
by vespino
Thursday 19 December 2024 18:30
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

@jvdz that does do something, but the reason I prefer POST over GET is the code is better readable and this way I can use GET just as well (first world problem)
by vespino
Thursday 19 December 2024 18:09
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

Data seems to be post:

2024-12-19 18:06:12.217 dzVents: Debug: POST Test: OpenURL: method = POST
2024-12-19 18:06:12.217 dzVents: Debug: POST Test: OpenURL: post data = {"idx":108,"level":15,"status":"On"}
2024-12-19 18:06:12.217 dzVents: Debug: POST Test: OpenURL: headers = !#Content-Type ...
by vespino
Wednesday 18 December 2024 22:41
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

I’m running Domoticz on Docker, logged into the command line and ran the following curl command:

Code: Select all

curl -d 'id=9&name=baeldung' https://domain.tld/script
This created file with an array/values that I posted.
by vespino
Wednesday 18 December 2024 22:24
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

@hvdw I already tested it like that just to make sure it’s not the data missing that is causing the issue.
by vespino
Wednesday 18 December 2024 19:55
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

It isn’t blocked. The script is supposed to create a file and add the POST data to that file. The file is created, however the array is empty.
by vespino
Wednesday 18 December 2024 19:26
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

Same, I tested with the examples found on the wiki page.
by vespino
Wednesday 18 December 2024 18:25
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

Re: posting data

The script works fine when calling it in the browser. Also Domoticz triggers the script, but the POST values just are empty/absent.
by vespino
Wednesday 18 December 2024 15:06
Forum: dzVents
Topic: posting data
Replies: 29
Views: 1871

posting data

I have the following:

return {
on = {
devices = {
'Wekker',
}
},
execute = function(domoticz, switch)
domoticz.openURL({
url = 'https://domain.tld/script',
method = 'POST',
postData = {
idx = switch.idx,
status = switch.state,
level = switch.level
}
})
end
}

My problem is the ...
by vespino
Saturday 14 December 2024 15:59
Forum: PHP and all others
Topic: Get idx from switch
Replies: 11
Views: 1948

Re: Get idx from switch

Changing this part:

domoticz.openURL('https://domain.tld/script/?idx=' .. switch.idx .. '&level=' .. switch.level .. '&status=' .. switch.state)

...to this:

domoticz.openURL({
url = 'https://domain.tld/script/?idx=' .. switch.idx .. '&level=' .. switch.level .. '&status=' .. switch.state ...
by vespino
Saturday 14 December 2024 9:54
Forum: PHP and all others
Topic: Get idx from switch
Replies: 11
Views: 1948

Re: Get idx from switch

The following works for me:

return {
on = {
devices = {
'Voordeur',
'Spotjes werkblad',
'Plantenlamp',
'Staande lamp',
'Kerstboom',
'Spotjes eetkamer',
'Hanglamp',
'Spotjes kast',
'Spotjes woonkamer',
'Vloerlamp',
'TV',
'Slaapkamer 2',
'Kantoor',
'Achterdeur',
'Gangpad',
'Carpot ...
by vespino
Friday 13 December 2024 22:41
Forum: PHP and all others
Topic: Get idx from switch
Replies: 11
Views: 1948

Re: Get idx from switch

Cheers, I’ll give this a try.
by vespino
Friday 13 December 2024 21:24
Forum: PHP and all others
Topic: Get idx from switch
Replies: 11
Views: 1948

Re: Get idx from switch

Think I’ll look into dzvents for what I’m looking for. Found the following example:

return {
on = {
devices = {
'<exact name of the switch>'
}
},
execute = function(domoticz, switch)
if (switch.state == 'On') then
domoticz.log('Hey! I am on!')
else
domoticz.log('Hey! I am off!')
end ...
by vespino
Friday 13 December 2024 20:29
Forum: PHP and all others
Topic: Get idx from switch
Replies: 11
Views: 1948

Re: Get idx from switch

habahabahaba wrote: Thursday 12 December 2024 8:15 You can store some data in User Variables in settings menu and call them from script.
I don’t understand how this can be the idx or name of the device on triggering the on/off action. Can you eleborate?
by vespino
Wednesday 11 December 2024 20:27
Forum: PHP and all others
Topic: Get idx from switch
Replies: 11
Views: 1948

Get idx from switch

I’m building a script that controls devices using the manufacturer’s API. First I’m adding virtual devices, then I’m adding an on and off script to each device. I was wondering if it’s possible to dynamically add device data to the script that is run, so I don’t have to add variables to every single ...