Plugins/EZJarviz.html

From Domoticz
Revision as of 17:01, 10 May 2019 by Zak45 (talk | contribs) (→‎Plugin : Automatic)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Jarvis@Home link with Domoticz
Domoticz Voice control / Voice command for Domoticz
TTS: Give a voice to Domoticz

EZJarviz : Jarvis@Home

Jarvis@Home is an android application for voice recognition and that provide some very nice features. EZJarviz is a python plugin written to made a link between Domoticz and Jarvis@Home. One of the main benefit from this solution is that it's "Cloudless", all stay local. Cloud should be required for some tasks: Geofence for example but for voice command this is not the case as it is with Alexa or Google Home, here : nothing go outside. Privacy more preserved.

Features provided by the plugin are:

  • Voice control / command : activate your devices by your voice.
  • TTS : Text To Speech, let Domoticz speak to you.
  • Notification system : TTS and/or android notification.
  • Geofence : activate your devices when enter/leave Home.
  • Geolocalisation : send to Domoticz your localisation.

Installation

All files are located here :[1] The download link provide to you all sources & necessary files.

You need to be on Domoticz version > 4.1x. and the python framework installed. Your android device need to be set in the right way, see Jarvis@Home documentation for that:[2]. And if want to use Geofence, read this first:[3]

If not already done, read this part on 'how using python plugins' : [4]

Plugin : Automatic

On your Domoticz system, you need to create EZJarviz folder under the plugin directory. Once created, use this command to download setup.py file (you need to be under created folder):

 curl -L -O  https://www.dropbox.com/s/sta09psw3hy4u09/setup.py
linux example :
usr@amlogic:~/domoticz/plugins/EZJarviz$ curl -L -O https://www.dropbox.com/s/sta09psw3hy4u09/setup.py
% Total  % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 8202 100 8202 0 0 4851 0 0:00:01 0:00:01 --:--:-- 572k
usr@amlogic:~/domoticz/plugins/EZJarviz$ ls
setup.py
usr@amlogic:~/domoticz/plugins/EZJarviz$


If curl is not installed on your system, just use your browser and download from the provided link.

On terminal session or cmd window, you need to be on the plugin folder, execute setup.py:

  • for windows :
 py setup.py
  • for others :
python3 setup.py


Follow on screen instruction.


At the end, you should have something similar :


================================================================================
Plugin EZJarviz Installed
You need to restart Domoticz before use it.
Enjoy!!!
================================================================================

This should be the content of your plugin folder (linux example):

usr@amlogic:~/domoticz/plugins/EZJarviz$ ls -altr
total 492
drwxr-xr-x 14 zla zla 4096 Oct 20 2017 ..
-rwxrwxr-x 1 usr usr 8202 May 5 12:49 setup.py
-rw-rw-r-- 1 usr usr 3646 May 5 12:55 leave64.src
-rw-rw-r-- 1 usr usr 35114 May 5 12:55 img64.src
-rw-rw-r-- 1 usr usr 7758 May 5 12:55 enter64.src
-rwxrwxr-x 1 usr usr 132745 May 5 12:55 plugin.py
-rwxrwxr-x 1 usr usr 167226 May 5 12:55 Jarviz.py
-rwxrwxr-x 1 usr usr 21 May 5 12:55 EZJz.sh
-rw-rw-r-- 1 usr usr 76736 May 5 12:55 fr_Butler (Kind).jarvis
-rw-rw-r-- 1 usr usr 47122 May 5 12:55 en_fr.lng
drwxr-xr-x 2 usr root 4096 May 5 12:56 .
usr@amlogic:~/domoticz/plugins/EZJarviz$

Plugin Folder : Manual

On your Domoticz system, you need to create EZJarviz folder under the plugin directory. Put there all necessaries files downloaded from the provided link.

Here is the list :

plugin.py  --> main py
Jarviz.py  --> py executed by the main one
leave64.src  --> found on img folder
img64.src  --> found on img folder
enter64.src  --> found on img folder
EZJz.sh  --> found on cmd folder and for non Windows OS (need +x right)
EZJz.cmd  --> found on cmd folder and for Windows OS
en_en.lng --> found on lng folder ( this one is for Domoticz system running in English language and here as an example )
en_Butler (Kind).jarvis  --> found on lng folder ( this one is for Domoticz system running in English language and here as an example )

As you see, there is some others files (even some other folders) but these are generated by the plugin it-self.

Python Modules : Manual

Plugin depend on these additional python modules:

 ['googletrans','multiping','translate','geopy','requests_toolbelt']


You can install them using pip instruction, example for multiping:

usr@amlogic:~$ sudo pip3 install multiping
Collecting multiping
Downloading https://files.pythonhosted.org/packages/0f/24/faf5dbe59c49b7a4b6f283d22443cfe8f8bd63c0e8fc8ff34250b00c5bf0/multiping-1.1.2-py2.py3-none-any.whl
Installing collected packages: multiping
Successfully installed multiping-1.1.2
usr@amlogic:~$


To see the list of installed modules, see this example:

