Search found 18 matches

by vrmp
Saturday 26 August 2017 12:41
Forum: LUA
Topic: Sonos - Control the device and get status
Replies: 8
Views: 5030

Re: Sonos - Control the device and get status

Good to hear it works now!
I have updated my first post with the new function and added a check for your spdif connection to the TV.
It should update now with "Playing from external source" when used.
by vrmp
Friday 25 August 2017 21:07
Forum: LUA
Topic: Sonos - Control the device and get status
Replies: 8
Views: 5030

Re: Sonos - Control the device and get status

The spdif connection will create an error, but not in the line you report. I can fix that for you, but it does not explain what is happening. In the three outputs you gave only the Spotify one triggers the if statement containing that part of the code. Or well it should be. Does function that gets ...
by vrmp
Friday 25 August 2017 18:11
Forum: LUA
Topic: Sonos - Control the device and get status
Replies: 8
Views: 5030

Re: Sonos - Control the device and get status

Hi,

It should work, but perhaps you are playing from a different source then I did and tested it with. I only use radiostations and spotify.

Can you add behind (probably on Line 42 in your code)

line = f:read()

Print(Line)

And post the output?
by vrmp
Tuesday 15 August 2017 11:11
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

The double backslashes is a bit weird. For me it worked with the code like I posted yesterday, but well..
Glad it works for you now!

If you have further issues please let me know :D
by vrmp
Tuesday 15 August 2017 10:03
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

No problem! It should work on Linux without any issue. The files are created by the script, but the path where it does should be available. On Windows the path /tmp is not available but on Linux it is (I'm using a Pi for my Domoticz installation) I think it will also work for VPN users, but I did ...
by vrmp
Monday 14 August 2017 17:35
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

I check some stuff and this works for me on my Windows system: curl --cookie unifi_cookie_lua --cookie-jar unifi_cookie_lua --insecure -H "Content-Type: application/json" --data "{\"password\":\"admin\",\"username\":\"admin\"}" https://192.168.1.12:8443/api/login curl --cookie unifi_cookie_lua ...
by vrmp
Sunday 13 August 2017 21:56
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

Can you try this

Code: Select all

curl --cookie unifi_cookie_lua --cookie-jar unifi_cookie_lua --insecure -H "Content-Type: application/json" -X POST -d "{\"password\":\"admin\",\"username\":\"admin\"}" https://192.168.1.12:8443/api/login
by vrmp
Sunday 13 August 2017 21:39
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

I will have a look at it tomorrow on a Windows system
by vrmp
Sunday 13 August 2017 19:51
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

Can you replace the ' with " in you manual command?
I think Windows does not recognize this and assumed after the space the next option is given, which is application in this case.
by vrmp
Sunday 13 August 2017 19:03
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

Can you remove the logout part from the function and try again?

Code: Select all

read_logout = os.execute(url_logout)
by vrmp
Sunday 13 August 2017 18:19
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

Is the file in the cookie variable also created?
Without this file the login would fail as you describe.
Can you check that?
by vrmp
Saturday 12 August 2017 14:08
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

That could be the problem. Did you replace these settings with a valid path on your Windows system?

cookie = "/tmp/unifi_cookie_lua" -- Temp cookie file
tempfilename = "/tmp/UnifiController.tmp" -- Temp JSON output file
by vrmp
Saturday 12 August 2017 0:09
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Re: Unifi controller - Presence detection

I'm not using dzvents but the normal lua code.
When you separate the function to a different file using dzvents you should use the helper function:
https://github.com/dannybloe/dzVents/issues/28

Perhaps you can also place the function in your dzvents code block, but I'm not sure of that.
by vrmp
Monday 31 July 2017 21:13
Forum: LUA
Topic: Get trash collection date from www.deafvalapp.nl
Replies: 3
Views: 1830

Get trash collection date from www.deafvalapp.nl

I saw the topic created by Zicht (https://www.domoticz.com/forum/viewtopic.php?f=61&t=17963) to query a Dutch website for garbage collection. Because in my location I need to use http://www.deafvalapp.nl and I didn't want to intrude that topic I am creating this one. I created a LUA script which ...
by vrmp
Sunday 30 July 2017 22:46
Forum: LUA
Topic: Unifi NVR Video - control recording
Replies: 2
Views: 1450

Re: Unifi NVR Video - control recording

It's all part of the same lua script. You have to set your own settings/variables in the first part so you connect to the correct device/camera. The function is called from the code used in the example, so that also has to be available in the same script. That part uses the same variables you ...
by vrmp
Monday 24 July 2017 16:38
Forum: LUA
Topic: Sonos - Control the device and get status
Replies: 8
Views: 5030

Sonos - Control the device and get status

Since I'm experiencing problems with the new python plugin system, I decided to recreate my used plugins to LUA code. For Sonos this is almost done. I created two functions (for now) to control the player and volume of the device. I created some functions to get to status of the device too, but this ...
by vrmp
Monday 24 July 2017 16:24
Forum: LUA
Topic: Unifi controller - Presence detection
Replies: 21
Views: 6125

Unifi controller - Presence detection

I created a LUA script to read the Unifi controller for a specific device name and report the status. Perhaps someone else has some use for it aswell. The Function: function UnifiController(Username) unifi_username = "admin" -- Username for example admin unifi_password = "admin123" -- Password for ...
by vrmp
Monday 24 July 2017 16:20
Forum: LUA
Topic: Unifi NVR Video - control recording
Replies: 2
Views: 1450

Unifi NVR Video - control recording

I have used the python plugin created by gysmo38 (thanks for that), but somehow my installation keeps having issues from time to time with python plugins. Because of that reason I recreated the functionality in LUA code, which works without an issue for me. I'm using the function below to turn ...