From ba1be7766c9f83e7c5edcd6b43752ab2c3131863 Mon Sep 17 00:00:00 2001 From: Adrian Jagielak Date: Tue, 22 Jul 2025 00:35:56 +0200 Subject: [PATCH] Fix initial state request --- futurehome/config.yaml | 2 +- futurehome/src/index.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/futurehome/config.yaml b/futurehome/config.yaml index c539448..54f565f 100644 --- a/futurehome/config.yaml +++ b/futurehome/config.yaml @@ -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" diff --git a/futurehome/src/index.ts b/futurehome/src/index.ts index 44b52a4..d96e71c 100644 --- a/futurehome/src/index.ts +++ b/futurehome/src/index.ts @@ -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 }); })();