Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. VIS: Doorbird History Zeitstempel in VIS

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    VIS: Doorbird History Zeitstempel in VIS

    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chrizzel last edited by

      Hi alle,

      ist es schon jemandem gelungen die Doorbird mit den letzten Besuchern in die VIS einzubinden? (Bild und daneben Zeitpunkt des Klingels)
      Es gibt ja die Möglichkeit mittels IP/bha-api/history.cgi?event=doorbell&index=1
      das Bild des letzten Klingels aufzurufen.
      Im Doorbird eigenen Webinterface erhält man auch die Uhrzeit des Klingels mittels
      IP/bha-api/view.html

      Wie bekommt man die Uhrzeit in die VIS eingebunden?
      Leider reichten meine Programmierkenntnisse nicht aus um den Code dahingehend auszulesen.
      Ab Code Zeile 700 scheint es dort los zu gehen:
      (Auszug)

      
      		function showHistoryImage(httpResponse) {
      			if (httpResponse && httpResponse.status == AjaxHTTPResponseStatusCode.OK && httpResponse.content != null) {
      				var parameter = httpResponse.getParameter();
      				if (parameter != null) {
      					var container = parameter.get("container");
      					var timeContainer = parameter.get("timeContainer");
      					if (container != null) {
      						var arrayBufferView = new Uint8Array(httpResponse.content);
      						var blob = new Blob([arrayBufferView], {
      							'type': 'image\/jpeg'
      						});
      						objectURL = window.URL.createObjectURL(blob);
      						container.src = objectURL;
      						if (timeContainer) {
      							try {
      								var timestamp = httpResponse.getHeader("X-Timestamp");
      								if (timestamp == null) {
      									timestamp = httpResponse.getHeader("x-timestamp");
      								}
      
      								if (timestamp) {
      									var time = parseInt(timestamp) * 1000;
      									var date = new Date(time);
      									var weekdays = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
      									timeContainer.innerHTML = weekdays[date.getDay()] + " " + fillLeadingZeros(date
      											.getDate(),
      											2) + "." + fillLeadingZeros(date.getMonth() + 1, 2) + "." + date
      										.getFullYear() +
      										" " + fillLeadingZeros(date.getHours(), 2) + ":" + fillLeadingZeros(date
      											.getMinutes(),
      											2) + ":" + fillLeadingZeros(date.getSeconds(), 2);
      								}
      							} catch (e) {
      								//ignore
      							}
      						}
      					}
      				}
      			} else {
      				loadFailedHistory();
      			}
      		}
      
      		function fillLeadingZeros(value, size) {
      			var res = '';
      			for (var i = 1; i < size; i++) {
      				if (value < Math.pow(10, i)) {
      					res += '0';
      				}
      			}
      			res += '' + value;
      			return res;
      		}
      
      		function changeDesktopNotificationSetting(showAlert) {
      			if (checkNoDesktopNotificationSupport()) {
      				if (showAlert)
      					alert("This browser does not support desktop notification.");
      				return;
      			} else if (Notification.permission === "granted") {
      				showDesktopNotification = !showDesktopNotification;
      			} else if (Notification.permission === "denied") {
      				alert("You have prohibited desktop notifications of this page in your browser settings.");
      			} else {
      				Notification.requestPermission(function (permission) {
      					if (permission === "granted") {
      						showDesktopNotification = true;
      					}
      					switchDesktopNotificationEntry();
      					delete showDesktopNotification;
      				});
      				return;
      			}
      			switchDesktopNotificationEntry();
      		}
      
      		function switchDesktopNotificationEntry() {
      			updateCookieSettings();
      			if (showDesktopNotification && !monitorRunning)
      				startNotificationMonitor();
      			var notificationImg = document.getElementById("checkmark_notification_desktop");
      			if (notificationImg) {
      				if (showDesktopNotification) {
      					notificationImg.style.display = "inline";
      				} else {
      					notificationImg.style.display = "none";
      				}
      			}
      		}
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate
      FAQ Cloud / IOT
      HowTo: Node.js-Update
      HowTo: Backup/Restore
      Downloads
      BLOG

      890
      Online

      31.9k
      Users

      80.1k
      Topics

      1.3m
      Posts

      1
      1
      161
      Loading More Posts
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
      The ioBroker Community 2014-2023
      logo