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 !

TCP plugin example

Let's talk about plugins, widgets, scripts, and development with JEEDOM
yoggi
Timide
Messages : 4
Inscription : 15 avr. 2017, 22:01

TCP plugin example

Message par yoggi » 15 avr. 2017, 22:11

I would like to create a plugin that controls my Sharp TV, I am looking for an example plugin that uses TCP (raw), does anybody know of a plugin that uses tcp that I can look at when it comes to connecting over tcp?

Joachim

Anonyme
Actif
Messages : 10082
Inscription : 09 août 2014, 12:15

Re: TCP plugin example

Message par Anonyme » 15 avr. 2017, 22:31

Contenu supprimé à la demande de son auteur

yoggi
Timide
Messages : 4
Inscription : 15 avr. 2017, 22:01

Re: TCP plugin example

Message par yoggi » 12 mai 2017, 08:52

Hi magicgg91 and hi Jeedom community,

My efforts to create a plugin for Sharp Aquos TV has progressed to the point where I have a plugin that can send tcp/ip commands to the TV and get the response back from it. I used jmoore987’s sharp_aquos_rc python library (github) but I have a question I hope somebody could help me with!

I want to read values from the TV and show them in Jeedom, what is the best way of saving these temporary values (values like if the TV is on or off, volume level, sleep timer, inputs etc. the return values are short text strings like ‘0’ ‘1’ ‘OK’ ‘ERR’ … ). Should I use Jeedoms database? Or should I do it in some other way since the values are of no use after the TV is turned off and could be removed?
I would be glad if somebody could give a short code example (to be used in the php class file)!

Regards,

Joachim

Avatar de l’utilisateur
bobeponge14
Timide
Messages : 266
Inscription : 15 mai 2015, 17:25
Localisation : Calvados Caen

Re: TCP plugin example

Message par bobeponge14 » 12 mai 2017, 09:15

hello Yoggi

I think you have to read this documentation to understand how to create a plugin https://github.com/jeedom/plugin-templa ... /doc/fr_FR and analyse template plugin.
As said magicgg91 the best way is to analyse some plugin.
For my part, I also developed my first plugin and I studied the plugin mpower which allowed me to understand quite a lot.
You can also take inspiration from the plugin LG TV or the plugin TV philipps
Rgds
Production : Jeedom Diy VM sur Proxmox
Dev/test: Jeedom Diy VM sur Virtual Box
Plugin : wifismartplug

yoggi
Timide
Messages : 4
Inscription : 15 avr. 2017, 22:01

Re: TCP plugin example

Message par yoggi » 12 mai 2017, 10:33

Hi bobeponge14,

I have looked at other plugins (I have looked at the LGTV and Philips but not mpower, I will have a look at it!), and I have read the document you linked to. I used google to translate it into English but technical details don’t always translate that well.

As this is the English part of Jeedom I was hoping that you (read Jeedom forum users) would be a little bit more forthcoming as most of the documentation and examples are in French. I admit I am a newcomer to Jeedom, php and python (and programing in general) but I do think that I have made good progress in ‘reverse engineered’ the current plugins in order to get to where I am now with my TV plugin.

I hope that somebody could answer the question if Jeedoms database is a good place to store temporary values or if this should be done using php arrays.

Joachim

pir2d2
Timide
Messages : 227
Inscription : 08 mai 2015, 15:03
Localisation : Sainte Marie, La Réunion

Re: TCP plugin example

Message par pir2d2 » 04 sept. 2017, 07:37

Hello Yoggi,

I am interested in your plugin. Can you release your plugin in bêta so I can test it ? ;)

cheers,
Pierre
raspberry pi, zstick S2, Jeedom V3, plein de capteurs, plein d'actionneurs, plein de protocoles différents.

Répondre

Revenir vers « Software & Plugins »

Qui est en ligne ?

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