usr@amlogic:~$ sudo pip3 list module

Package Version


----------------------

broadlink 0.9

colour 0.1.5

geographiclib 1.49

geopy 1.18.1

googletrans 2.3.0

holidays 0.9.8

icalendar 4.0.3

multiping 1.1.2

pexpect 4.6.0

pip 18.1

pycryptodome 3.4.11

.....

Jarvis@Home

On your android device, you need to install the Jarvis@Home application. Here is the link [5]Some features could not work on the Free version.

The plugin can manage more than one android device, so this need to be done on all android devices you want to use. All will be grouped together by the plugin during initial phase. In all cases, you need to define which one will be the Master: one that stay connected to your LAN and always accessible.

Once installed, you will see similar screen with IP:Port informations necessary for plugin settings:

For more information about Jarvis@Home, go here : [6]

Once all is ok, restart Domoticz and go to Domoticz / Setup / Hardware and select EZJarviz voice command for Domoticz

Configuration

for the configuration, lets focus on specific parameters to this plugin, for others, see Domoticz documentation.

  • Name: Hardware name to give
  • IP address : the IP address of your Domoticz server. Need to be one accessible from remote system ( not localhost )
  • Domoticz Port: Domoticz port number.
  • Listener Port: free port on the Domoticz server, used to communicate & create simple web server.
  • Android device (Master) IP address: the IP address of the main android device on which Jarvis@Home is running. Need static one.
  • Android device (Master) Port: Port set on Jarvis@Home application
  • Set Notification system: used to know if plugin will manage notification:
None : nothing
TTS : will use TTS to enunciate the notification
Notify : will use standard android notification
TTS & Notify : will use Both
  • Additional Phone: used if you have more than one phone.Need to be entered in list format IP:PORT,IP2:PORT2...etc...:
e.g. : 192.168.1.1:1245,192.168.1.2:1245 ...
  • Debug : False or True, this will put lots of informations into Domoticz log, use it for testing only. On production put it to None.

You need to have set Domoticz to run in your Local Area Network without required authentication.

First Test

from this point, your system is running and alive and you should have already heard your device speaking.

You need also to restart your phone(s)/tablet(s) to apply pushed settings before you can use all features.

To validate the installation, from the Master :

you  : Nestor
ezj  : how i can help you?  <<-- this one will be a random one
you  : what time is it ?
ezj  : xx hours and yy minutes

And

you  : Nestor
ezj  : how i can help you?  <<-- this one will be a random one
you  : validation
ezj  : bye
ezj  : Domoticz is running on ... etc ...


if you have Slave phone(s):

From the slave phone:

you  : Nestor
ezj  : how i can help you?  <<-- this one will be a random one
you  : validation
ezj  : bye

From the Master

ezj  : Domoticz is running on ... etc ...


if this is not the case, need to be solved before continue.

User Guide

As we speak about voice command, language is an important part of it. To have a reliable and fully running system some additional work need to be done to adapt the plugin on your way of speaking and/or on your android device voice recognition capability. This is a necessary step to not be disappointed. You need also to read the documentation about Jarvis@Home to understand the full logic/process of what has been implemented, but at the end, you will discover all possibilities offered to you. All the administration need to be done only by your local Domoticz GUI.


These are the actual configurations generated and that you can find in your android device:

           'Butler (Kind)',
           'Domoticz EZJarviz Cfg',
           'Domoticz EZJarviz Net',
           'Domoticz EZJarviz JSON',
           'Domoticz EZJarviz OnOff',
           'Domoticz EZJarviz Dimmer',
           'Domoticz EZJarviz Temp',
           'Domoticz EZJarviz Group',
           'Domoticz EZJarviz Thermostat',
           'Domoticz EZJarviz Sensors'

All of these configurations will be created/re-generated and pushed to all android devices set in the plugin configuration.The first four are used for parameters settings and will provide all necessary information to say to Jarvis@Home how contact/reach your Domoticz installation:

Butler (Kind), this is the one that will manage machine/human interaction, not generated by the plugin and can be changed by overwrite it with another configuration file (additional work necessary in case of non english language wanted).

The others are self-explanary and will manage the action wanted to be done on corresponding Domoticz devices. All favorites devices will be part of them (exception can be managed by uservariables) and split depending of the device type.

More than one Android device can be managed at same time. This is even required to use some "Cloud" option. In this case, the Master need to be always connected to your LAN and accessible. It will be used to dispatch/generate all requests.


Language

This plugin is multi-language one. Two files are necessary and depend of your Domoticz language:

<<lng code>>_en.lng --> language file
Translation record structure:<<original text, always in En>>|;|<<translated text, even in En>>
<<lng code>>_Butler (Kind).jarvis --> main Jarvis@Home configuration for machine/human interaction.

Language codification follow Google codification. Google translation has been used to create all language files (see codes [7]).With machine translation, some "fun" can happend, but you can still edit your language file and adapt it to your needs. The language code is retreived from Domoticz settings, this mean if you change it, do not forget to copy the corresponding files to the plugin folder. This mean also that this plugin manage only language defined into Domoticz.

