2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

FHEMWEB: plotEmbed documented, FW_userAgent added (Forum: 27211)

git-svn-id: https://svn.fhem.de/fhem/trunk@6587 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-09-21 12:11:10 +00:00
parent 40aded93a5
commit 64c9948ecb
4 changed files with 67 additions and 169 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: plotEmbed FHEMWEB attribute (fix for an iOS8 bug)
- feature: SHC: support for analog inputs (EnvSensor) and new device
RGB_Dimmer added (rr2000)
- feature: PRESENCE: MAC address support for mode fritzbox (by Markus M.)
@ -9,9 +10,9 @@
possible values, which are selectable (via fhemweb_multiple.js).
see commandref for all possible values
- feature: speed up through caching of postproc and regex in ECMDDevice
- bugfix: fixed handling of autocreation for 10_OWServer.pm
- bugfix: fixed handling of autocreation for 10_OWServer.pm
- feature: option to cope with partial messages in ECMD/ECMDDevice
- bugfix: SOMFY: add module to CUL client list, to set IODev automatically
- bugfix: SOMFY: add module to CUL client list, to set IODev automatically
- feature: sequence: triggerPartial Attribute added
- feature: 36_JeeLink: changed flash command to use fhem firmware
directory (by HCS)
@ -39,11 +40,13 @@
to select HDMI input directly.
Add command "input" to select a HDMI port, TV or SD-Card
as source
- bugfix: LevelSender: Version 1.0.5: Could not get compiled by the Arduino IDE
- feature: PRESENCE: new event "error" and "timeout" for state reading to indicate
a non successful check
- bugfix: LevelSender: Version 1.0.5: Could not get compiled by the Arduino
IDE
- feature: PRESENCE: new event "error" and "timeout" for state reading to
indicate a non successful check
- bugfix: 70_Jabber: fixed UTF8 encoding/decoding of messages
- feature: 10_OWServer autocreate coexists with OWXXX modules (Boris & ntruchsess)
- feature: 10_OWServer autocreate coexists with OWXXX modules (Boris &
ntruchsess)
- feature: added 36_Level.pm
- feature: netatmo: added plz support for public stations
- change: 70_ENIGMA2: keep reading for recordings up-to-date during standby
@ -62,30 +65,35 @@
- feature: readingsGroup: added ...,<reading>@<device>,... argument format
- feature: 52_I2C_PCF8574.pm: added attribute OnStartup
52_I2C_PCA9532.pm: added attribute OnStartup,
added attribute OutputPorts as substitute for InputPorts
51_RPI_GPIO.pm: changed access to gpio via userspace by default (for BBB and Cubie),
access via gpio utility as fallback
added attribute OutputPorts as substitute for InputPorts
51_RPI_GPIO.pm: changed access to gpio via userspace by default
(for BBB and Cubie), access via gpio utility as fallback
- feature: PIONEERAVR: new attribute: checkConnection
- change: do no parse empty lines in 57_Calendar.pm
- bugfix: 10_SOMFY.pm: save enc-key and rolling-code as reading instead of attribute
to prevent loss of control after FHEM restart.
- bugfix: 10_SOMFY.pm: save enc-key and rolling-code as reading instead of
attribute to prevent loss of control after FHEM restart.
- feature: new module 10_SOMFY.pm to support Somfy RTS blinds
- bugfix: 70_PIONEERAVR.pm: fix for STATE if connection is lost
- bugfix: 37_SHC.pm: Move xml file under subdir lib, otherwise it won't be
deployed during update
- bugfix: 70_PIONEERAVR.pm: player commands are now available for more inputs
"play" was not in the drop down list of available set commands
check every 120s if the data connection to the Pioneer AV receiver is still up
check if we get a reply from the Pioneer AV receiver not later than 3s after a command was sent
fix for alias names of inputs
more input presets (spotify, mhl, hdmi7, hdmi8), inputs are now queried from 1 - 59
71_PIONEERAVRZONE.pm: bugfix:logging, set input
"play" was not in the drop down list of available set commands
check every 120s if the data connection to the Pioneer AV
receiver is still up
check if we get a reply from the Pioneer AV receiver not later
than 3s after a command was sent
fix for alias names of inputs
more input presets (spotify, mhl, hdmi7, hdmi8), inputs are now
queried from 1 - 59
71_PIONEERAVRZONE.pm: bugfix:logging, set input
- change: 00_RPII2C.pm: hardware access changed to ioctl and syswrite/read
SMBus module not needed anymore but still usable, see attribute useHWLib
possibility to swap I2C-0 to P5 for Rev. B raspberries via attribute swap_i2c0 (not tested yet)
- feature: 70_ENIGMA2: add attribute remotecontrol=[standard,advanced,keyboard]
- bugfix: 70_PIONEERAVR.pm and PIONEERAVRZONE.pm: added "use SetExtensions", commandref updates
fixed RC_layout
SMBus module not needed anymore but still usable, see attribute
useHWLib possibility to swap I2C-0 to P5 for Rev. B raspberries
via attribute swap_i2c0 (not tested yet)
- feature: 70_ENIGMA2: add attribute
remotecontrol=[standard,advanced,keyboard]
- bugfix: 70_PIONEERAVR.pm and PIONEERAVRZONE.pm: added "use SetExtensions",
commandref updates fixed RC_layout
- feature: new modules 70_PIONEERAVR.pm and PIONEERAVRZONE.pm
- feature: FLOORPLAN has new style 7 to display commands only.
- added: 89_HEATRONIC.pm (heikoranft)
@ -268,8 +276,8 @@
- feature: DASHBOARD: Tabs can show an icon.
- bugfix: DASHBOARD: dashboard_showfullsize only in DashboardRoom.
Fix showhelper Bug on lock/unlock. The error that after a trigger
action the curren tab is changed to the "old" activetab tab has
been fixed.
action the curren tab is changed to the "old"
activetab tab has been fixed.
- bugfix: SYSMON: Filesystems (absent medium)
- feature: FLOORPLAN-menu-items can get icons attached by new
attribute fp_roomIcons
@ -279,7 +287,8 @@
- bugfix: SYSMON: another format for ifconfig output
- feature: DASHBOARD: Use longpoll to update content.
rowcentercolwidth can now be defined per column.
Dashboard can hide FHEMWEB Roomliste and Header => Fullsizemode.
Dashboard can hide FHEMWEB Roomliste and Header =>
Fullsizemode.
- bugfix: SYSMON: null reading for absent mount points
- feature: DbLog: jokers "%" in device/reading definition are now possible
- feature: SYSMON: new CPU Statistics and Plots

