Zeze21 Posted September 30 Share Posted September 30 Hi I have a Shelly 2 pm to control or cover. Attached I have Shelley add-on with the door contact sensor I would like to prevent any action of the cover based on the door sensor state. Is that possible within the Shelly configuration itself? Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Heinz Posted September 30 Share Posted September 30 Hi Just so we are on the same page. you have a 2 PM that is connected to a roller shutter you then added a shelly addon with a door sensor. When the door is open and or closed you want to make sure the roller does not go down automatically or when you manually bring down the roller? Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Zeze21 Posted October 2 Author Share Posted October 2 to be honest if possble on both.... the door contact should override any other action regardless if automatic (home assistant) or manual if the door is open the shutter should not move at all Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Zeze21 Posted October 2 Author Share Posted October 2 Actually lets say only manually. I can automate everything else in home assistant. But I Want that if the door is open and someone touches the buttons for up or down, nothing happens. Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Zeze21 Posted Saturday at 09:41 PM Author Share Posted Saturday at 09:41 PM Is there any possibility to achive this? Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Tisme_Martin Posted Sunday at 05:38 PM Share Posted Sunday at 05:38 PM That's possible also in OH or HA and in the Shelly module write your software or script to do that for you. "Close" roller depends on the state of input from de door or window ( on á plus i4 or something else) contact close (failsafe) =1 and contact open is o 'Stop" and "Open" is no problem the door is closed because the roller is close to Open it. In had it working in OH but after update from 2PM to FW 1.4.2 Cover (for Roller) is not working anymore. Because of no solution yet or any help, i will make the same in the 2PM as script and that will work also. Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Zeze21 Posted Monday at 06:33 PM Author Share Posted Monday at 06:33 PM (edited) To be honest i just want it in the shelly itself. As soon as the door is opened it should just disregard any intputs from the buttons. If Door=open then DO NOT MOVE unfortunately i have not the slightest clue how to code this. chat gpt wrote this for me... could someone proofread this? // Initialize the variables let doorSensorInput = 0; // 0 = door closed, 1 = door open // Function to check the state of the door function checkDoorStatus() { // Get the status of the door sensor (connected to the Shelly AddOn) Shelly.addon.GetStatus({id: 0}).then(function(result) { doorSensorInput = result.inputs[0].input; // Get the door sensor state if (doorSensorInput === 1) { // Door is open print("Door is OPEN. Shutter movement is blocked."); } else { // Door is closed print("Door is CLOSED. Shutter can operate."); } }); } // Block shutter movement if door is open function blockShutterMovement(command) { if (doorSensorInput === 1) { // Block the command if the door is open print("Command blocked due to door being open."); return false; // Prevent the shutter from moving } return true; // Allow shutter to move if door is closed } // Listen for shutter commands Shelly.addon.SetCommandHandler({ id: 0, name: "shutter_control", handler: function (command) { checkDoorStatus(); // Check the door status before executing the command // Check if the door is open or closed if (!blockShutterMovement(command)) { return; // Exit if the door is open } // If the door is closed, execute the shutter command Shelly.call("Shutter", command.method, command.params); } }); // Continuously monitor the door sensor state Timer.set(5000, true, function() { checkDoorStatus(); // Poll the sensor every 5 seconds to update the door status }); Thank you! Edited Monday at 06:40 PM by Zeze21 Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
wooly Posted Monday at 07:31 PM Share Posted Monday at 07:31 PM why you have not used the second input of 2+PM that can be used as safety switch [if closed, it stops the movements] ? Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Tisme_Martin Posted Tuesday at 08:07 PM Share Posted Tuesday at 08:07 PM (edited) @wooly that very very good of you 👍 I'am very happy with your answer. I did overthink that my self. But in my home all the rollers are 230V that's ok no problem and I use 2PM so that works fine. All the doors and windows have reed contacts, so i see what is open or close in my home building controle unit. That's to stop rollers, to stop heating or cooling and for safety matters to protect my home , all is working already 45 years. I hear you thinking, if all is working so long what do i do hier ? I am building system engineer but i stop in á couple of years ( than i'm 70) and I do not wanted to pay for the licences from the building controller software (€ 2500,- ) when al my customers are gone, for only to look sometimes or to some changes. So i will build it all new now with Raspbery PI and software Openhap and Shelly for the points AI AO DI DO. But my problem is i have to start over with scripting that not my thing yet !, I have read many many papers but somehow it comes not good in my head. That needs time, But i will learn it , i need only a little more time to copy that all. So back to your point , My contacts and the wiring is not for 230V so i cannot connect it to the input of the 2PM . You did give me a very good direction to go on. I did also not like to use wireless Shelly plus i4 for security of my home . Alarm contacts and door openers shout have real wiring and not wireless . So in my case i will set all contact on relais and use 1 contact for on the Plus 2PM and others for on plus i4 for other software handeling. But maybe Zeze21 you can use it directly on the 2PM ? ---------------------------------------------------------------------------------------------------- @Wooly I have an other question I use Plus 2PM for my Rollers setting is not switch but cover that was working fine and all my Roles are already working in my home. I had FW 1.07 that was working, everything OK, it works fine and seen in the Shelly binding. Then after up date to 1.4.2 it still was OK. But after i did chose Cover (for Roller) its all over notting works any more. The 2PM was gone not finding in the binding and those i already installed gives the message "no connection" Can you me help with that , i have already ask many times but no answer . Maybe you have an solution or can tell me what is the state of the problem ? Is OpenHab community knowing of it ? Is someone working on it ? Thank you , i hope you can help me and other people who ask for the same problem. Edited Tuesday at 08:25 PM by Tisme_Martin Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
wooly Posted 7 hours ago Share Posted 7 hours ago I cannot answer on the last question, since I am not fond on relying for scenes on an external application, since it introduce a further point of failure, so an "intelligent device"is something that is different than just a "connected device", that often is just something that have commands and display on a portable device, that can be used to control many other devices, but cannot do anything alone. In my installation remote connection is used almost only to reprogram the behaviour of a device, or give a specific manual command. Quote Translate Revert translation? English (American) Finnish French German Italian Portuguese (European) Spanish Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.