All configurations that will be generated and sent to Jarvis@Home take care of the language and had split recognition sentences into 3 groups:

verb, request from Jarvis something
device, name of the device
action, what to do/you want

These groups are linked to corresponding Domoticz uservariables created during the initial phase.On Jarvis@Home side, this mainly correspond to synonyms. Let see an example for better understanding:

Name of Jarvis@Home configuration : Domoticz EZJarviz Temp
Domoticz UserVariables


Jarvis@Home Synonyms


Jarvis@Home Sentence


This show the link between the two systems regarding the language. You do not need to made any modification into Jarvis@Home. To adapt Jarvis@Home to your need, just modify Domoticz UserVariables and regenerate the configuration ( update selection ).

NOTA:This logic will be applied to Domoticz device name, but instead uservariables, the plugin will create the synonyms from description field by checking this keyword :
EZJarviz:#<<your custom name list>>#

If you want to keep Domoticz Web interface in English, you can still have EZJarviz speak to you in your native language by following these steps:

We suppose here we want Domoticz in En but EZJarviz in Fr:
upload fr_en.lng & fr_Butler (kind).jarvis into your plugin folder
copy fr_en.lng to en_en.lng & fr_Butler (kind).jarvis to en_Butler (kind).jarvis
reload plugin
that's all!!

Plugin Devices

Switches

In Domoticz, if you go to Switches, you will found at minima 7 devices created and at your disposal:


  • xxx- Status

This one will show the EZJarviz status. You can also put On or Off the possibility to execute task by the plugin system.On the log part, plugin second process will push some information to show where it is.

  • xxx- Task

4 tasks at your disposal:

Master:Init --> put the initial configuration & settings to the master device. Will upload the Butler config file if necesary, take and save the Jarvis@Home Api key, generate user variables into Domoticz.
Slave:init --> same as master but for additional phones.
Update --> generate new Jarvis@Home configurations and upload them to phones.
Reset --> remove all Jarvis@Home plugin configurations from the phones. By security, you need to click twice to execute this one.
  • xxx- Voice Recognition
Start : put On voice recognition to all phones
Stop : put Off voice recognition to all phones
  • xxx- Discussion
Butler:Start --> retreive Butler discussion Id from the master and initiate it.
Stop:Current --> stop current discussion in all phones
  • xxx- Camera Tool
Start : instruct Jarvis@Home to access the master camera. this will use the front one. You need to grant right to Jarvis@Home to be able to use this feature.
Stop : release the Camera
Snapshot : take a snapshot and save it on snapshot folder
  • xxx- Utility
Web:start --> start Jarvis@Home web service on all phones
Web:stop --> stop Jarvis@Home web service on all phones. take care this will cut your connection
Jarvis:Kill --> kill Jarvis@Home application on the master phone. take care this will cut your connection
  • xxx - IPaddress:Port-M
managed by the plugin. If On, device can be pinged OR plugin can reach the Port OR Jarvis@Home phone state is running (see Jarvis@Home settings). mainly mean that the device can bee seen from the LAN.

If you have additional phones, you should found corresponding devices using the same logic as the master one.

Scenes

Two devices are created :

They are used for the optional Geofencing feature.

InHome  : activated by the plugin when you enter in Home area.
OutHome : activated by the plugin when you exit from Home area.

Can be used to design any custom scenarios.

CAUTION : Do not change the device names

Utility

Two devices are created :

Used by the Geofencing and Localisation feature.

Plugin will populate data on them, depending if you enter or leave Home area. You can use it also for any custom events/script.

Domoticz UserVariables

Main customisations can be done by changing the user variables associated to the plugin in Domoticz.

Association is done in this way: user variable key = (Hardware ID provided by Domoticz to the plugin + |EZJz| + << generated key name >>)

Two differents type are managed :

if generated key name begin and finish with '_', this is related to Jarvis@Home configuration files.
otherwise, these are some specifics Parameters used by the plugin system.


