Scripting in Java

Post Reply
PatrykMilewski
Posts: 5
Joined: Sunday 28 January 2018 15:28
Target OS: Raspberry Pi
Domoticz version: Beta 3.8
Location: Gdańsk
Contact:

Scripting in Java

Post by PatrykMilewski » Sunday 28 January 2018 15:47

Hello,

I'm new here and it's my first topic, sorry if I did something wrong :D

I've installed my Domoticz and trying to make some scripts to make everything work as I want it to. The problem is that I'm not fully satisfied with making scripts in Blockly, LUA, Python etc. Is there any possiblity to make them in Java, or is this bad idea? I'm not talking about programming in Java, because I'm Java Dev, but about problems with performance or something else, that I don't know about. I'm not sure if Raspberry Pi 3 will handle this..

If it's possible, are there any Java libraries for this, or maybe even JavaDocs? Or maybe there is possibility to create it or join the project, if somebody is already making something like this? Is there any documentation about how to add a new languages support for scripting in Domoticz?

Couldn't find anything on forums and Google about it, but found in Wiki, that is possible to create scripts in Java, so that's why I'm asking :)

SweetPants
Posts: 2181
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9913
Location: The Netherlands
Contact:

Re: Scripting in Java

Post by SweetPants » Sunday 28 January 2018 20:15

PatrykMilewski wrote:
Sunday 28 January 2018 15:47
Couldn't find anything on forums and Google about it, but found in Wiki, that is possible to create scripts in Java, so that's why I'm asking :)
Well you have answered your own question. There is no native Java scripting support in Domoticz. However, you can use Java to script against the JSON URL's.
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

PatrykMilewski
Posts: 5
Joined: Sunday 28 January 2018 15:28
Target OS: Raspberry Pi
Domoticz version: Beta 3.8
Location: Gdańsk
Contact:

Re: Scripting in Java

Post by PatrykMilewski » Sunday 28 January 2018 23:38

SweetPants wrote:
Sunday 28 January 2018 20:15
PatrykMilewski wrote:
Sunday 28 January 2018 15:47
Couldn't find anything on forums and Google about it, but found in Wiki, that is possible to create scripts in Java, so that's why I'm asking :)
Well you have answered your own question. There is no native Java scripting support in Domoticz. However, you can use Java to script against the JSON URL's.
Well.. :D JSONs are going to be probably super slow, so making native support for Java would be the best soultion, however it would be probably really time consuming..

Thank you for your answer!

gerardvs
Posts: 122
Joined: Sunday 04 January 2015 1:01
Target OS: Raspberry Pi
Domoticz version: latest-1
Location: /dev/null
Contact:

Re: Scripting in Java

Post by gerardvs » Monday 29 January 2018 0:00

As a former Java developer I would vote strongly against incorporating Java into Domoticz.
May be you don't mean Java but want support for JavaScript. If so, don't mix these two because they have absolutely nothing in common. Unless you think Chinese and Japanese are the same languages too.

About the JSON suggestion, this isn't necessarily slow. The main Domoticz webinterface is doing the same so just see it as an api... which in fact it is, and isn't slow.

User avatar
JodyScanlon
Posts: 1
Joined: Tuesday 20 February 2018 12:22
Target OS: Windows
Domoticz version:
Location: USA Colorado Denver
Contact:

Re: Scripting in Java

Post by JodyScanlon » Tuesday 20 February 2018 12:32

Hello, I would like to learn Scripting in Java. I'm new here, but if you will share your experience and will help to choose good service for an education I'll be very thankful.
familyessay.org

SweetPants
Posts: 2181
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9913
Location: The Netherlands
Contact:

Re: Scripting in Java

Post by SweetPants » Tuesday 20 February 2018 22:26

JodyScanlon wrote:
Tuesday 20 February 2018 12:32
Hello, I would like to learn Scripting in Java. I'm new here, but if you will share your experience and will help to choose good service for an education I'll be very thankful.
I'm not sure if this is the right site for you to learn Java scripting. See gerardvs comment below on the use of Java
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

PatrykMilewski
Posts: 5
Joined: Sunday 28 January 2018 15:28
Target OS: Raspberry Pi
Domoticz version: Beta 3.8
Location: Gdańsk
Contact:

Re: Scripting in Java

Post by PatrykMilewski » Tuesday 06 March 2018 11:05

Well going back to this topic, since I learned a lot about how Domoticz and events system works, there is really no point in adding Java support through JSONs.

There is really good Dzvents solution and everyone should stick to it and Python/Bash for OS scripts, to keep them as standard for scripting.

Zakmistry
Posts: 1
Joined: Tuesday 06 March 2018 16:16
Target OS: Windows
Domoticz version:
Contact:

Re: Scripting in Java

Post by Zakmistry » Tuesday 06 March 2018 16:51

I've chosen the Java learning system following the experienced developers' recommendations step-by-step, what led me to got enough knowledge in order start some lite practices with the code and developing
in more convenient fashion java tutorials https://explainjava.com/. As I'm always saying, when I got asked for a word or two on how to make your beginning with java learning less painful,

the tutorials and practical skills are the most effective to make it up. And I hope this course will be useful for those who have been seeking it.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests