runely / remootio-homey

Control your Remootio device with Homey
GNU General Public License v3.0
1 stars 0 forks source link

Status mismatch #16

Closed jaccoh closed 1 year ago

jaccoh commented 2 years ago

Now that homey supports Advanced Flows, I wrote a nice flow to automatically close the gate after X time. This works fine but it's easy to confuse the "then"/"status" cards. Can we add an option to always ask via an API call what the status of the gate is?

Symptoms: the card shows the gate is closed even though it's open.

Work around: restart the app or Homey.

runely commented 2 years ago

Not sure what you mean. Could you take a screenshot of your advanced flow and explain what is confusing?

Also, the gate status sensor presented on the device in Homey is always up to date with the actual physical Remootio garage sensor aslong as the Remootio device has WiFi access, the WebSocket API in the physical Remootio device is running, the Remootio app on your Homey is running and the device on your Homey is connected to your Remootio device.

Even if you execute a Close garage door action card when the garage door already are closed, the WebSocket API will know this and nothing will happen.

jaccoh commented 2 years ago

I will do so next week. I’m not currently at home.

But reading your explanation the thing I’m experiencing maybe explained as a bug in homey instead?

What happens sometimes is of two things:

Both scenarios result in a broken flow. I’ve tried simple and really over engineered complex flows. Result: homey thinks the port is closed (when you debug the flow the card literally says so), even though it is not.

Screenshots and photo’s next week!

On 14 Jul 2022, at 22:56, Rune Moskvil Lyngås @.***> wrote:

 Not sure what you mean. Could you take a screenshot of your advanced flow and explain what is confusing?

Also, the gate status sensor presented on the device in Homey is always up to date with the actual physical Remootio garage sensor aslong as the Remootio device has WiFi access, the WebSocket API in the physical Remootio device is running, the Remootio app on your Homey is running and the device on your Homey is connected to your Remootio device.

Even if you execute a Close garage door action card when the garage door already are closed, the WebSocket API will know this and nothing will happen.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

runely commented 2 years ago

Just to point it out, there is a delay from when the garage door has been notified to close/open to the app actually knows that it has been closed/opened.

This delay happens because the WebSocket API only sends status changes when, and only when, the status sensor and the magnet sensor meets or is pulled apart.

runely commented 1 year ago

Do you still think there’s some confusion? If so, do you have some screenshots? Otherwise this issue will be closed

jaccoh commented 1 year ago

yes, sorry I was busy. But I managed to reproduce it. Currently the flow in Homey thinks the port is closed (not "geopend" in Dutch) and the homey app clearly shows it as "open".

https://nextcloud.hoeve.nu/s/cKTBCqg7qWiEay7

runely commented 1 year ago

When i use a Is closed condition card and invert it like you have done, making it a Is open card, I’m not able to reproduce this! Even when its not inverted, it works as it should.

Can you check these things on your end:

  1. Have you setup the device according to prerequisites ?
  2. Can you confirm that the device setting in homey Is sensor logic flipped is equal to the gate status sensor setting in the Remootio app located at Add-ons -> Gate status sensor -> Flip logic ? Read more about this setting here
  3. If your gate is actually open, is the device icon showing an open gate or a closed gate?
  4. If you click the gate icon in the homey device, to trigger it to open or close, does the icon reflect the status change?
jaccoh commented 1 year ago
  1. Yes it is installed according to those prereqs.
  2. Sensor logic is not flipped in Homey nor in the Remootio app. So yes I can confirm.
  3. I've added some more screenshots out of the homey app. The button is lit at that time. So it thinks the gate is closed,. which it isn't.
  4. If I click on the icon in the homey app, the button goes "dark" but nothing happens. It does however fix the flow. After that the card shows the correct status again and the flow closes the gate!

Just to repeat myself: The flow normally works fine. But I can confuse the status in the homey app somehow. Two ways to do that:

  1. Stand in front of the gate sensor such that it doesn't actually close even though that command is given in the homey flow/app.
  2. Open and close it too often with something other than the homey app. Eg. the hardware radio remote.
runely commented 1 year ago

You are right. As of now it can be fooled like that. I'll look into how to fix that.

jaccoh commented 1 year ago

Can we perhaps (as a setting) opt for active API calls instead of depending on the push functionality from Remootio?

runely commented 1 year ago

You don’t have to use the button on the device in Homey if you don’t want to. The app already listens to the WebSocket API to update the status of the button when the gate status sensor has changed status. Keep in mind that status change is ONLY sent through the API when the gate status sensor actually meets or leaves the magnet sensor.

If you, or something / someone else, prevents the gate from closing (meeting the magnet) and instead the gate reopens, making it so the gate never meets the magnet, then this will not count as a status change. The WebSocket API ONLY counts a status change when the magnet meets or leaves the gate status sensor.

The app can be confused / show false status if you trigger a open/close with the button in Homey and then prevents the gate from opening/closing. The reason for this is how the button in Homey device apps works.

I'm looking into how i can improve this.

runely commented 1 year ago

I have made a change in v1.2.4 so that the button will be prevented from changing its state until the WebSocket API gets notified about a status change. Well, preventing is probably not the correct word since Homey changes the state of the button when its clicked and i change it back.

v1.2.4 is released as a test version for now in Homey App Store here. Can you install this an see if this fixes your problem?

jaccoh commented 1 year ago

I've installed the test version 1.2.4.

I will test it tomorrow ms get back with a report.

jaccoh commented 1 year ago

I've not been able to fool it anymore. Gate closes even after some car stood 10 min in front of the sensor!

runely commented 1 year ago

That's good. Then I will go ahead and release the version to Homey App Store