uservariables list example :

 182  	29|EZJz|_update_	String	update	2019-02-23 10:37:11
 181	29|EZJz|_phone_	        String	phone	2019-02-23 10:37:11
 180	29|EZJz|_system_	String	system	2019-02-23 10:37:11
 179	29|EZJz|_information_	String	information	2019-02-23 10:37:11
 178	29|EZJz|_configuration_	String	configuration	2019-02-23 10:37:11
 177	29|EZJz|_start_	        String	start	2019-02-23 10:37:11
 176	29|EZJz|_errormsg2_	String	Error occured when trying to get data from device	2019-02-23 10:37:11
 175	29|EZJz|_errormsg1_	String	Error occured when trying to work on the device	2019-02-23 10:37:11
 174	29|EZJz|_info4_	        String	These informations come from	2019-02-23 10:37:11
 173	29|EZJz|_info3_	        String	Data coming from	2019-02-23 10:37:11
 172	29|EZJz|_info2_	        String	I take care of	2019-02-23 10:37:11
 171	29|EZJz|_info1_	        String	I work on	2019-02-23 10:37:11
 170	29|EZJz|_confirm2_	String	Very well	2019-02-23 10:37:11
 169	29|EZJz|_confirm1_	String	OK	2019-02-23 10:37:11
 168	29|EZJz|_100_per	String	100,100 percent,hundred percent,100 100	2019-02-23 10:37:11
 167	29|EZJz|_90_per	        String	90,90 percent,ninety percent,90 100	2019-02-23 10:37:11
 166	29|EZJz|_80_per	        String	80,80 percent,eighty percent,80 100	2019-02-23 10:37:11
 165	29|EZJz|_70_per	        String	70,70 percent,70 100	2019-02-23 10:37:11
 164	29|EZJz|_60_per	        String	60,60 percent,sixty percent,60 100	2019-02-23 10:37:11
 163	29|EZJz|_50_per	        String	50,50 percent,fifty percent,50 100	2019-02-23 10:37:11
 162	29|EZJz|_40_per	        String	40,40 percent,fourthy percent,40 100	2019-02-23 10:37:11
 161	29|EZJz|_30_per	        String	30,30 percent,thirty percent,30 100	2019-02-23 10:37:11
 160	29|EZJz|_20_per	        String	20,20 percent,twenty percent,20 100	2019-02-23 10:37:11
 159	29|EZJz|_10_per	        String	10,10 percent,ten percent,10 100	2019-02-23 10:37:11
 158	29|EZJz|_negative_	String	no,stop,quit,enough	2019-02-23 10:37:11
 157	29|EZJz|_affirmative_	String	yes,OK,right,go,continue	2019-02-23 10:37:11
 156	29|EZJz|_blinds_	String	shutter,blinds,shutters	2019-02-23 10:37:11
 155	29|EZJz|_lights_	String	light,lights	2019-02-23 10:37:11
 154	29|EZJz|_Electric_	String	electricity usage, electricity utilization	2019-02-23 10:37:11
 153	29|EZJz|_Custom Sensor_	String	value,data value,datas	2019-02-23 10:37:11
 152	29|EZJz|_Alert_	        String	level, alert level	2019-02-23 10:37:11
 151	29|EZJz|_AC_	        String	status, statut	2019-02-23 10:37:11
 150	29|EZJz|_Lux_	        String	light,brightness	2019-02-23 10:37:11
 149	29|EZJz|_kWh_	        String	electricity,used electricity	2019-02-23 10:37:11
 148	29|EZJz|_Percentage_	String	percentage	2019-02-23 10:37:11
 147	29|EZJz|_verb_	        String	give me,I want,say me, what is	2019-02-23 10:37:11
 146	29|EZJz|_temp_	        String	temperature	2019-02-23 10:37:11
 145	29|EZJz|_therm_	        String	thermostat,temperature	2019-02-23 10:37:11
 144	29|EZJz|_set_	        String	set,put	2019-02-23 10:37:11
 143	29|EZJz|_down_	        String	decrease,go down	2019-02-23 10:37:11
 142	29|EZJz|_up_	        String	increase,go up	2019-02-23 10:37:11
 141	29|EZJz|_code_	        String	1234	2019-02-23 10:37:11
 140	29|EZJz|_close_	        String	close,stop,desactivate,put device Off	2019-02-23 10:37:11
 139	29|EZJz|_open_	        String	open,turn on,activate,put the device On	2019-02-23 10:37:11
 138	29|EZJz|_Cleaning_	String	the, these, a, that, this, for, to, an, those	2019-02-23 10:37:11
 137	29|EZJz|_ButlerName_	String	nestor, vector, play store, mister	2019-02-23 10:37:11
 136	29|EZJz|Jpwd	        String	amFydmlz	2019-02-23 10:37:11
 135	29|EZJz|Juser	        String	admin	2019-02-23 10:37:11
 134	29|EZJz|TTSVolume	String	50	2019-02-23 10:37:11
 133	29|EZJz|TTSTask	        String	yes	2019-02-23 10:37:11
 132	29|EZJz|URLCheck	String	yes	2019-02-23 10:37:11
 131	29|EZJz|Cloud	        String	no	2019-02-23 10:37:11
 130	29|EZJz|Devicetoremove	String		2019-02-23 10:37:11
 129	29|EZJz|Devicetoadd	String		2019-02-23 10:37:11
 128	29|EZJz|JKey	        String	sdsdsdsdsdsdsdsdsdsdsdsdsd	2019-02-23 10:37:10
 130	28|EZJz|updURL	        Chaîne	https://www.dropbox.com/sh/js6a1voczrm7jet/AABfzjOZljC7O-Fz2WNzBeUWa?dl=1	2019-04-12 15:24:49


  • JKey : contains the Jarvis@Home API Key "" CAUTION: Never share this information ""
  • Devicetoadd : Domoticz device idx list to add to the selection
e.g. : 452,451,85
  • Devicetoremove : Domoticz device idx list to remove from the selection
e.g. : 42,51
  • Cloud : possible values "no", "yes", "force"
