@martiman OK, it was a case of RTFM
SUBSCRIBE_TOPIC = b"set_angle" b"pergola1/set_angle"
PUBLISH_TOPIC1 = b"status" b"pergola1/status"
Solved...
@martiman OK, it was a case of RTFM
SUBSCRIBE_TOPIC = b"set_angle" b"pergola1/set_angle"
PUBLISH_TOPIC1 = b"status" b"pergola1/status"
Solved...
@martiman OK, it was a case of RTFM
SUBSCRIBE_TOPIC = b"set_angle" b"pergola1/set_angle"
PUBLISH_TOPIC1 = b"status" b"pergola1/status"
Solved...
Dear all,
For my pergola I designed a servo control to follow the sun and a "dimmer setting" that allows a percentage of the sun.
As I have a double pergola, I also have 2 controls.
The trigonometry calculations are done in my PLC and my 2 RPI Pico W's subscribe to each the same topic "set_angle" and publish their "status".
Communication works as expected but in ioBroker objects, the 2 devices share identical topics.
The parameters and code I use in mPython are:
MQTT_BROKER = "rpi4.local"
CLIENT_ID = "pergola1"
SUBSCRIBE_TOPIC = b"set_angle"
PUBLISH_TOPIC1 = b"status"
print(f"Begin connection with MQTT Broker :: {MQTT_BROKER}")
mqttClient = MQTTClient(CLIENT_ID, MQTT_BROKER, keepalive=60)
mqttClient.set_callback(sub_cb)
mqttClient.connect()
mqttClient.publish(PUBLISH_TOPIC1, str("Homing").encode())
mqttClient.subscribe(SUBSCRIBE_TOPIC)
print(f"Connected to MQTT Broker :: {MQTT_BROKER}, and waiting for callback function to be called!")
I've seen duplicate devices where each gets it's own folder with each their respective states in the ioBroker objects but no idea how to do that in this case...
Does anyone know how to get each device into their own designated folder?
Thanks in advance!
@apollon77 I installed homebridge for this one and also android plugin for Shield TV. I don’t really need to automate these so Siri access is enough
@apollon77 Late reply, new system running on bookworm now which took me some time...
Well I'm using yahka for all my lights and gates combined with the S7 adapter so I'm familiar with that.
From my understanding Homebridge supplies the Homekit bridge that makes that Homebridge plugins will be recognised by the Home app.
According to the ham README.md the wrapper mode does not support this (I had a RTFM moment lol):
"IMPORTANT: This mode allows to use the device integrations of the provided homebridge plugins. No "bridge" is provided that can be used by the Home App!"
So then I should get at least some variables in objects that I can connect to yahka using enum no?
Or how should I interpret the "device integrations" mentioned above?
I really don't want to also have Homebridge running for just this plugin.
UPDATE:
After installing "homebridge-seasons", as it was tested and confirmed working, I suddenly started getting log errors which I didn't get with homebridge-eosstb plugin alone!?
Now the ham folder in objects gets a 0 folder with all necessary variables of the seasons plugin.
Still no eosstb variables.
2023-12-10 10:10:31.217 - debug: ham.0 (9301) setState Season.Season.Season-Name: set value = Winter
2023-12-10 10:10:31.219 - error: ham.0 (9301) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
2023-12-10 10:10:31.220 - error: ham.0 (9301) unhandled promise rejection: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 25ec2c37-426c-4b8e-a20f-976770fa1af5
2023-12-10 10:10:31.347 - error: ham.0 (9301) Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 25ec2c37-426c-4b8e-a20f-976770fa1af5
at WrapperBridge.Accessory.addBridgedAccessory (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/src/lib/Accessory.ts:594:15)
at WrapperBridge.addBridgedAccessory (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/index.js:299:55)
at /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/src/bridgeService.ts:554:11
at Array.forEach ()
at /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/src/bridgeService.ts:542:19
at /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/src/lib/util/once.ts:10:18
at SeasonsPlatform.accessories (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-seasons/index.js:64:3)
at /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/src/bridgeService.ts:537:17
at new Promise ()
at BridgeService.loadPlatformAccessories (/opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper/homebridge/bridgeService.js:400:16)
2023-12-10 10:10:31.348 - error: ham.0 (9301) Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 25ec2c37-426c-4b8e-a20f-976770fa1af5
2023-12-10 10:10:31.374 - info: ham.0 (9301) cleaned everything up...
2023-12-10 10:10:31.394 - info: ham.0 (9301) terminating
2023-12-10 10:10:31.396 - warn: ham.0 (9301) Terminated (UNCAUGHT_EXCEPTION): Without reason
2023-12-10 10:10:31.397 - debug: ham.0 (9301) [10/12/2023, 10:10:31] [EOSSTB] Goodbye
2023-12-10 10:10:31.898 - info: ham.0 (9301) terminating
2023-12-10 10:10:31.969 - error: host.rpi4 Caught by controller[1]: [10/12/2023, 10:10:30] Plugin /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword 'homebridge-plugin'.
2023-12-10 10:10:31.970 - error: host.rpi4 Caught by controller[2]: [10/12/2023, 10:10:30] Plugin /opt/iobroker/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword 'homebridge-plugin'.
2023-12-10 10:10:31.970 - error: host.rpi4 Caught by controller[3]: [10/12/2023, 10:10:30] The plugin "homebridge-eosstb" requires a Homebridge version of >=1.6.0 which does not satisfy the current Homebridge version of 1.5.0. You may need to update this plugin (or Homebridge) to a newer version. You may face unexpected issues or stability problems running this plugin.
2023-12-10 10:10:31.970 - error: host.rpi4 instance system.adapter.ham.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
2023-12-10 10:10:31.971 - info: host.rpi4 Restart adapter system.adapter.ham.0 because enabled
2023-12-10 10:11:02.013 - info: host.rpi4 instance system.adapter.ham.0 started with pid 9342
So apparently eosstb needs at least homebridge V1.6.0 and ham apparently still runs V1.5.0.
@apollon77 I assume the objects of the Homebridge plugin should be added as a ham subfolder?
@apollon77
From what I understand from the manual, the plugin will create the link to the Home app.
"homebridge-eosstb is a Homebridge plugin allowing you to control your set-top box (typically an ARRIS DCX960 / VIP5002W or HUMAX EOS1008R / 2008C) running on the Magenta AT / Telenet BE / Sunrise CH / Virgin Media GB & IE / Ziggo NL Horizon TV platform with Apple HomeKit using the Home app and the Apple TV Remote in the Control Center."
This is the full log after a restart of the plugin.
@apollon77 Thanks for your answer.
These are the settings I'm using:
Hi all,
Sorry but I'm not able to write in German, reading it without problems though.
I use ioBroker for years and just found this adapter but I'm having issues with the homebridge-eosstb plugin.
My logs show no errors in silly mode and the settopbox communication works but no are being objects created and the plugin is not available in my home app on the iPhone.
Any ideas?
Thanks!
So I decided to drop the loop inside loop as the arrays were not synchronising.
The time to troubleshoot would be more than the loop would save me time from programming the full code bit by bit.
Just for future reference if someone wants to do the same:
The "First_Run" bit is to fill the PLC DB so it doesn't overwrite the actual settings with an empty DB.
async function SyncSetpoint() {
var Heater = getObject("enum.functions.HeatingUp.setpoint").common.members;
var PLC = getObject("enum.functions.PlcHeatingUp.setpoint").common.members;
for(let i = 0; i < Heater.length; i++) {
on(PLC[i], function (dp) {
if(dp.state.c != scriptName) setState(Heater[i], dp.state.val);
return;
});
on(Heater[i], function (dp) {
if(dp.state.c != scriptName) setState(PLC[i], dp.state.val);
});
await wait(1000);
}
}
async function SyncProfile() {
var Heater = getObject("enum.functions.HeatingUp.profile").common.members;
var PLC = getObject("enum.functions.PlcHeatingUp.profile").common.members;
for(let i = 0; i < Heater.length; i++) {
on(PLC[i], function (dp) {
if(dp.state.c != scriptName) setState(Heater[i], dp.state.val);
return;
});
on(Heater[i], function (dp) {
if(dp.state.c != scriptName) setState(PLC[i], dp.state.val);
});
await wait(1000);
}
}
async function SyncBoost() {
var Heater = getObject("enum.functions.HeatingUp.boost").common.members;
var PLC = getObject("enum.functions.PlcHeatingUp.boost").common.members;
for(let i = 0; i < Heater.length; i++) {
on(PLC[i], function (dp) {
if(dp.state.c != scriptName) setState(Heater[i], dp.state.val);
return;
});
on(Heater[i], function (dp) {
if(dp.state.c != scriptName) setState(PLC[i], dp.state.val);
});
await wait(1000);
}
}
async function SyncBoostTime() {
var Heater = getObject("enum.functions.HeatingUp.boostTime").common.members;
var PLC = getObject("enum.functions.PlcHeatingUp.boostTime").common.members;
for(let i = 0; i < Heater.length; i++) {
on(PLC[i], function (dp) {
if(dp.state.c != scriptName) setState(Heater[i], dp.state.val);
return;
});
on(Heater[i], function (dp) {
if(dp.state.c != scriptName) setState(PLC[i], dp.state.val);
});
await wait(1000);
}
}
function SyncActualTemp() {
var Heater = getObject("enum.functions.HeatingUp.actual").common.members;
var PLC = getObject("enum.functions.PlcHeatingUp.actual").common.members;
for(let i = 0; i < Heater.length; i++) {
on(Heater[i], function (dp) {
if(dp.state.c != scriptName) setState(PLC[i], dp.state.val);
});
}
}
function SyncActualHum() {
var Heater = getObject("enum.functions.HeatingUp.hum").common.members;
var PLC = getObject("enum.functions.PlcHeatingUp.hum").common.members;
for(let i = 0; i < Heater.length; i++) {
on(Heater[i], function (dp) {
if(dp.state.c != scriptName) setState(PLC[i], dp.state.val);
});
}
}
function SyncWinStat() {
var connStatHeater = getObject("enum.functions.HeatingUp.connStatWin").common.members;
var connStatPLC = getObject("enum.functions.PlcHeatingUp.connStatWin").common.members;
var winStatHeater = getObject("enum.functions.HeatingUp.winStat").common.members;
var winStatPLC = getObject("enum.functions.PlcHeatingUp.winStat").common.members;
var batStatHeater = getObject("enum.functions.HeatingUp.batStatWin").common.members;
var batStatPLC = getObject("enum.functions.PlcHeatingUp.batStatWin").common.members;
for(let i = 0; i < connStatPLC.length; i++) {
on(connStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(connStatPLC[i], dp.state.val);
});
if (getState(connStatHeater[i]).val != true) {
on(winStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(winStatPLC[i], dp.state.val);
});
on(batStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(batStatPLC[i], dp.state.val);
});
}
}
}
function SyncThermStat() {
var connStatHeater = getObject("enum.functions.HeatingUp.connStatTherm").common.members;
var connStatPLC = getObject("enum.functions.PlcHeatingUp.connStatTherm").common.members;
var batStatHeater = getObject("enum.functions.HeatingUp.batStatTherm").common.members;
var batStatPLC = getObject("enum.functions.PlcHeatingUp.batStatTherm").common.members;
for(let i = 0; i < connStatPLC.length; i++) {
on(connStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(connStatPLC[i], dp.state.val);
});
if (getState(connStatHeater[i]).val != true) {
on(batStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(batStatPLC[i], dp.state.val);
});
}
}
}
function SyncRadStat() {
var connStatHeater = getObject("enum.functions.HeatingUp.connStatRad").common.members;
var connStatPLC = getObject("enum.functions.PlcHeatingUp.connStatRad").common.members;
var batStatHeater = getObject("enum.functions.HeatingUp.batStatRad").common.members;
var batStatPLC = getObject("enum.functions.PlcHeatingUp.batStatRad").common.members;
for(let i = 0; i < connStatPLC.length; i++) {
on(connStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(connStatPLC[i], dp.state.val);
});
if (getState(connStatHeater[i]).val != true) {
on(batStatHeater[i], function (dp) {
if(dp.state.c != scriptName) setState(batStatPLC[i], dp.state.val);
});
}
}
}
//function SyncOnStart() {
on({id: "s7.2.DBs.DB5.First_Run"/*First_Run*/, change: "ne"}, async function (obj) {
var SPHeater = getObject("enum.functions.HeatingUp.setpoint").common.members;
var SPPLC = getObject("enum.functions.PlcHeatingUp.setpoint").common.members;
var TempHeater = getObject("enum.functions.HeatingUp.actual").common.members;
var TempPLC = getObject("enum.functions.PlcHeatingUp.actual").common.members;
var HumHeater = getObject("enum.functions.HeatingUp.hum").common.members;
var HumPLC = getObject("enum.functions.PlcHeatingUp.hum").common.members;
var ProfileHeater = getObject("enum.functions.HeatingUp.profile").common.members;
var ProfilePLC = getObject("enum.functions.PlcHeatingUp.profile").common.members;
var BoostHeater = getObject("enum.functions.HeatingUp.boost").common.members;
var BoostPLC = getObject("enum.functions.PlcHeatingUp.boost").common.members;
var BoostTimeHeater = getObject("enum.functions.HeatingUp.boostTime").common.members;
var BoostTimePLC = getObject("enum.functions.PlcHeatingUp.boostTime").common.members;
var WinStatHeater = getObject("enum.functions.HeatingUp.winStat").common.members;
var WinStatPLC = getObject("enum.functions.PlcHeatingUp.winStat").common.members;
var batStatRadHeater = getObject("enum.functions.HeatingUp.batStatRad").common.members;
var batStatRadPLC = getObject("enum.functions.PlcHeatingUp.batStatRad").common.members;
var connStatRadHeater = getObject("enum.functions.HeatingUp.connStatRad").common.members;
var connStatRadPLC = getObject("enum.functions.PlcHeatingUp.connStatRad").common.members;
var batStatThermHeater = getObject("enum.functions.HeatingUp.batStatTherm").common.members;
var batStatThermPLC = getObject("enum.functions.PlcHeatingUp.batStatTherm").common.members;
var connStatThermHeater = getObject("enum.functions.HeatingUp.connStatTherm").common.members;
var connStatThermPLC = getObject("enum.functions.PlcHeatingUp.connStatTherm").common.members;
let value = obj.state.val;
let oldValue = obj.oldState.val;
if (getState("s7.2.DBs.DB5.First_Run").val == true) {
for(let i = 0; i < SPHeater.length; i++) {
setStateDelayed(SPPLC[i], getState(SPHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(TempPLC[i], getState(TempHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(HumPLC[i], getState(HumHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(ProfilePLC[i], getState(ProfileHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(BoostPLC[i], getState(BoostHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(BoostTimePLC[i], getState(BoostTimeHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
};
for(let i = 0; i < WinStatHeater.length; i++) {
setStateDelayed(WinStatPLC[i], getState(WinStatHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
};
for(let i = 0; i < batStatRadHeater.length; i++) {
setStateDelayed(batStatRadPLC[i], getState(batStatRadHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(connStatRadPLC[i], getState(connStatRadHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
};
for(let i = 0; i < batStatThermHeater.length; i++) {
setStateDelayed(batStatThermPLC[i], getState(batStatThermHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
setStateDelayed(connStatThermPLC[i], getState(connStatThermHeater[i]).val, false, parseInt(((0) || "").toString(), 10), false);
};
await wait(3000);
setStateDelayed("s7.2.DBs.DB5.First_Run", false, false, parseInt(((0) || "").toString(), 10), false);
}
});
SyncSetpoint();
SyncProfile();
SyncBoost();
SyncBoostTime();
SyncActualHum();
SyncWinStat();
SyncThermStat();
SyncRadStat();
So thanks @paul53 but I gave up and took the less beautiful way out
@paul53 BTW thanks for the async declaration and await!
I read await was not possible in a sync function so skipped trying it.
If I put await for 1000ms it blocks the back and forth updating due to the hmip communication inconsistency.
Again, I'm really newby when it comes to scripting