Search found 47 matches
- Sunday 22 December 2024 22:40
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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.
- Sunday 22 December 2024 15:15
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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¶m2=value2" -X POST http://localhost:3000/data
- Saturday 21 December 2024 15:03
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
Re: posting data
Strange thing is that I’m losing all my parameters.
- Thursday 19 December 2024 20:13
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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.
@habahabahaba adding tostring doesn’t make a difference.
- Thursday 19 December 2024 18:38
- Forum: General Discussion
- Topic: Device setting to group
- Replies: 2
- Views: 118
Re: Device setting to group
Using PHP this would be “een koud kunstje” for me, but since the API doesn’t allow for adding/removing devices to groups based on their idx but only by index or editing devices already in a group for that matter, I have no idea where to begin. This also seems a redundant process that has to be execu ...
- Thursday 19 December 2024 18:30
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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)
- Thursday 19 December 2024 18:09
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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 ...
- Wednesday 18 December 2024 22:41
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
Re: posting data
I’m running Domoticz on Docker, logged into the command line and ran the following curl command:
This created file with an array/values that I posted.
Code: Select all
curl -d 'id=9&name=baeldung' https://domain.tld/script
- Wednesday 18 December 2024 22:35
- Forum: General Discussion
- Topic: Device setting to group
- Replies: 2
- Views: 118
Device setting to group
I have a group of lights that I use to turn them on/off with one timer. In this group each device of type dimmer has the level setting. When I set the level of an individual device to something else than what is set in the group (using the slider on the dashboard), the next time the group is turned ...
- Wednesday 18 December 2024 22:24
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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.
- Wednesday 18 December 2024 19:55
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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.
- Wednesday 18 December 2024 19:26
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
Re: posting data
Same, I tested with the examples found on the wiki page.
- Wednesday 18 December 2024 18:25
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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.
- Wednesday 18 December 2024 15:06
- Forum: dzVents
- Topic: posting data
- Replies: 26
- Views: 568
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 data isn't POST. I have ...
- Saturday 14 December 2024 15:59
- Forum: PHP and all others
- Topic: Get idx from switch
- Replies: 11
- Views: 321
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, callback ...
- Saturday 14 December 2024 9:54
- Forum: PHP and all others
- Topic: Get idx from switch
- Replies: 11
- Views: 321
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', } }, execute ...
- Friday 13 December 2024 22:41
- Forum: PHP and all others
- Topic: Get idx from switch
- Replies: 11
- Views: 321
Re: Get idx from switch
Cheers, I’ll give this a try.
- Friday 13 December 2024 21:24
- Forum: PHP and all others
- Topic: Get idx from switch
- Replies: 11
- Views: 321
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 end } Questions: ...
- Friday 13 December 2024 20:29
- Forum: PHP and all others
- Topic: Get idx from switch
- Replies: 11
- Views: 321
Re: Get idx from switch
I don’t understand how this can be the idx or name of the device on triggering the on/off action. Can you eleborate?habahabahaba wrote: ↑Thursday 12 December 2024 8:15 You can store some data in User Variables in settings menu and call them from script.
- Wednesday 11 December 2024 20:27
- Forum: PHP and all others
- Topic: Get idx from switch
- Replies: 11
- Views: 321
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 ...