no : plugin will not generate Geofence, notification system will not send information.
yes: plugin will generate Geofence, notification system will send information to all phones if connected to local / external network.
force : plugin will not generate Geofence but will send the notification to the master device only using local Network.
  • URLCheck : possible value "yes", "no"
yes: during init phase, plugin will generate custom phone URL and put it on the Jarvis@Home state notification settings.
no: no URL generated and Jarvis@Home settings will be blank for this parameter.
  • TTSTask : if "yes", running task will use TTS to say where it is. This will delay the configuration re-build due to time necessary to pronounce task execution.
  • TTSVolume : value from "1" to "100", volume used by Jarvis@Home for TTS during night period (from 9PM to 6AM).
  • Juser : default to "admin" "" CAUTION: Never share this information ""
  • Jpwd : default to "jarvis" "" CAUTION: Never share this information ""
used by the init phase to retreive Jarvis@Home settings
  • updURL : contain the web url for plugin update
used by the 'update plugin' button on the Web Admin Page

Domoticz devices

To know which devices will be part of the configuration generation, this is the logic applied :

plugin select all favorite devices if type is part of any configurations ( e.g : temp, dimmer, etc ...)
additional device can be selected, even if not favorite one, by puting the Domoticz device IDX to uservariable.
Domoticz device IDX is removed if put on the corresponding uservariable.

To help the voice system on device recognition, special keyword can be included into the Description field: EZJarviz:#<<name list>>#

e.g. EZJarviz:#lumière salon, lampe salon#

From this special keyword, Jarvis@Home synonyms will be generated and included on any required Jarvis@Home configurations. Any changes need configuration re-generation by using the update button from plugin task device.

Let see an example:

Plugin will extract these names from the keyword:

lumiere salon --> the first one is called the common one.
lampe salon

This will generate this Jarvis@Home configuration :


In addition to the synonym generation, the plugin will check if the Domoticz device is protected or not (check mark). If this is the case, the Jarvis@Home variable created will be in this form :

e.g. ["lumière salon","yes"]
In this case, Jarvis@Home will stop and request from you to say the required code which is stored into user variable : _code_, default value : 1234.

TTS

TTS feature use Jarvis@HOME possibilities by doing API call. You can send TTS to one or many phones and even to all phones at same time. see Jarvis@HOME API documentation.

some examples :

'http://192.168.1.xx:yyyy/jarvis?jKey=sdsdsdsdsdsdsdsdssd&action=execute&type=TTS&data={"text":"hello","volume":"100"}'
'http://192.168.1.xx:yyyy/jarvis?action=execute&type=TTS&target=All_Devices&data={"text":"hello","volume":"-1"}&jKey=sdsdsdsdsdsdsdsds'
'http://192.168.1.xx:yyyy/jarvis?action=execute&type=TTS&target=Device :Master&data={"text":"hello","volume":"-1"}&jKey=sdsdsdsdsdsdsdsds'

Notification

If you have set the notification parameter to something other than none, Domoticz Python Framework should have created a notification device for you. This device name is made in this way : EZJz + Hardware Id of your plugin. You just use it as any other Domoticz notification feature. Depend of your settings, the plugin will catch the notification and do the necessary actions: TTS and/or Android notify.

If the Cloud option is "yes", this will notify any phone part of the plugin group and connected to any network.

Geofencing

NOTA: This is for secondary phone, not for the master as this one need to be connected to your local network.

Pre-request is to put the uservariable : Cloud to 'yes'. Plugin will in this case, create 'geo' folder and put on it AtHome.settings file. (need to be copied to Download folder of your android phone)

This file contains informations that will be used by another android application : Automate. Here is the link to it : [8]

On dropbox, you can found also the 'geo/Geofence Home.flo' file that you need to import to your Automate application. This flow read the Download/AtHome.settings file, make a connection to Jarvis@Home to retreive device name, generate necessary HTTP request to initiate when enter or leave Home. The flow contains less than 30 blocks, so could run without go to Premium, but if you use it, I would recommend to buy Premium to encourage devlopper.

Home is determined by using Domoticz Latitude / Longitude set into Settings.

Radius has been set to 250 meters from Home, but can be modified by editing Automate Flow.

if you have modified default port used by Jarvis@Home, you need to change also the HTTP blocks.

Once all set, and Geofence Home.flo running, this will initiate these actions to your Domoticz system:

when enter Home, execute InHome scene, put some informations into text device InHome.
when exit Home, execute OutHome scene, put some informations into text device OutHome.

On you android master device, this will generate HTML page, looking like this :

Geo Localisation

NOTA: This is for secondary phone, not for the master as this one need to be connected to your local network.

Same pre-request as Geofencing. The Automate flow to import in this case is : Myloc.flo.

Radius here is hard coded to 150 meters and used to know which text device to update.

Once all set, and when you run Myloc.flo, this will initiate these actions to your Domoticz system:

if near Home, put some informations into text device InHome.
if far from Home, put some informations into text device OutHome.


