Fix initial state request

This commit is contained in:
Adrian Jagielak 2025-07-22 00:35:56 +02:00
parent 6cee45447d
commit ba1be7766c
No known key found for this signature in database
GPG Key ID: 0818CF7AF6C62BFB
2 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
name: Futurehome
version: "0.0.11"
version: "0.0.12"
slug: futurehome
description: Local Futurehome Smarthub integration
url: "https://github.com/adrianjagielak/home-assistant-futurehome"

View File

@ -35,7 +35,8 @@ import { publishDiscovery } from "./discovery";
fimp.on("message", (topic, buf) => {
try {
const msg = JSON.parse(buf.toString());
console.debug("Received a FIMP message", topic, msg);
console.debug("Received a FIMP message", topic);
console.debug(JSON.stringify(msg, null, 0));
if (msg.type === "evt.pd7.response") {
const devices = msg.val?.param?.devices ?? [];
devices.forEach((d: any) => publishDiscovery(ha, d));
@ -48,11 +49,17 @@ import { publishDiscovery } from "./discovery";
// -- ask hub for the device list --------------------------------------
fimp.publish("pt:j1/mt:cmd/rt:app/rn:vinculum/ad:1", JSON.stringify({
corid: null,
ctime: new Date().toISOString(),
props: {},
resp_to: "pt:j1/mt:rsp/rt:app/rn:ha-futurehome/ad:addon",
serv: "vinculum",
src: 'smarthome-app',
tags: [],
type: "cmd.pd7.request",
service: "vinculum",
uid: uuid(),
val_t: "object",
val: { cmd: "get", component: "state" },
resp_to: "pt:j1/mt:rsp/rt:app/rn:ha-futurehome/ad:addon"
val_t: "object",
ver: '1',
}), { qos: 1 });
})();