Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.37k stars 253 forks source link

`QUESTION` How do I prevent the media page opening, and override previous entity values with blank/hidden values? #1606

Closed amkurtis closed 8 months ago

amkurtis commented 8 months ago

Question

How do I clear previous values from the automation?

Additional Details

Thanks for all your work on a great project. I'm on 4.2 for blueprint/TFT/Esphome using esp-idf.

Two questions, maybe related:

a) Is there a way to prevent the media page coming up when I press a button, when there is no media entity in the hardware button config? b) How do I clear entities to make them hidden on the panel again?

When I was first playing I allocated a media player to the right button. I then instead allocated it to run a script set to trigger, rerun the blueprint/automation, and though the panel runs the script I'm still redirected to the media player (on a short-press). I've then updated it to toggle a light, and it again does this but also opens the media player page. I'd like to have it just do the action. But not sure if I've messed it up when I added the media player to start with or whether this is intended behaviour.

I also originally had a sensor shown in the entity one slot on the home page, but moved it to entity three. Though the entity one field is now clear in the automation and I've rerun it, the value still shows in entity one. So the value is duplicated in both one and three on the display. How do I clear them?

I'm not sure if I'm hitting a snag where previous values are sticky rather than cleared (hence the opening of the media page and the values staying until replaced with another non-empty value), or whether it's my inexperience with the blueprint.

Thanks again.

edwardtfn commented 8 months ago

This is not the intended behavior.

As I understood, you are clicking the x on the dropdown where the entity was previously selected, the entity disappears from that field, but it still being shown on the device even after a restart, is that correct? IMG_6680

Could you please click the 3-dot menu at the top right on the automation settings screen, then select to Edit in YAML, can you still find the media player entity assigned to some variable there?

IMG_6681

The variables related to the hardware buttons are left_button_entity and right_button_entity.

amkurtis commented 8 months ago

Hello

Yep that's right. I can't see media player still in the yaml:

alias: Kitchen NSPanel
description: ""
use_blueprint:
  path: Blackymas/nspanel_blueprint.yaml
  input:
    nspanel_name: 78f2d8545ea47ccb05b8849fd487521d
    date_format: "%A, %d/%m"
    weather_entity: weather.forecast_middle_lodgey
    home_value03: sensor.esphome_web_474b50_grid_power
    climate: climate.kitchen_panel_thermostat
    right_button_entity: light.outside_lights
    right_button_name: Outside lights
    domain_automation_button_action: trigger
    delay: 1
    left_button_entity: script.play_chill_lofi
    left_button_name: Bathroom Lofi

The above when run displays this, with the grid_power in both home_value03 and what I assume is home_value01 still, with the media player opening when pressing the right_button for the lights.

tempImagetG8Jma

tempImagelAJYza

edwardtfn commented 8 months ago

No chance that you have a second automation connected to this same panel?

amkurtis commented 8 months ago

No chance that you have a second automation connected to this same panel?

I'm so sorry - that's exactly what it was. I updated to the v4.2 blueprint and did not clock that the old one was there. Deleted the second automation, and that's fixed the anchored media player on the right button. There's already a warning re: multiple automations in the docs so this is my poor troubleshooting.

The home01 value was still present but stuck on the last value before I deleted the second automation. This cleared after a restart, so I assume is just Nextion caching the value.

Thanks for your help and the great project.

edwardtfn commented 8 months ago

I'm so sorry

No need to apologise, this happens. 🙂

Nice that you got to a solution. 😉