On you android master device, this will generate HTML page, looking like this :

Map should be centered on the Localisation sent to Domoticz.


Plugin Administration

All necessary modifications / customizations / updates can be done now by using the WebAdmin Page:

You can access it by using:

Domoticz Web Menu / Custom Page (into Domoticz settings, custom page need to be activated):

or

by entering URL in your web browser:

 http://[domoticzipaddress]:[domoticzportnumber]/templates/EZJarviz-[HWID].html

e.g. http://192.168.1.35:8080/templates/EZJarviz-15.html

Jarvis@Home information

These are Jarvis@Home modifications done by the plugin.

Settings

Plugin had adapted the Jarvis@Home settings to Domoticz. It's on the settings Page that all devices are grouped together. The Group Name is made by the word Domoticz + Hardware ID of the plugin'. The Device Name for Master need to remain, for others, you can put something usefull for you.

more info...[9]


Configurations

Plugin take care of the Configuration version. If any modification has been done on any Domoticz configurations using Jarvis@Home GUI, version will increase and the next Domoticz update process that you initiate will generate another configuration name with Date-Time append to it.

Reminder: Only use Domoticz to customize configurations to your needs.

more info...[10]


Butler (Kind)

This one has been downloaded from Jarvis@Home Web site and translated to corresponding language with language code in front of the name.

e.g. fr_Butler (Kind).jarvis

This configuration is pushed during init phase only and never regenerated.


Domoticz EZJarviz Cfg

Contains scenarios for : master init, slave init, update and system information. use these uservariables for customization :

           _configuration_	 configuration	 Words to use for configuration.
           _information_	 information	 Words to use for information.
           _start_	         start	 Words to use for start.
           _system_	         system	 Words to use for system.
           _phone_	         phone	 Words to use for phone.
           _update_	         update	 Words to use for update


Generate these sentences:

     For:  configuration initial      	     _configuration_ _start_
           system information      	     _information_ _system_     validation
           phone configuration      	     _configuration_ _phone_
           phone update              	     _update_ _phone_

If you say:

you : Nestor, configuration start --> this will run master:init task
      Nestor, configuration phone --> this will run slave:init task
      Nestor, update phone --> this will run update task


Contains Global variables for system management & Geofencing.

Domoticz EZJarviz Net

Contains Global Variables for Network access

e.g. Domoticz IP, Port etc ...

Domoticz EZJarviz JSON

Contains Global Variables for JSON requests

e.g. json.htm?type=devices&rid= etc ...

Domoticz EZJarviz OnOff

Turn on/Turn off Domoticz switchType" : "On/Off". Initiate two commands : "On" or "Off" to these device type :

            ['SwitchType'] == "On/Off"
            ['SwitchType'] == "Dimmer"
            ['SwitchType'] == "Blinds"
            ['SwitchType'] == "Media Player"
            ['SwitchType'] == "Door Lock"
            ['SwitchType'] == "Door Lock Inverted"


use these uservariables for messages customization:

              _confirm1_	 OK	         Confirmation #1
              _confirm2_	 Very well	 Confirmation #2
              _info1_	         I work on	 Sentence to say for managed device #1
              _info2_	         I take care of	 Sentence to say for managed device #2
              _errormsg1_	 Error occured when trying to work on the device	 Error message

use these uservariables for verbs/actions/code customization:

           _open_	open,turn on,activate,put the device On	Verbs for On action
           _close_	close,stop,desactivate,put device Off	Verbs for Off action
           _code_	1234,12 34,1 2 3 4	                Code for protected device

this will generate this sentence for IDX 60 (if this one part of the select):

_open_ 60#idx
_close_ 60#idx

let suppose IDX 60 had these synonyms ( retreived from Description field ) :

60#idx == kitchen light, kit light, kitchen lamp

if you say :

*Please,* turn on kitchen light
*I want that you* activate *the* kit light

ezj could respond :

OK, I work on kitchen light

>>>> Jarvis@Home will generate corresponding JSON command to put On the kitchen light ( switch On idx 60 ).

Domoticz EZJarviz Dimmer

Put Domoticz dimmer to certain Level switchType" : "Dimmer". Initiate three commands : "Up", "Down" and "Set" to these device type :

 ['SwitchType'] == "Dimmer" 
 ['SwitchType'] == "Blinds Percentage"


Up  : increase the level +10
Down: decrease the level -10
Set : set the level to xx percent

use these uservariables for messages customization:

              _confirm1_	 OK	         Confirmation #1
              _confirm2_	 Very well	 Confirmation #2
              _info1_	         I work on	 Sentence to say for managed device #1
              _info2_	         I take care of	 Sentence to say for managed device #2
              _errormsg1_	 Error occured when trying to work on the device	 Error message

use these uservariables for verbs/actions/percentage customization:

           _up_                 increase,go up	        Verbs for Up action
           _down_	        decrease,go down	Verbs for Down action
           _set_	        set,put	                Verbs for Set action
           _lights_	        light,lights	        On what we work
           _blinds_	        shutter,blinds,shutters	On what we work
           _affirmative_	yes,OK,right,go,continue	Synonyms for affirmation
           _negative_	        no,stop,quit,enough	        Synonyms for negation
           _10_per	        10,10 percent,ten percent,10 100	Synonyms for 10 percent
           .... until _100_per

