Originally posted by: <email address deleted>
Hi, if I wanted to integrate some of the FHEM functionality into my
existing web application written in Python, is there a FHEM api I can use?
I see there's several frontends for FHEM so I am assuming there must be
something similar for these frontends to call FHEM backend commands?
Thanks!
Rok
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
you can use json, telnet to interact with fhem, you name it
Am Dienstag, 9. Oktober 2012 14:49:07 UTC+2 schrieb rok:
>
> Hi, if I wanted to integrate some of the FHEM functionality into my
> existing web application written in Python, is there a FHEM api I can use?
>
> I see there's several frontends for FHEM so I am assuming there must be
> something similar for these frontends to call FHEM backend commands?
>
> Thanks!
> Rok
>
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> you can use json, telnet to interact with fhem, you name it
Or to be more precise:
- there are two modules to contact fhem, either via simple TCP/IP (the module
is called telnet) or HTTP (FHEMWEB)
- both can be:
- configured to use encryption (SSL/HTTPS) and/or to require a password
- used the get detailed data via plain text (list), XML (XmlList) or JSon (JsonList)
- used to get a notification, if something has changed (plain text or JSonP)
- used to issue arbitrary fhem commands (plain text only)
There is also student project called TheOpenTransporter specifically designed
for frontends, although AFAIK it is not yet actively used.
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
great, thank you! is there a list or some document on the FHEMWEB+json
interface commands?
On Thursday, October 11, 2012 8:27:16 AM UTC+2, Rudolf Koenig wrote:
>
> > you can use json, telnet to interact with fhem, you name it
>
> Or to be more precise:
> - there are two modules to contact fhem, either via simple TCP/IP (the
> module
> is called telnet) or HTTP (FHEMWEB)
> - both can be:
> - configured to use encryption (SSL/HTTPS) and/or to require a password
> - used the get detailed data via plain text (list), XML (XmlList) or
> JSon (JsonList)
> - used to get a notification, if something has changed (plain text or
> JSonP)
> - used to issue arbitrary fhem commands (plain text only)
>
> There is also student project called TheOpenTransporter specifically
> designed
> for frontends, although AFAIK it is not yet actively used.
>
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> great, thank you! is there a list or some document on the FHEMWEB+json
> interface commands?
not really, just try http://fhemhost:8083/fhem?cmd=jsonlist&XHR=1
and http://fhem.de/commandref.html#jsonlist
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
So, what would be a command for turning on or off a FS20 device?
On Friday, October 12, 2012 3:59:14 PM UTC+2, Rudolf Koenig wrote:
>
> > great, thank you! is there a list or some document on the FHEMWEB+json
> > interface commands?
>
> not really, just try http://fhemhost:8083/fhem?cmd=jsonlist&XHR=1
> and http://fhem.de/commandref.html#jsonlist
>
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> So, what would be a command for turning on or off a FS20 device?
http://fhemhost:8083/fhem?cmd.Lamp=set%20Lamp%20off
Or set the redirectCmds FHEMWEB instance attribute to 0, switch a device, and
look at the URL in your browser.
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
Rudolf, how come I cannot do this:
http://fhemhost:8083/fhem?cmd=jsonlist&XHR=1&devspec= ?
is there a different way of getting jsonlist with devspec over HTTP and in
json format?
moreover, if i call a command like
http://fhemhost:8083/fhem?cmd.Lamp=set%20Lamp%20off
the XHR command does not seems to yield any return at all. Is it possible
to get a json response upon issuing a command?
On Monday, October 15, 2012 12:04:13 PM UTC+2, Rudolf Koenig wrote:
>
> > So, what would be a command for turning on or off a FS20 device?
>
> http://fhemhost:8083/fhem?cmd.Lamp=set%20Lamp%20off &
>
> Or set the redirectCmds FHEMWEB instance attribute to 0, switch a device,
> and
> look at the URL in your browser.
>
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> Rudolf, how come I cannot do this:
> http://fhemhost:8083/fhem?cmd=jsonlist&XHR=1&devspec= ?
Because it has the wrong format. Why don't you try my advice with redirectCmds?
Set this attribute to 0, type in the command in the FHEMWEB input field, and if
it works as expected, than add an &XHR=1 to the browser URL.
Your command should look like:
http://fhemhost:8083/fhem?cmd=jsonlist+devicename&XHR=1
See http://fhem.de/commandref.html#devspec for details.
Btw: jsonlist has a bug when specifying a devicespec which returns more than
one argument: it returns details only for the first one. Please consult the
author of JsonList (or fix the problem, and send the patches :)
> the XHR command does not seems to yield any return at all.
No return means OK, everything else is an error. Since specifying commands is
not implemented in a Json or Xml format, the answer is plain-text.
Or the other way round: For FHEMWEB everything is plain-text, and if a command
returns something, then it will display it. JSonList happens to return text
formatted as JSon, xmllist returns XML, and "set X Y" returns nothing on
success or an error (plain text).
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
Originally posted by: <email address deleted>
Yes, that works, thanks!
finally, would it make more sense for me to simply call the perl scripts
from my python code? if so, would that be the 10_FS20.pm.FS20_Set method?
what about the "Get status" call?
I'll look into the devicespec problem, I only have one device now so
waiting to receive the second one. If I fix the bug, where do I submit the
patch?
Thanks a lot for your help,
Rok
On Wednesday, October 17, 2012 10:32:20 AM UTC+2, Rudolf Koenig wrote:
>
> > Rudolf, how come I cannot do this:
> > http://fhemhost:8083/fhem?cmd=jsonlist&XHR=1&devspec= ?
>
> Because it has the wrong format. Why don't you try my advice with
> redirectCmds?
> Set this attribute to 0, type in the command in the FHEMWEB input field,
> and if
> it works as expected, than add an &XHR=1 to the browser URL.
> Your command should look like:
> http://fhemhost:8083/fhem?cmd=jsonlist+devicename&XHR=1
> See http://fhem.de/commandref.html#devspec for details.
>
> Btw: jsonlist has a bug when specifying a devicespec which returns more
> than
> one argument: it returns details only for the first one. Please consult
> the
> author of JsonList (or fix the problem, and send the patches :)
>
>
> > the XHR command does not seems to yield any return at all.
>
> No return means OK, everything else is an error. Since specifying commands
> is
> not implemented in a Json or Xml format, the answer is plain-text.
>
> Or the other way round: For FHEMWEB everything is plain-text, and if a
> command
> returns something, then it will display it. JSonList happens to return
> text
> formatted as JSon, xmllist returns XML, and "set X Y" returns nothing on
> success or an error (plain text).
>
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com
> finally, would it make more sense for me to simply call the perl scripts
> from my python code?
No.
> If I fix the bug, where do I submit the patch?
Here in the group.
--
To unsubscribe from this group, send email to
fhem-users+unsubscribe@googlegroups.com