14yannick / HCPBridgeMqtt

emulates Hoermann HAP 1 HCP (HCP2) on ESP8622, ESP32 and Arduino.
1 stars 0 forks source link

Home Assistant Close/Open Arrow deactivated in partially open Position. #6

Closed 14yannick closed 1 year ago

14yannick commented 1 year ago

When position is set using slider (such as normal cover). However the issue is -it was fully open, I moved it to position "57" but after, I am no longer able to press arrow down to close it. Sure, I could use slider, but usually when I am using it on entities card, it is arrows and stop. So arrow down is greyed out. Check if same behavior is observed in other repositories.

stomko11 commented 1 year ago

When I used slider to partially close gate yesterday, issue was the same. It was in open state, then closing all the way to position 57. But then arrow down was greyed out. I believe using slider is the same as calling service "set_position" Fork I am using now https://github.com/MCLW/HCPBridgeHomeassistant does not suffer from that. It has greyed out arrows only in end positions (cannot go up if fully opened, or down if fully closed).

14yannick commented 1 year ago

You can try my dev Branch to check if you have also the issue there. https://github.com/14yannick/HCPBridgeMqtt/tree/development PS the setPosition looks not as accurate as on the orignal Branch from Pboschi.

stomko11 commented 1 year ago

This one works ok. What do you mean it is not as accurate?

14yannick commented 1 year ago

I observed that for example I send setPosition 20 and the door stops at position 22. Do you use the vent Switch? If yes does it work out of the box meaning switch remain active when door is venting?

stomko11 commented 1 year ago

I don't use vent position as it opens very little, maybe I need to configure it - never checked to be honest. Because if I can set position, I can create my own positions if needed easily. And whether it is open to 22 instead of 20 is fine as well I guess. As long as open opens, and close closes... :-)

stomko11 commented 1 year ago

I have been using this code for a few days, but I ocasionally face issues - seems that esp freezes, I do not see it on the network. Hormann reports "04" error. Looking at the status in ha - it shows all good status, controls, etc. Just does not respond to anything. Neither my push button (shorting contacts on Hormann) works. Pulling power and powering it on again makes it work. Not sure what is going on here.

14yannick commented 1 year ago

Maybe it's related to the other Problem we are tracking here. https://github.com/Gifford47/HCPBridgeMqtt/issues/11 I just updated my dev Branch with the Fix. It's not using the WifiMAnager so you have to input your Wifi SSID and Password in the configuration.h file. Tell me if you still face the error.

stomko11 commented 1 year ago

Thanks. I will be able to give it a try in about week. I believe that when it happened, motor showed error 4, but I am not 100% sure about it.

i5Js commented 1 year ago

Hi,

I don't know if its related so my apologies in advanced but, I see when I select the venting switch in home assistant, it doesn't keep "on", because the status change to open instead venting.

image

However, if I check status, it says it's venting:

image

I can open a new issues if it's not related to this.

Thanks for your work.

14yannick commented 1 year ago

Hi @i5Js it's a side effect of this change. I have created two Status "sensors". First one only with valid Cover State values according to the specs. https://www.home-assistant.io/integrations/cover.mqtt/ and a second with a more detailed status where I have all Status provided by the motor (like half open, half opening, ... , Venting). This change was done because I think that the arrow where missing because the state of the door was not "valid" based on the specs and therefore arrows get deactivated. During this rewrite I renamed the status from "vent" to "venting" but forgot to change it in the configuration file.

i5Js commented 1 year ago

Hi @14yannick

Many thanks for your quick response. I will change the code too and I will try it.

cheers!

fisch55 commented 1 year ago

Shiort question . Which repo I should use? 14Yannick or gifford47?

i5Js commented 1 year ago

I am using Yannick’s because I want the option to venting :)

Enviado desde Outlook para iOShttps://aka.ms/o0ukef


