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

Can't close frunk or trunk with aftermarket kits #325

Open
iainswarts opened this issue Nov 2, 2022 · 4 comments
Open

Can't close frunk or trunk with aftermarket kits #325

iainswarts opened this issue Nov 2, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@iainswarts
Copy link

The CoverEntity.CLOSE is gated behind the _car.powered_lift_gate flag, in my case I've installed an aftermarket power trunk and frunk so I can no longer close either of them.

Can you add an option to override this somehow please?

Originally posted by @iainswarts in #307 (comment)

@alandtse alandtse added the enhancement New feature or request label Nov 3, 2022
@alexeiw123
Copy link

Ah good, this saves me creating the same issue!
Have rolled back to 2.4.4 for the time being so I can still open and close from my dashboard.

@alexeiw123
Copy link

alexeiw123 commented Nov 8, 2022

The CoverEntity.CLOSE is gated behind the _car.powered_lift_gate flag, in my case I've installed an aftermarket power trunk and frunk so I can no longer close either of them.

Can you add an option to override this somehow please?

Originally posted by @iainswarts in #307 (comment)

You could use this in the meantime in your configuration.yaml to add a trunk and frunk cover that works with third party installations (hannshow for me)

I haven't tested this exact code as I'm using a teslamate binary sensor for my value_template, as it seems to update faster. I think this should still work however.

cover:
  - platform: template
    covers:			  
  	<car>_trunk:
        device_class: door
        friendly_name: "<car> Trunk"
        unique_id: <car>_trunk_cover_api
        value_template: >-
          {{not(is_state_attr('sensor.<car>_vehicle_state_data_sensor','rt',0))}}
        open_cover:
          - service: tesla_custom.api
            data:
              command: ACTUATE_TRUNK
              parameters:
                path_vars:
                  vehicle_id: >-
                    {{ state_attr('binary_sensor.<car>_online', 'id') }}
                which_trunk: rear
                wake_if_asleep: true
        close_cover:
          - service: tesla_custom.api
            data:
              command: ACTUATE_TRUNK
              parameters:
                path_vars:
                  vehicle_id: >-
                    {{ state_attr('binary_sensor.<car>_online', 'id') }}
                which_trunk: rear
                wake_if_asleep: true
  	<car>_frunk:
        device_class: door
        friendly_name: "<car> Frunk"
        unique_id: <car>_bonnet_cover_api
        value_template: >-
          {{not(is_state_attr('sensor.<car>_vehicle_state_data_sensor','ft',0))}}
        open_cover:
          - service: tesla_custom.api
            data:
              command: ACTUATE_TRUNK
              parameters:
                path_vars:
                  vehicle_id: >-
                    {{ state_attr('binary_sensor.<car>_online', 'id') }}
                which_trunk: front
                wake_if_asleep: true
        close_cover:
          - service: tesla_custom.api
            data:
              command: ACTUATE_TRUNK
              parameters:
                path_vars:
                  vehicle_id: >-
                    {{ state_attr('binary_sensor.<car>_online', 'id') }}
                which_trunk: front
                wake_if_asleep: true

edit: a few entities have changed/removed since v3.x so you'd need to tweak the value template to return when the trunk/frunk is open.

@iainswarts
Copy link
Author

I took a much simpler approach (using EVOffer parts), I just opened up /config/custom_components/tesla_custom/cover.py in the File Editor and edited line 105 and 145 to be

        return CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE

and then restarted my HA and it worked just fine.

@alexeiw123
Copy link

Yes that's much more elegant! I guess that's the fix required for this integration really. Cover will work for me in the meantime :)

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

No branches or pull requests

3 participants