Comme annoncé, ce forum est passé en lecture seule au 1er janvier 2020. Désormais nous vous invitons à vous rendre sur notre nouvelle page communauté :
Image

A très bientôt !

How can I run a python script when event has been triggered

Let's talk about plugins, widgets, scripts, and development with JEEDOM
coorfang
Timide
Messages : 15
Inscription : 24 mai 2018, 14:19

How can I run a python script when event has been triggered

Message par coorfang » 24 mai 2018, 14:28

Hello everyone,

I am new to JeeDom, but now I want to develop a Plugin for Snips voice assistant.

The Idea is, when the snips assistant received voice instructions, it will split it into a structurized json data with intents and necessary parameters.

But Snips using python, it support running a script or start a script when an intent has been detected automatically.

As I know, JeeDom is running under PHP. My idea is to write a Plugin which listen on the Snips bus, once an intent has been detected, it will call JeeDom to run the script which can control the equipments registered in JeeDom system. ( More like sending a commend) .\

Anyone knows how can I do this ?

coorfang
Timide
Messages : 15
Inscription : 24 mai 2018, 14:19

Re: How can I run a python script when event has been triggered

Message par coorfang » 24 mai 2018, 14:35

The idea way is, this script can be written in python and then the commends and devices inside can be understand by JeeDom's. Finally the JeeDom will execute those commands.

arnog23
Timide
Messages : 428
Inscription : 02 mars 2016, 21:50

Re: How can I run a python script when event has been triggered

Message par arnog23 » 30 mai 2018, 12:47

Hello,

I am also looking at snips which looks very insteresting.

Isn't it possible to write a Code Snippet (Python) on Snips side to invoque Jeedom Interactions using the HTTP API ?

http://#IP_JEEDOM#/jeedom/core/api/jeeApi.php?apikey=#APIKEY#&type=interact&query=#QUERY#

https://jeedom.github.io/core/fr_FR/api ... Anchor-1-3

This way, Intents can be directly sent to jeedom Interactions through the #QUERY# parameter. But in this case, I don't khow the interaction answers can be handled by Snips.

Looking at the action type, it is also possible to use Home Assitant Component instead of Code Snippet. One of the Home Assistant Component is HTTP. https://www.home-assistant.io/components/http/.

May be it could be used directly with Jeedom Interactions API.

Répondre

Revenir vers « Software & Plugins »

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 5 invités