Hi all
is there a way other than creating a template in HA to have the last _change value in Home remote ?
Coming from Homeseer, this information was available right out of the box but I can’t find anywat to get this info from HA
thanks
Hi all
is there a way other than creating a template in HA to have the last _change value in Home remote ?
Coming from Homeseer, this information was available right out of the box but I can’t find anywat to get this info from HA
thanks
I am not aware of a way to do this but, as an HA user, I would love to be notified of how you figure it out!
Okay, I had a relatively simple plugin created that writes the necessary HR data to a log file. This file can be displayed in HR in a web browser window (with the latest entries at the top).
I have put together a zip file that contains a Python program (LogServer.exe) that creates a small mini server. Please read the readme.txt file in the ZIP file.
For the HR plugin, simply right-click on “Devices” and select “Add Plugin” → Import from Code. In the window that opens, copy and paste the JS code from here.
In the settings, you can set the IP and port of the Python web server.
If anything is unclear, just ask.
Best regards,
Kalle
Here the plugin code:
// Plugin Name: LogSender
// Version: 1.6 (MediaCommand compatible - FINAL FIX)
// Purpose: Sends log message via MediaCommand, bypassing Data Setter/iConvertible issues.
// --- CONFIGURATION ---
var API_ENDPOINT = "/api/log/";
// ---------------------
var http = new HTTPClient();
var baseUrl;
// --- PLUGIN PROPERTIES ---
plugin.Name = "LogSender";
plugin.Version = "1.6";
plugin.OnChangeRequest = onChangeRequest;
plugin.OnConnect = onConnect;
plugin.OnDisconnect = onDisconnect;
plugin.OnSynchronizeDevices = onSynchronizeDevices;
// Default settings exposed in the Home Remote Designer
plugin.DefaultSettings = {
"Host": "192.168.68.116",
"Port": "8097"
};
// --- HOOKS ---
function onConnect() {
baseUrl = "http://" + plugin.Settings["Host"] + ":" + plugin.Settings["Port"];
console.log("LogSender Plugin connected. Base URL set to: " + baseUrl);
}
function onDisconnect() {
console.log("LogSender Plugin disconnected.");
}
/**
* 💡 NEW HOOK: Intercepts the MediaCommand, which now carries our log message.
*/
function onChangeRequest(device, attribute, value) {
if (device.Id == "LogAPI" && attribute == "MediaCommand") {
// The 'value' is the string that was sent as the MediaCommand.
SendLogEntry(value);
} else {
throw "Invalid action requested for LogSender Plugin";
}
}
function onSynchronizeDevices() {
var logDevice = new Device();
logDevice.Id = "LogAPI";
logDevice.DisplayName = "Log API Sender";
// 💡 NEW: The device must possess the MediaControl Capability.
logDevice.Capabilities = ["MediaControl"];
// Since we don't have predefined commands, this remains empty.
logDevice.SupportedMediaCommands = [];
plugin.Devices[logDevice.Id] = logDevice;
}
// --- MAIN LOGIC ---
function SendLogEntry(logMessage) {
if (!baseUrl) {
console.error("LogSender Plugin: Base URL not initialized.");
return;
}
var encodedMessage = encodeURIComponent(logMessage);
var url = baseUrl + API_ENDPOINT + encodedMessage;
http.get(url);
console.log("LogSender Plugin: Sent log entry to: " + url);
}
Here the zip file with the Python Server (instructions in the readme)
This is a picture from the dashboard how ist will be looks like:
to assign this function to a button use "LogApiSender.MediaCommand and for value you can use any device binding or your own text - but multibinding makes the most sense for me.
here the result with multibinding:
Hi Greg, maybe you can try it 