this will generate these sentences for IDX 160 (if this one part of the select and type is light):

   _up_ _lights_ 160#idx
   _up_ 160#idx _lights_

and

   _down_ _lights_ 160#idx
   _down_ 160#idx _lights_

and

   _set_ _lights_ 160#idx _10_per
   ....
   _set_ _lights_ 160#idx _100_per


let suppose IDX 160 had these synonyms ( retreived from Description field ) :

160#idx == dining room, dining

if you say :

*Would be nice from you to* increase *the* dining room light
*I want that you* set *the* light dining *to* 30 percent

ezj could respond :

OK, I work on dining room

>>>> Jarvis@Home will generate corresponding JSON command to increase the dining room light by 10.

Increasing & decreasing will be done by step of 10. Ezj will ask you if want to continue, if yes (_affirmative_), another step will be executed until you say no(_negative_).

Set action will put the required percentage ( _10_per ... _100_per).

Domoticz EZJarviz Temp

Get Temperature from Domoticz device type : temp. Retreive data from temperature device.

use these uservariables for message customization:

              _confirm1_	 OK	                 Confirmation #1
              _confirm2_	 Very well	         Confirmation #2
              _info3_	         Data coming from	 Sentence to say for managed device #1
              _info4_	         These informations come from	 Sentence to say for managed device #2
              _errormsg2_	 Error occured when trying to get data from device	 Error message


use these uservariables for verbs/actions customization:

           _temp_	 temperature	 Words for temperature
           _verb_	 give me,I want,say me, what is	 Verbs for read the temperature


this will generate these sentences for IDX 260 (if this one part of the select and type is temp):

    _verb_ _temp_ 260#idx
    _verb_ 260#idx _temp_


>>>> Jarvis@Home will generate corresponding JSON command to read and pronounce data from device idx 260.


Domoticz EZJarviz Groups

Turn on/Turn off Domoticz Scene or Group. This will generate On or Off command for scenes/groups devices.

use these uservariables for message customization:

              _confirm1_	 OK	         Confirmation #1
              _confirm2_	 Very well	 Confirmation #2
              _info1_	         I work on	 Sentence to say for managed device #1
              _info2_	         I take care of	 Sentence to say for managed device #2
              _errormsg1_	 Error occured when trying to work on the device	 Error message


use these uservariables for verbs/actions customization:

           _open_	 open,turn on,activate,put the device On	 Verbs for On action
           _close_	 close,stop,desactivate,put device Off	         Verbs for Off action
           _code_	 1234,12 34,1 2 3 4	 Code for protected device


this will generate these sentences for IDX 2 (if this one part of the select and type is scene or group):

           _open_ 2#idx
           _close_ 2#idx

>>>> Jarvis@Home will generate corresponding JSON command to put device On or Off.


Domoticz EZJarviz Thermostat

Put Domoticz Thermostat to certain value . Initiate three commands : "Up", "Down" and "Set" to these device type :

['Type'] == "Thermostat" and ['SubType'] == "SetPoint"


Up  : add recognized number to thermostat value
Down: remove recognized number from thermostat value
Set : set the recognized number to thermostat value


use these uservariables for messages customization:

              _confirm1_	 OK	         Confirmation #1
              _confirm2_	 Very well	 Confirmation #2
              _info1_	         I work on	 Sentence to say for managed device #1
              _info2_	         I take care of	 Sentence to say for managed device #2
              _errormsg1_	 Error occured when trying to work on the device	 Error message

use these uservariables for verbs/actions/percentage customization:

           _up_                 increase,go up	        Verbs for Up action
           _down_	        decrease,go down	Verbs for Down action
           _set_	        set,put	                Verbs for Set action
           _therm_	         thermostat,temperature	        On what we work
           _code_              1234

this will generate these sentences for IDX 360 (if this one part of the select and type is thermostat/setpoint):

    _up_ _therm_ 360#idx
    _up_ 360#idx _therm_

and

   _down_ _therm_ 360#idx
   _down_ 360#idx _therm_

and

    _set_ _therm_ 360#idx
    _set_ 360#idx _therm_


let suppose IDX 360 had these synonyms ( retreived from Description field ) :

360#idx == living room, living

if you say :

*Would be nice from you to* increase *the* living room temperature by 2 degree
*I want that you* set *the* living thermostat *to* 20

ezj could respond :

OK, I work on living room

>>>> Jarvis@Home will generate corresponding JSON command to put the thermostat to the requested value.

Domoticz EZJarviz Sensors

Get value from Domoticz device type : sensor. Retreive data from sensor devices:

['SubType'] in ['Percentage','kWh','Lux','Electric','Custom Sensor','Alert','Sound Level','Text','AC']