De: fisch55 @.> Enviado: Monday, June 26, 2023 5:15:22 AM Para: 14yannick/HCPBridgeMqtt @.> Cc: i5Js @.>; Mention @.> Asunto: Re: [14yannick/HCPBridgeMqtt] Home Assistant Close/Open Arrow deactivated in partially open Position. (Issue #6)

Shiort question . Which repo I should use? 14Yannick or gifford47?

— Reply to this email directly, view it on GitHubhttps://github.com/14yannick/HCPBridgeMqtt/issues/6#issuecomment-1606530406, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIFKGZWAW4W3QNABPMKLBDXND5EVANCNFSM6AAAAAAYNCBKWA. You are receiving this because you were mentioned.Message ID: @.***>

14yannick commented 1 year ago

Hi, My master is a Fork of Gifford47 There I have implemented a vent Switch and an optional Proximity sensor to have the information if the parking spot is available. Then I create my development Branche where I took the Implementation of the communication with the motor from a other repository. By my perspective I found this code easier to understand and to maintain (credits to @kfroeschl). There I add the SetPosition feature from Pboshi to have the same feature as in Gifford47 one. Then I created a second Status sensor see above and rewrite the mqtt setup to avoid a crash when Wifi get lost (see this issue. @Gifford47 wrote that he will also fix this in his repo. As soon it's done, I will resync my Master Repo. To make it short. My master Repository is mainly identical with the one of Gifford47. My development is by my knowledge the only who didn’t cause ESP restart at lost wifi connection. Downside of my development repository that it’s the only one using the rewrote communication with the motor.

Gifford47 commented 1 year ago

Hi!

my dev branch is now nearly the same like 14yannicks because of his modbus rewrite implementation (credits to @14yannick). i will merge it with my master branch that have some options for openhab users and debug levels. the next step is to add an optional motion/pir sensor.

i5Js commented 1 year ago

Hahahah love you guys!! Appreciate your job!

Enviado desde Outlook para iOShttps://aka.ms/o0ukef


De: Gifford47 @.> Enviado: Monday, June 26, 2023 10:22:01 AM Para: 14yannick/HCPBridgeMqtt @.> Cc: i5Js @.>; Mention @.> Asunto: Re: [14yannick/HCPBridgeMqtt] Home Assistant Close/Open Arrow deactivated in partially open Position. (Issue #6)

Hi!

my dev branch is now nearly the same like 14yannicks because of his modbus rewrite implementation (credits to @14yannickhttps://github.com/14yannick). i will merge it with my master branch that have some options for openhab users and debug levels. the next step is to add an optional motion/pir sensor.

— Reply to this email directly, view it on GitHubhttps://github.com/14yannick/HCPBridgeMqtt/issues/6#issuecomment-1606954216, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIFKG5GOJMYBP76OSCHHS3XNFBCTANCNFSM6AAAAAAYNCBKWA. You are receiving this because you were mentioned.Message ID: @.***>

kfroeschl commented 1 year ago

Hi,

thanks for your efforts. I'm eager to try out your version(s). I had a lot of pain with mqtt and ESPHome approach since it always killed the Modbus.

I integrated it to home assistant with Rest-Polling in the meantime.

14yannick commented 1 year ago

Hi @kfroeschl, Nice to here from would be nice to get your return from my development branche. As you maybe saw it's your rewrite implementing the feature of Gifford47. It works without any issue since a couple of weeks now.

kfroeschl commented 1 year ago

Hi @14yannick,

I've installed and checked Gifford47/HCPBridgeMqtt/master on my engine and it works fine. It is almost identical to your development version.

From what I see there are no issues in there. Though for simplicity I want to try integrating the HomeAssistant Library which I saw in some forks at some time: https://github.com/MCLW/HCPBridgeHomeassistant/blob/master/HCPBridgeESP32/src/main.cpp#L173C6-L173C18 (Though this is not good for openHab users it would decrease maintenance efforts)

I guess when I've time again I'll do some refactoring to achieve a more clean code and split the different features (I'm a backend developer and thus sometimes a little picky)

14yannick commented 1 year ago

Hi @kfroeschl, yes the reppo of Gifford47 have been chosen to be the one we continue the development. I think you also get access to push commits to it. I will update my repository accordingly referring to gifford47s repo. I saw this repo and found it interesting how few lines are needed to create the Home assistant integration. I don't know if a modular approach is possible. I like your hoermann.h class where everything related to the communication to the motors is defined and has almost no dependency to the rest of the project. Actually the main code have a lot of stuff ongoing, Web Server, MQTT client, Sensor logic, setup, .... For me it would make sense to create some module for example sensors.h, mqtt, homeAssistant library, all of them working independently from each other. So if have no sensor and no sensors I only wanna use the web app I set which module i wanna use in the config and the build will prepare a binary accordingly. It would streamline the main code and make it easier to maintain. Do you have a similar approach?