Domoticz bookmarklet

blauwebuis
Posts: 109
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Domoticz bookmarklet

Postby blauwebuis » Tuesday 14 March 2017 11:49

I have a bookmarklet that I use to trigger lights on my house. It's great. It's fantastic.

The code:
javascript:void((function(){(new Image()).src = "http://192.168.1.34:8080/json.htm?type=command&param=switchlight&idx=59&switchcmd=Toggle";})());

But it only works if I have recently opened Domoticz in a tab.

How can I change this bookmarklet to always work?

Egregius
Posts: 2157
Joined: Thursday 09 April 2015 12:19
Target OS: Raspberry Pi
Domoticz version: BetaRPi2
Location: Beitem, BE
Contact:

Re: Domoticz bookmarklet

Postby Egregius » Tuesday 14 March 2017 13:07

Do you have authentication enabled?
Maybe add your local network.

blauwebuis
Posts: 109
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Domoticz bookmarklet

Postby blauwebuis » Saturday 18 March 2017 0:08

No I don't have authentification turned on.

And I double checked: I think I have the network set up ok (127.0.0.*;192.168.1.*).

Egregius
Posts: 2157
Joined: Thursday 09 April 2015 12:19
Target OS: Raspberry Pi
Domoticz version: BetaRPi2
Location: Beitem, BE
Contact:

Re: Domoticz bookmarklet

Postby Egregius » Saturday 18 March 2017 7:56

What happens if you past the url in a browser at that moment?

Code: Select all

http://192.168.1.34:8080/json.htm?type=command&param=switchlight&idx=59&switchcmd=Toggle


Return to “PHP and all others”

Who is online

Users browsing this forum: No registered users and 1 guest