View File

@ -79,6 +79,7 @@ use vars qw($FW_room); # currently selected room
use vars qw($FW_formmethod);
use vars qw(%FW_visibleDeviceHash);
use vars qw(@FW_httpheader); # HTTP header, line by line
use vars qw($FW_userAgent); # user agent string
$FW_formmethod = "post";
@ -310,6 +311,7 @@ FW_Read($)
length($hash->{BUF})<$hash->{CONTENT_LENGTH});
@FW_httpheader = split("[\r\n]", $hash->{HDR});
$FW_userAgent = join("", grep /^User-Agent:/, @FW_httpheader);
delete($hash->{HDR});
my @origin = grep /Origin/, @FW_httpheader;
@ -418,8 +420,8 @@ sub
FW_closeConn($)
{
my ($hash) = @_;
# Needed for slow server+iPad/iPhone. Forum #20294
if(AttrVal($hash->{SNAME}, "closeConn", undef)) {
if(AttrVal($hash->{SNAME}, "closeConn", # Forum #20294
$FW_userAgent =~ m/(iPhone|iPad|iPod)/)) {
TcpServer_Close($hash);
delete($defs{$hash->{NAME}});
}
@ -2734,6 +2736,18 @@ FW_widgetOverride($$)
on Windows and on systems with small memory footprint.
</li><br>
<a name="plotEmbed"></a>
<li>plotEmbed 0<br>
SVG plots are rendered as part of &lt;embed&gt; tags, as in the past
this was the only way to display SVG, and it allows to render them in
parallel, see plotfork. As of iOS 8, if FHEMWEB is called from the Home
Screen, the SVG is fetched but not displayed, which is IMHO a bug.
Setting plotEmbed to 0 will render SVG in-place, but as a side-effect
makes the plotfork attribute meaningless.<br>
This attribute defaults to 0 on iOS8 devices, and 1 elsewhere.
</li><br>
<a name="basicAuth"></a>
<li>basicAuth, basicAuthMsg<br>
request a username/password authentication for access. You have to set
@ -3289,6 +3303,21 @@ FW_widgetOverride($$)
Abschuss des FHEM Prozesses durch das OS f&uuml;hren.
</li><br>
<a name="plotEmbed"></a>
<li>plotEmbed 0<br>
SVG Grafiken werden als Teil der &lt;embed&gt; Tags dargestellt, da
fr&uuml;her das der einzige Weg war SVG darzustellen, weiterhin
erlaubt es das parallele Berechnen via plotfork (s.o.)
Ab iOS 8 werden SVG Grafiken in einem embed Tag nicht dargestellt,
falls FHEMWEB vom HomeScreen gestartet wurde (mAn ist das ein Bug in
iOS8).
Falls plotEmbed auf 0 gesetzt wird, dann werden die SVG Grafiken als
Teil der HTML-Seite generiert, was leider das plotfork Attribut
wirkungslos macht. Die Voreinstellung ist 0 auf iOS 8 Ger&auml;ten, und
1 sonst.
</li><br>
<a name="basicAuth"></a>
<li>basicAuth, basicAuthMsg<br>
Fragt username/password zur Autentifizierung ab. Es gibt mehrere

View File

@ -183,7 +183,8 @@ SVG_FwFn($$$$)
my ($w, $h) = split(",", AttrVal($d,"plotsize",$FW_plotsize));
$ret .= "<div class=\"SVGplot\">";
if(AttrVal($FW_wname, "plotEmbed", 1)) {
if(AttrVal($FW_wname, "plotEmbed",
$FW_userAgent =~ m/(iPhone|iPad|iPod).*OS (8|9)/)) {
$ret .= "<embed src=\"$arg\" type=\"image/svg+xml\" " .
"width=\"$w\" height=\"$h\" name=\"$d\"/>\n";

View File

@ -1,141 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home of FHEM</title>
</head>
<body style="background-color: white">
<h1><a href="fhem.html">FHEM</a> on the Fritz!Box</h1>
<h2>Description</h2>
<ul>
This document describes how to install <a href="fhem.html">FHEM</a> on the
fritzbox.<br>
<br>
What works:<br>
<ul>
<li>The basic fhem.pl server with at commands, notify, logging (tested)</li>
<li>FHZ1000 and FHZ1300 (both tested)</li>
<li>FS20, FHT and KS300-2 (tested)</li>
<li>HMS (untested, but should work)</li>
<li>SunSet/SunRise.</li>
<li>one of the Web frontends (webpgm2, the builtin one)</li>
</ul>
<br>
What does not work right now:<br>
<ul>
<li>Gnuplot. No idea how to replace it, perhaps we compile a fritzbox
version</li>
<li>EM1010PC. I tried it without batteries, and I think the USB interface
cannot power an USB hub, an FHZ1300 and an EM1010PC together. The fritzbox
resets when trying to initialize the devices. More experiments needed.</li>
<li>WS300PC. Untested, don't have one.</li>
</ul>
</ul>
<h2>Howto</h2>
<ul>
Tested on the fritzbox 7170, with Firmware 29.04.49.<br>
<b>Note:</b>The kernel modules are for kernel 2.6.13.1, and perl is compiled
for uCLibc 0.9.28.<br><br>
Prerequisites:<br>
<ul>
<li>You need a fritzbox with an USB host port. Check your kernel version.
If it won't match the version above, see the "Compile tips" in this
document.</li>
<li>an USB hub (a small passive one is enough).</li>
<li>an FHZ1000 or FHZ1300</li>
<li>a USB stick, at least 64MB. As the fritzbox is USB 1.1 only,
the slowest is fast enough.</li>
<li>telnet access for the fritzbox. See the links on how to enable it.
<li>the complete fhem package from the links section.</li>
</ul>
<br>
Installation:<br>
<ul>
<li>Connect the USB stick to a PC, and unpack the content of the
fb_fhem_x.y.tar.gz in the root directory of the USB stick. You'll
get a perl 5.6.2 installation with just those modules wich are needed
by fhem, an empty 32MB swapfile with a swapon/swapoff command,
the fhem server with an empty configuration file, and an rc.fhem
script which should start everything.</li>
<li>Connect the USB stick and the FHZ1x00 via the USB hub to the
fritzbox.</li>
<li>Log in via telnet to the fritzbox.</li>
<li>Change into the directory /var/media/ftp/*Partition*/usr/fhem .</li>
<li>Execute the command rc.fhem.</li>
<li>Now you can either use a Web browser:<br>
<ul>
<a href="http://192.168.178.1:8083/fhem">
http://192.168.178.1:8083/fhem</a><br>
</ul>
with the online help, or choose the command-line via:<br>
<ul>
telnet fritz.box 7072<br>
</ul>
to define your devices.</li>
<li>To enable automatic startup after reboot of the fritzbox enter the
following at the end of the /var/flash/debug.cfg:<br>
<ul>
/bin/sleep 120<br>
cd /var/media/ftp/*Partition*/usr/fhem &amp;&amp; ./rc.fhem
</ul></li>
</ul>
<br>
Tips:<br>
<ul>
<li>The installation creates the link /var/usr to the USB disk
(/var/media/ftp/*Partition*/usr)</li>
<li>In the beginning only the most necessary (in my opinion, anyway :-)
modules are installed: FHZ/FS20/HMS/KS300/SUNRISE_EL. If you want to
use other modules, they are in the /var/usr/fhem/FHEM/unused directory,
just move the needed module in the parent directory, and do a
"reload module" (without the .pm suffix).</li>
<li>If you use webpgm2, and unsure about an attribute, then just define it,
you'll get a link to the description of the attribute in the online
help".</li>
<li>If your're unsure about the parameters for a command try "?" as an
argument, e.g.:
<ul>
?<br>
define <name> ?<br>
define <name> <type> ?<br>
set <name> ?<br>
</ul>
</li>
</ul>
</ul>
<h2>Compile tips</h2>
<ul>
<b>Note:</b> You don't need to compile anything if you have the correct
kernel and uclibc version.<br><br>
I compiled the ftdi_sio module with the help of the ds26-15.1 packages, see
the links.<br>
The ftdi_sio module had to be modified, as 2.6.13 does not contain the USB
ID's of the ELV devices.<br>
Compiling a working perl for the fritzbox was a nightmare. After compiling
5.8.8 I dicovered it has a strange bug: Appending numbers to strings won't
work on the fritzbox. This is why I compiled an "old" (5.6.2) one, which
seems to work perfectly. </ul>
<h2>Links</h2>
<ul>
<li>Complete fhem package for the fritzbox: <a href="fb_fhem_0.4.tar.gz">
fb_fhem_0.4.tar.gz</a></li>
<li>Telnet on the fritzbox:
<a href="http://www.ip-phone-forum.de/showthread.php?t=69245">
ip-phone-thread</a></li>
<li>Compiler for the fritzbox:
<a href="http://www.ip-phone-forum.de/showthread.php?t=142389">
ds26-15.1</a></li>
</body>
</html>