Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Pedestrian Mode - DiscreteGateWithPedestrianPosition (io:DiscreteGateOpenerIOComponent) #597

Closed
1 task done
NicoLeOca opened this issue Oct 12, 2021 · 19 comments · Fixed by #598
Closed
1 task done
Labels
enhancement New feature or request

Comments

@NicoLeOca
Copy link

Did you read the instructions?

The request

Hi
I integrated an outdoor gate, aka DiscreteGateWithPedestrianPosition for Somfy.
This device provides a pedestrian position where only one of the 2 gate leaves is opened.
Would it be possible to add it into this integration.
I added the debug logs of this device discovery below.

FYI also, in case it helps
This gate has 3 static positions: closed (2 leaves closed), opened (2 leaves opened) and pedestrian (one leaf opened).
This gate authorize to go from one state to any other, with no issue.

Which gateway / hub do you use?

Tahoma Short Channel (Somfy Tahoma v1)

Device model (optional)

DiscreteGateWithPedestrianPosition

Device type (optional)

5102007G06

Additional information

2021-10-12 21:14:55 DEBUG (MainThread) [custom_components.tahoma] Added device (Device(attributes=States(_states=[State(name='core:FirmwareRevision', type=<DataType.STRING: 3>, value='5102007G06'), State(name='core:Manufacturer', type=<DataType.STRING: 3>, value='Somfy')]), available=True, enabled=True, label='Portail', deviceurl=io://****-****-5836/877679, controllable_name='io:DiscreteGateOpenerIOComponent', definition=Definition(commands=CommandDefinitions(_commands=[CommandDefinition(command_name='advancedRefresh', nparams=1), CommandDefinition(command_name='close', nparams=0), CommandDefinition(command_name='delayedStopIdentify', nparams=1), CommandDefinition(command_name='getName', nparams=0), CommandDefinition(command_name='identify', nparams=0), CommandDefinition(command_name='open', nparams=0), CommandDefinition(command_name='refreshPedestrianPosition', nparams=0), CommandDefinition(command_name='setName', nparams=1), CommandDefinition(command_name='setPedestrianPosition', nparams=0), CommandDefinition(command_name='startIdentify', nparams=0), CommandDefinition(command_name='stop', nparams=0), CommandDefinition(command_name='stopIdentify', nparams=0), CommandDefinition(command_name='wink', nparams=1), CommandDefinition(command_name='runManufacturerSettingsCommand', nparams=2), CommandDefinition(command_name='keepOneWayControllersAndDeleteNode', nparams=0), CommandDefinition(command_name='pairOneWayController', nparams=2), CommandDefinition(command_name='sendIOKey', nparams=0), CommandDefinition(command_name='setConfigState', nparams=1), CommandDefinition(command_name='unpairAllOneWayControllersAndDeleteNode', nparams=0), CommandDefinition(command_name='unpairAllOneWayControllers', nparams=0), CommandDefinition(command_name='unpairOneWayController', nparams=2)]), states=[StateDefinition(qualified_name='core:AdditionalStatusState', type='DataState', values=None), StateDefinition(qualified_name='core:DiscreteRSSILevelState', type='DiscreteState', values=['good', 'low', 'normal', 'verylow']), StateDefinition(qualified_name='core:ManufacturerSettingsState', type='DataState', values=None), StateDefinition(qualified_name='core:NameState', type='DataState', values=None), StateDefinition(qualified_name='core:OpenClosedPedestrianState', type='DiscreteState', values=['closed', 'open', 'pedestrian', 'unknown']), StateDefinition(qualified_name='core:PedestrianPositionState', type='ContinuousState', values=None), StateDefinition(qualified_name='core:PriorityLockTimerState', type='ContinuousState', values=None), StateDefinition(qualified_name='core:RSSILevelState', type='ContinuousState', values=None), StateDefinition(qualified_name='core:StatusState', type='DiscreteState', values=['available', 'unavailable']), StateDefinition(qualified_name='io:PriorityLockLevelState', type='DiscreteState', values=['comfortLevel1', 'comfortLevel2', 'comfortLevel3', 'comfortLevel4', 'environmentProtection', 'humanProtection', 'userLevel1', 'userLevel2']), StateDefinition(qualified_name='io:PriorityLockOriginatorState', type='DiscreteState', values=['LSC', 'SAAC', 'SFC', 'UPS', 'externalGateway', 'localUser', 'myself', 'rain', 'security', 'temperature', 'timer', 'user', 'wind'])], widget_name='DiscreteGateWithPedestrianPosition', ui_class='Gate', qualified_name='io:DiscreteGateOpenerIOComponent'), data_properties=None, widget='DiscreteGateWithPedestrianPosition', ui_class='Gate', states=States(_states=[State(name='core:NameState', type=<DataType.STRING: 3>, value='Portail'), State(name='core:PriorityLockTimerState', type=<DataType.INTEGER: 1>, value=0), State(name='core:OpenClosedPedestrianState', type=<DataType.STRING: 3>, value='closed'), State(name='core:StatusState', type=<DataType.STRING: 3>, value='available'), State(name='core:DiscreteRSSILevelState', type=<DataType.STRING: 3>, value='normal'), State(name='core:RSSILevelState', type=<DataType.FLOAT: 2>, value=48.0), State(name='core:PedestrianPositionState', type=<DataType.INTEGER: 1>, value=50)]), type=<ProductType.ACTUATOR: 1>, placeoid='ef8d47f2-6a89-4e19-b949-160d02c09a0c'))
@NicoLeOca NicoLeOca added the enhancement New feature or request label Oct 12, 2021
@tetienne
Copy link
Collaborator

Can you please download https://github.com/iMicknl/ha-tahoma/archive/refs/heads/enhancement/cover/pedestrian-position.zip, and replace the current custom component?

It should add a select to your gate device where you should be able to select opened, closed or pedestrian. There is also unknown, but it will trigger nothing. That’s a value Somfy can return.
Sadly, the state of the select will not be updated while #167 is not fixed.

@NicoLeOca
Copy link
Author

NicoLeOca commented Oct 12, 2021

Thank you @tetienne
I have the input_select. Selecting a different entry from the dropdown does not change anything.
However, the input_select gets changed when I action the gate via any other mean.

My debug logs do not give many hints

2021-10-12 22:54:32 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.019 seconds (success: True)
2021-10-12 22:55:02 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.034 seconds (success: True)
2021-10-12 22:55:32 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.035 seconds (success: True)
2021-10-12 22:56:02 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.041 seconds (success: True)
2021-10-12 22:56:32 DEBUG (MainThread) [custom_components.tahoma] Finished fetching device events data in 0.041 seconds (success: True)

Also, the icon of the main entity is open when it's supposed to be closed.
I am not sure how it was in the stable release.

@tetienne
Copy link
Collaborator

@NicoLeOca I didn’t touch the main entity. This issue and PR will just focus on the select.
Can you please download again the zip file, and try again? I made a little mistake with my previous try. I also change the suffix of this select to Position instead of State.

@NicoLeOca
Copy link
Author

Hi @tetienne
Thank you for your quick reaction.
The input_select entity works properly, thank you.
Would'nt it be more simple to integrate the pedestrian into the main entity as a button maybe?
At least, would it be possible to create a state reflecting the pedestrian, please? at the moment, the state in HA is open when it in pedestrian.

Also, there is an issue with the main entity. When my gate is closed, the state of the main entity is open, and so is the icon. Should I create a seperate bug report?

@tetienne
Copy link
Collaborator

tetienne commented Oct 14, 2021

Would'nt it be more simple to integrate the pedestrian into the main entity as a button maybe?

What do you mean? An entity within HA can be:
image

Are you talking about the UI? If yes, you can create a button card, where the tap action will call a service:

service: select.select_option
data:
  option: pedestrian
target:
  entity_id: select.my_gate_position

IMO as you can have 3 states for the same device, the select is the perfect entity.

main entity
What do you call main entity?

@NicoLeOca
Copy link
Author

You are right @tetienne
Sorry for being so demanding and thank you very much for this new feature

By main entity, I mean the cover entity

@tetienne
Copy link
Collaborator

tetienne commented Oct 16, 2021

@NicoLeOca Except the refresh issue I cannot tackle here, it's OK for you?

@NicoLeOca
Copy link
Author

@tetienne
The pedestrian mode works well so far.
Thank you

There remain a bug where the state is wrong when the gate is closed. the state shows open in HA, in the cover entity.
Should I create a seperate issue for this bug?

@tetienne
Copy link
Collaborator

@NicoLeOca yes please
but double check the issue does not already exist.

@NicoLeOca
Copy link
Author

Hi @tetienne
I updated this integration through HACS to the last version after having seen that this improvement was merged.
Your select entity was gone then.
I tried to delete the integration and reinstall from scratch but it doesn't fix anything.
Do you have an idea why?
Thanks

@iMicknl
Copy link
Owner

iMicknl commented Nov 8, 2021

@tetienne it could be that my recent change broke this.. However it should at least create a select entity, perhaps just with a different key.

@NicoLeOca do you see a select option when you go to the integration -> devices list.

@NicoLeOca
Copy link
Author

@iMicknl
no select entity/option appears anywhere I am afraid

@iMicknl
Copy link
Owner

iMicknl commented Nov 9, 2021

@NicoLeOca not sure what changed to be honest. Could you check if this one works: https://github.com/iMicknl/ha-tahoma/archive/refs/heads/feature/add_select_entity_siren.zip.

@NicoLeOca
Copy link
Author

@iMicknl
This one works fine! great job!

@NicoLeOca
Copy link
Author

Please note that you change the select name compared to the one created previously
From whatever.entity.state to whatever.entity.position

@iMicknl
Copy link
Owner

iMicknl commented Nov 10, 2021

Please note that you change the select name compared to the one created previously
From whatever.entity.state to whatever.entity.position

Maybe I accidentally changed the name. What would make more sense for that select entity? Using ‘Position’ or ‘State’?

@NicoLeOca
Copy link
Author

@iMicknl
position is fine thanks
(I was only pointing it out in case it would create issues)

@NicoLeOca
Copy link
Author

Hi @iMicknl
have you merged your fix into the master branch?

@iMicknl
Copy link
Owner

iMicknl commented Nov 16, 2021

The latest fix you tried isn't in yet, you can monitor it in #642.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants