node-red-contrib-blindcontroller icon indicating copy to clipboard operation
node-red-contrib-blindcontroller copied to clipboard

[Question] Using blind controller with openhab

Open patrickse opened this issue 5 years ago • 8 comments

Hi and thanks for this cool node red addition. I´ve implemented it with my blinds it´s working near to perfect. My only problem is, that I´ve got local blind controls and I still want to use em.

The blinds are controlled by openhab and there´s a node that will receive the command for the blinds and want that triggers a sequence as soon as there´s any change to openhab controlled blind.

So as soon as I hit the button on the wall, the node-red-contrib-blindcontroller node switches to manual override and stays there for the expiry period. That´s exactly what I want... but if there´s an automatic action triggered by the sun position... the blindcontroller thinks can that there was a manual override...

Do you have a little hint how I can solve this...

image

BR, Patrick

patrickse avatar Jul 10 '19 14:07 patrickse

Let me have a look - this is not the intended behaviour. The manual override is meant to stay in place for the expiry period, so I suspect this is a bug. Give me a couple days as I am presently away on vacation.

alisdairjsmyth avatar Jul 11 '19 11:07 alisdairjsmyth

@alisdairjsmyth don´t worry. Have a good time and we can have chat later this month ;)

patrickse avatar Jul 11 '19 12:07 patrickse

I haven't been able to re-produce a situation where the node calculates an automated position while a manual position remains valid.

With regard to your flow, can you clarify what the Trigger node is injecting into the Blind Controller node every 5 minutes. In my setup I have the Inject node firing a timestamp into the Sun Position on startup and then every 5 minutes thereafter, which in turn sends a sun message into the Blind Controller. i.e. the Blind Controller calculates a new blind position based on a new sun position every 5 minutes.

alisdairjsmyth avatar Jul 14 '19 11:07 alisdairjsmyth

Oh ok.. that´s a fault on my side. The Inject node should be place before the Sun Position node. But my problem is related to the FF_Bathroom_Shutter node. As soon as the Blind Controller node sends a BlindPos Update to the node on the right, it will cause the left FF_Bathroom_Shutter to update it´s state and send a message containing the new position.

  1. SunPos causes BlindController to send a new BlindPos to FF_Bathroom_Shutter Output
  2. FF_Bathroom_Shutter (right) will send the new state to Openhab and my blinds start to move.
  3. FF_Bathroom_Shutter Input (left) will catch the new Position reported and forwards the position as a manual override to the Blind Controller

So now I am stuck in a more or less circular reference causing an always-override mode.

Hope I could make it a bit more clearer... thanks for your time ;)

patrickse avatar Jul 15 '19 13:07 patrickse

Classic split-brain scenario. Two state models thinking they are in control so telling the other of change. My suggestion would be to remove the overlap in responsibilities. The Blind Controller node is intended to have full responsibility for controlling the position of the blind. In your OpenHab implementation you want to separate the handling of the request for a manual blind position (Channel) from the responsibility for moving the blind (Device Handler), and only route channel requests to the Blind Controller. This way you will avoid OpenHab sending blind positions to the Blind Controller that were originally calculated by the Blind Controller.

In the case of a manual blind setting, OpenHab handles the request via the Channel component and routes it to Blind Controller which in turn sends the requested blind position to the Device Handler. There is no feedback loop to Blind Controller. In the automated case, Blind Controller issues a calculated blind position command to the Device Handler. As there is no feedback loop, the state model of the Blind Controller remains consistent.

image

In this implementation you don't need the "filter" in the Node-Red flow to drop manual blind positions.

alisdairjsmyth avatar Jul 15 '19 23:07 alisdairjsmyth

@patrickse - are you still trying to resolve this in your implementation?

alisdairjsmyth avatar Jul 22 '19 06:07 alisdairjsmyth

@patrickse - are you still trying to resolve this in your implementation?

Sort of ... now I am on holiday. I´ve changed a few bits in my setup. I will try to sent you a few hints later today. I am still testing the configuration but it looks promising..

Btw, can I send an override and prevent the Roller-Node to send an outgoing message?

patrickse avatar Jul 25 '19 06:07 patrickse

At this time the node will always output a message if it is requested to set a position. Even if I incorporated such a feature it would not fully fix your situation because an automatically calculated position is fed back into the node as a manual position - so the node will stop calculating blinds positions for the period of the expiry window.

alisdairjsmyth avatar Jul 25 '19 07:07 alisdairjsmyth