use these uservariables for messages customization:

              _confirm1_	 OK	         Confirmation #1
              _confirm2_	 Very well	 Confirmation #2
              _info3_	         Data coming from	 Sentence to say for managed device #1
              _info4_	         These informations come from	 Sentence to say for managed device #2
              _errormsg2_	 Error occured when trying to get data from device	 Error message


use these uservariables for verbs/actions customization:

           _Percentage_          percentage	 Words for pourcentage
           _kWh_	         electricity,used electricity	 Words for kWh
           _Lux_	         light,brightness	 Words for lux
           _Electric_	         electricity usage, electricity utilization	 Words for Electric
           _AC_                 status, statut	 Words for AC
           _Alert_	         level, alert level	 Words for Alert
           _Custom Sensor_	 value,data value,datas	 Words for Custom Sensor
           _verb_	         give me,I want,say me, what is	 Verbs for read the sensor data


this will generate these sentences for IDX 560 (if this one part of the select and part of the managed sensors subtype):

(We suppose here that subtype sensors is AC)

    _verb_ _AC_ 560#idx
    _verb_ 560#idx _AC_


>>>> Jarvis@Home will generate corresponding JSON command to read and pronounce data from device idx 560.

Info...

All Domoticz IDX on this documentation are for example only.

this uservariable is common to all configurations and define words to remove (see Jarvis@Home documentation [11]) :

xx|EZJz|_Cleaning_	String	the, these, a, that, this, for, to, an, those	


By connecting to Jarvis@Home web page, you can found a summary of all the Global variables / Synonyms used in all configurations. This give you global view of the impact in case of uservariables modifications.


Technical information

Devlopment/test platform

Win 10 x64
Python v 3.5.3 x86
Domoticz Beta min: V4.1x

Junction - Windows:

link/junction need to be created for c:\program files(x86)\Domoticz to avoid space problem when call cmd file

API

Jarvis@Home

Jarvis@Home API can be retreived when you connect to the Web interface of any android device with application installed.

EZJarviz API / Url

EZJarviz URL call must be done in this way :

http://DomoticzIP:ListenerPort/<<state>><<JKey>>[optional param]

e.g. http://192.168.1.20:9005/init&jkey=98521452145854df7vs

  • /
base URL : return ok only
/
  • /test
generate test URL for validation
/test&jKey=sdsdsdsdsdsdsdsdsdsdsd
  • /init
execute master:init task
/init&jKey=sdsdsdsdsdsdsdsdsdsdsd
  • /slave
execute slave:init task
 /slave&jKey=sdsdsdsdzerfgvfdsdfsdsd
  • /updateConfigs
execute update task
/updateConfigs&jKey=sdssdsdsdsdsddsdfqsfdfsfd
  • /reset
execute reset task
CAUTION: remove all configurations from phone(s)/tablet(s)
/reset&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd
  • /info
pronounce system informations on Master device
/info&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd
  • /phoneState
put phone device to On
 /phoneState&ip=192.168.x.y&jKey=sdfsdfsdfsdfsdfsdfsdfsdff&state=1 
  • /updatesettings
change Jarvis@Home/check URL into settings to blank value for specified phone
/updatesettings&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd
  • /translateConfig
translate config file to Domoticz language e.g "Butler (Kind).jarvis"
/translateConfig&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd
  • /creLanguage
create necessary language files for Domoticz lang code
/creLanguage&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd
  • /translateProgs
read *py files and translate text from _(' ') to Domoticz language
/translateProgs&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd
  • /updpwd
update Jarvis@Home password into Domoticz uservariables. To be used when change the default one; For the name, just change it directly into uservariables by using Domoticz GUI
xxxxx: new password
/updpwd&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd&updpwd=xxxx:
  • /deluserVariable
delete uservariables related to the plugin, xx is the Domoticz hw id for the plugin. this will search for : xx|EZJz|* keys
CAUTION: this erase data from the DB
/deluserVariable&jKey=sdfsdfsdfsdfsdfsdfsdgsdfgsd&hwid:xx:
  • /atHome
update Scenes and/or text devices from Geofence & Localisation:
xxxxx = Phone name, yyyyyy = True(inHome) or False(outHome), Lat : latitude, Lon: Longitude
if myloc, then will not execute scene but only update text device
/atHome&jKey=sdsdfsfsdfsdfsdfsdf&info:xxxxxx;yyyyyyy;Lat;Lon:[myloc]
  • /list
browse plugin folder and allow to view *.txt or *.err file content
you need just to click on the file to display it into the browser
/list&jKey=sdsdfsfsdfsdfsdfsdf
  • /geoList
browse plugin folder /geo/ and allow to download file content
you just need to click on the file to initiate download
/geoList&jKey=sdsdfsfsdfsdfsdfsdf
  • /snapList
browse plugin folder /snapshot/ and allow to download file content
you just need to click on the file to initiate download
/snapList&jKey=sdsdfsfsdfsdfsdfsdf
  • /createDevices
force the plugin device creation
to be used only if you have deleted one and need it again
/createDevices&jKey=sdsdfsfsdfsdfsdfsdf

links