Comments (19)
- current_position: 0
- position slider showing 0%
- scripts called per logs: Open
- actual state: curtain is fully opened
You have your scripts set up the other way around.
HA uses 100% for fully open state and 0% for fully closed state. So you have to set your scripts accordingly.
from home-assistant-custom-components-cover-rf-time-based.
Hmm, are you sure about that? Because then there'd be a disconnect in how the entity presents itself. When I swap the two scripts:
cover:
- platform: cover_rf_time_based
devices:
study_curtains:
name: Study curtains
travelling_time_up: 11
travelling_time_down: 11
open_script_entity_id: script.curtain_study_close
stop_script_entity_id: script.curtain_study_stop
close_script_entity_id: script.curtain_study_open
device_class: curtain
so that it is fully closed at 0% as you're suggesting, the reported state and button icons are now wrong.
The state reported by the entity at 0% is "open" (but the curtain is fully closed):
and vice versa, entity reports its "closed" for 100% (but the curtain is fully opened):
Plus, the two card buttons now do the opposite of what their respective icons indicate (the left one closes the curtain, the right one opens it):
Moreover, even if I swap the the two scripts as shown above, the position slider still invokes the opposite script (my original problem).
It sounds to me like the slider looks at the old position, the new position I moved it to, calculates what it needs to do, and then invokes the exact opposite script then it should (but for the right amount of time) to get to that point.
from home-assistant-custom-components-cover-rf-time-based.
I have 11 covers working perfectly here:
I think the RF commands or the Switch/Relays wiring for your curtains needs to be reversed.
from home-assistant-custom-components-cover-rf-time-based.
I see your point, but I can't imagine how this could be related to wiring, the scripts do exactly what the name implies (open script opens my curtains, close one closes them).
I did a bit of digging and it seems that curtains and shutters are treated differently:
Everything works perfectly for a curtain if I swap the two commands here:
https://github.com/nagyrobi/home-assistant-custom-components-cover-rf-time-based/blob/master/custom_components/cover_rf_time_based/cover.py#L331-L334
(i.e. line 332 = OPEN, line 334 = CLOSE)
So, it sounds like HA treats different types of devices differently in terms of what 0 vs 100 means in a somewhat confusing way.
from home-assistant-custom-components-cover-rf-time-based.
OK sorry I only use shutters. Don't know much about curtains and why does HA handle them differently.
from home-assistant-custom-components-cover-rf-time-based.
Curtain is a cover.
from home-assistant-custom-components-cover-rf-time-based.
Would it be possible to add some check into the code and swap the open/close logic inside set_position()
if it's a curtain?
from home-assistant-custom-components-cover-rf-time-based.
Only curtain is affected?
I could add a list with the cover classes which need reversing of the logic.
from home-assistant-custom-components-cover-rf-time-based.
I'm only using curtains, so that's the only one I've tested. I think a simple test for this is changing a device_class
of some device you already have configured to those from this list one by one, restart and see if at 0 position its reported as opened or closed.
Sorry, I'd test this myself, but having some unrelated HA issues after the last update that broke my restarts.
from home-assistant-custom-components-cover-rf-time-based.
I tried to look in HA code to see where the difference is but couldn't find it. If you could do the test for the list you mentioned (after you fix your HA), I'd implement something...
from home-assistant-custom-components-cover-rf-time-based.
Did you try the Show as functionality of HA?
Set up the cover as shutter (default, remove config line from yaml), restart HA and then using Lovelace set it to show as curtain (click the entity and then the cog icon top-right):
Result:
from home-assistant-custom-components-cover-rf-time-based.
Interesting. It does seem to work, but the Position now operates like with shutters (100% = open), which I'm starting to realize is probably why the HA folks decided to swap that for curtains. Position 100% being open is the opposite of what one would expect with a curtain by default.
Sorry, my bad, it still doesn't work - the exact same issue as originally, the Position is acting in the exact opposite way it should, only now the whole thing is a mirror image of what it used to be.
from home-assistant-custom-components-cover-rf-time-based.
There's a contradiction in your diagnosis.
If you set it to shutter, does it work as expected? Without your mod!
from home-assistant-custom-components-cover-rf-time-based.
I do have the same behaviour as @jandusek .
This is the starting point:
And this is the log when I'm moving the slider to the left, which should mean "open", but it's actually closing.
2022-08-10 13:34:28.516 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: async_set_cover_position: 72
2022-08-10 13:34:28.517 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: set_position
2022-08-10 13:34:28.517 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: set_position :: current_position: 100, new_position: 72
2022-08-10 13:34:28.517 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: start_auto_updater
2022-08-10 13:34:28.526 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: init _unsubscribe_auto_updater
2022-08-10 13:34:28.527 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: set_position :: command close_cover
2022-08-10 13:34:28.527 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: _async_handle_command :: DOWN
2022-08-10 13:34:28.970 DEBUG (MainThread) [custom_components.cover_rf_time_based.cover] Pergola Soggiorno Tenda Sud: auto_updater_hook
2022-08-10 13:34:28.989 INFO (MainThread) [homeassistant.components.camera] Setting up camera.generic
2022-08-10 13:34:29.050 INFO (MainThread) [homeassistant.components.script.pergola_soggiorno_tenda_sud_close] Pergola Soggiorno Tenda Sud Close: Running script sequence
2022-08-10 13:34:29.050 INFO (MainThread) [homeassistant.components.script.pergola_soggiorno_tenda_sud_close] Pergola Soggiorno Tenda Sud Close: Executing step call service
which is by design, line 331.
if position < current_position:
command = SERVICE_CLOSE_COVER
elif position > current_position:
command = SERVICE_OPEN_COVER
from home-assistant-custom-components-cover-rf-time-based.
I can't reproduce this, my covers work perfectly.
What kind of covers are yours? What's in the script?
from home-assistant-custom-components-cover-rf-time-based.
I'm not sure what's wrong. If I use
service: cover_rf_time_based.set_known_position
data:
entity_id: cover.pergola_cucina_tenda_est
confident: true
position: 0
position_type: current
Which is wrong, as the the position 0 should be closed
The UI is correct, accordingly to the state. You could only move up and the slider is to 0
If you move the slider to the right, you close the blind correctly
from home-assistant-custom-components-cover-rf-time-based.
Try updating to latest version. Maybe it's an issue related to a library version on your system?
from home-assistant-custom-components-cover-rf-time-based.
I've just update to the last version and it's showing the state correctly!
from home-assistant-custom-components-cover-rf-time-based.
Good news!
from home-assistant-custom-components-cover-rf-time-based.
Related Issues (20)
- Version Update doesn't maintain current location HOT 1
- Feature request HOT 2
- Please add the config variable unique_id HOT 4
- Adding cover to configuration.yaml cause KNX stop working HOT 2
- Feature Request + Questions HOT 1
- using cover object instead of scripts/switches HOT 3
- Any way to set default state after boot? HOT 2
- Warnings in HA 2021.12 beta HOT 1
- Interrupt previous send command (script) with new one. HOT 12
- move delay option in position calculation HOT 1
- position non linearity
- xknx SessionAuthenticate Error Home Assistant 2022.8.1 HOT 1
- Integration breaks built-in KNX integration HOT 6
- Delay current_position HOT 1
- cover_entity_id is an invalid option for cover.cover_rf_time_based HOT 1
- Please add support for TopDown - BottomUp shades
- Using cover_rf_time_based.set_known_position-servicewhile the curtain is moving the curtain fails to stop a the target location
- using cover_rf_time_based One device works prefectly other won't stop to set position
- Closing and opening states
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home-assistant-custom-components-cover-rf-time-based.