cookie support in dzVents

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
akamming
Posts: 386
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

cookie support in dzVents

Post by akamming »

Hi,

i created a dzvents script which sends a Notification if i have to put my garbage container at the road by accessing the API of the company which collects the garbage. This API uses cookies. And since domoticz.openURL does not support cookies i had to use curl. Unfortunately this does not work as an asynchronous mechanism, so sometimes when the internet is slow my domoticz 'hangs' on completing this request.

my suggestion would therefore be to extend the domoticz.openURL function with cookiesupport, by adding a 'cookie' field to the definitiion, e.g.


domoticz.openURL({
url = 'http://domain/path/to/something',
method = 'POST',
callback = 'mycallbackstring',
cookie = 'cookiedata'
postData = {
paramA = 'something',
paramB = 'something else'
}
})


so i can change this curl statement to domoticz.openURL command

Code: Select all

curl --cookie "RovaLc_inwoners={\"Id\":160266,\"ZipCode\":\"8013TP\",\"HouseNumber\":\"10\",\"HouseAddition\":null,\"Municipality\":\"Zwolle\",\"Province\":null,\"Firstname\":null,\"Lastname\":null,\"UserAgent\":\"\",\"School\":null,\"Street\":null,\"Country\":null,\"Portal\":null,\"AreaLevel\":5,\"City\":\"Zwolle\",\"Ip\":null}" https://www.rova.nl/api/TrashCalendar/GetCalendarItems?portal=inwoners
Would this be possible? If not? Is there another way to make this an asynchronous call in dzvents?
stephanvdplas
Posts: 76
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: cookie support in dzVents

Post by stephanvdplas »

Bump

This would be a very nice step in making my implementation OS-independent.
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: cookie support in dzVents

Post by waaren »

stephanvdplas wrote: Tuesday 05 May 2020 13:29 This would be a very nice step in making my implementation OS-independent.
I would also like to have this functionality in domoticz / dzVents but this cannot be solved in dzVents. DzVents just uses the openURL API domoticz provides. Until then using io.popen or os.execute with a curl running in the background and a follow up triggered by a customEvent is a proven and asynchronous work-around that will not block the eventSystem.

I am aware that the dzVents- and OS script code cannot be the same for Windows and for Linux based systems but it is possible to use such an approach for both OS.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
stephanvdplas
Posts: 76
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: cookie support in dzVents

Post by stephanvdplas »

agreed, but still would be nice if things could be solved native-dzvents.
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest