Page 1 of 1
App-Inventor
Posted: Sunday 23 April 2017 22:48
by LucVolders
Hi there,
I am trying to make an Android app that can control certain functions in Domoticz.
However I am experiencing problems when I try to access Domoticz with a program
made in App-Inventor .
Anyone here having experience with app-inventor.
Oh, and by the way I do have the Domoticz app installed and that works flawlessly.
It is just that I am trying to devellop my own app.
Luc
Re: App-Inventor
Posted: Sunday 23 April 2017 23:15
by MYLE
how are you communicating to DOM
Re: App-Inventor
Posted: Monday 24 April 2017 7:41
by LucVolders
I am using the API calls described here:
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's
I made a button and when clicked it should send the command to Domoticz.
Here is the block program:
[img]
- domoticz.jpg (25.98 KiB) Viewed 1693 times
[/img]
When I enter this command in a web-browser it works.
So the command is ok but the communiaction from within app-inventor is not.
Any ideas ???
Luc
Re: App-Inventor
Posted: Monday 24 April 2017 15:28
by theolsen
Your port to Domoticz looks wrong - should it not be 8080?
Re: App-Inventor
Posted: Monday 24 April 2017 21:44
by LucVolders
theolsen, you are absolutely right that 8080 is the standard port
However in Domoticz in:
you can alter the number of the port.
As I suspected that there could be an issue with App-Inventor and port 8080 I changed the port
number in Domoticz. Did not work. So I altered it back.
Luc
Re: App-Inventor
Posted: Tuesday 25 April 2017 11:52
by theolsen
Ah fair play. Sorry I cannot be of more help.
Re: App-Inventor
Posted: Tuesday 25 April 2017 12:10
by bbqkees
Maybe the problem is that the app-inventor works in the cloud and thus needs to use a publix/external Domoticz address and not the home lan network address?
Re: App-Inventor
Posted: Thursday 27 April 2017 18:47
by LucVolders
Found it.
The code should be as in the blocks example shown here:
[img]
- domoticz2.jpg (39.06 KiB) Viewed 1595 times
[/img]
The IP adress should not be the local IP adress but the adress used to access Domoticz over the internet.
Then as the blocks show you need to invoke your username and password however they need to be base 64 coded.
The above blocks code works flawlessly.
Now I can devellop my own app. And so can you.
App inventor is really fantastic to build in no time apps for Android.
Watch my weblog in the future for my project:
http://lucstechblog.blogspot.nl/
Luc Volders