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: 2255
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10007
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: 124
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: 2255
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.10007
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.

Xiack
Posts: 1
Joined: Wednesday 29 August 2018 15:21
Target OS: Linux
Domoticz version:
Contact:

Re: Scripting in Java

Post by Xiack » Wednesday 29 August 2018 15:30

Hello! I'm also new here and recently became interested in java and Domoticz. I am very glad that I found training for myself on JAva. Is it possible to have a detailed guide about Domoticz?? I would be very grateful, and in return, I will share with you a very cool site essaybison.com/college-papers/ where you can find college papers, there can still help with essays and dissertations. Such a variety. Honestly, it was useful to me.
Last edited by Xiack on Thursday 30 August 2018 9:42, edited 1 time in total.

User avatar
Antori91
Posts: 102
Joined: Sunday 12 February 2017 18:12
Target OS: NAS (Synology & others)
Domoticz version: 4.97&3.5
Location: France
Contact:

Re: Scripting in Java

Post by Antori91 » Wednesday 29 August 2018 15:55

Hello,

A short message to let you know that I use mainly Node.JS, i.e. Javascript to write the scripts I use at Domoticz server side. See here the scripts you could use as template >>>https://github.com/Antori91/Home_Automa ... %20scripts, also an example here >>> https://github.com/Antori91/Home_Automa ... %20Cluster

These Node.JS scripts use MQTT and/or HTTP/JSON API to communicate with Domoticz.
Domoticz High Availability Cluster: Synology Dz V3.5877 (Main) - Raspberry Dz V4.97 (Backup) - Scripts Node.js
Alarm server: Raspberry - motionEye - iot_ALARM-SVR Node.js
Sensors/Actuators: ESP8266-Arduino
https://github.com/Antori91/Home_Automation

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests