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

Some entities (containing "%" character) no longer displaying after streamdeck update to 6.1.0.18521 #139

Closed
sethmayer opened this issue Mar 19, 2023 · 9 comments · Fixed by #168
Assignees
Labels
bug Something isn't working T-Shirt-Size: S

Comments

@sethmayer
Copy link

sethmayer commented Mar 19, 2023

Hi,

All of my other entities are working but weather seems to have broken.

Streamdeck 6.1.0.18521
Firmware 1.03.000
Home Assistant Streamdeck plugin 2.2.0
Home Assistant 2023.3.3
Frontend 20230309.0 - latest

image

@LuckyNils
Copy link

Same here. Weather and Phone Battery level dont work anymore. Anything else works (for example Battery Health)

@cgiesche
Copy link
Owner

Hmm, i can confirm. By why?!

@LuckyNils
Copy link

I found a pattern! All enteties/sensors that use "%" like battery levels of devices or humidity sensors also dont work. Seems to be related to the "%"-Sign

@arthurEspooner
Copy link

#114

@LuckyNils
Copy link

Well the Workaround works nicly for the Battery level with "{{state}} %" in line 3, but can somebody give me a template for the weather Button/Card(What needs to be in the curly Brackets)?

@cgiesche
Copy link
Owner

For weather, you could for example use this template:

{{state}}
{{temperature}}{{temperature_unit}} {{humidity}}%

In general, you can use any of the available attributes listed below the input field to customize your button:
image

@cgiesche cgiesche changed the title Weather entity no longer displaying after streamdeck update to 6.1.0.18521 Some entities (containing "%" character) no longer displaying after streamdeck update to 6.1.0.18521 Mar 29, 2023
@DarkPaladin3
Copy link

It is the % that messes it up. If the {{state}} has the number portion of the title and {{unit_of_measurement}} holds the "%" sign then you need to use the formatting below to get the "%" to show up.

{{state}} {{ unit_of_measurement | urlencode }}

If you don't have {{ unit_of_measurement }} then use,

{{state}} {{ "%" | urlencode }}

Hope that helps.

@lafaro
Copy link

lafaro commented Jul 10, 2023

I can confirm that the '%' character is maybe the issue.
Here are my cases where it doesn't work:

Problem:
All my humidity sensors are not displayed at the StreamDeck. Every other sensor works fine.
The issue is maybe the unit of measure, which is a "%" character and maybe needs to be escaped.

Example:
grafik
On the right you see the same humidity sensor as on the left, but on the left, I override the label using the "Enable custom labels" setting with the value {{state}}.

Steps to reproduce (Case 1):

  1. Setup a sensor with unit_of_measurement: %
  2. Try to add this sensor value with default settings to StreamDeck
  3. The value is not shown

Steps to reproduce (Case 2):

  1. Setup any sensor
  2. Activate the setting "Enable custom labels" and enter {{'%'}} or %
  3. The entered text "%" is not shown

Workaround:
Override, using cutom lablel with {{state}}{{ "%" | urlencode }}

@cgiesche cgiesche self-assigned this Jul 10, 2023
@cgiesche
Copy link
Owner

Hey lafaro,

i wonder why i did not try this before: urlencoding the string before adding it to the svg image i am generating fixes the bug. Thanks for the hint. I will implement this so the workaround is no longer needed.

@cgiesche cgiesche added bug Something isn't working T-Shirt-Size: S labels Jul 10, 2023
cgiesche added a commit that referenced this issue Jul 10, 2023
 fixed #139: UrlEncode whole text in SVG so no characters get lost or break the button.
@cgiesche cgiesche mentioned this issue Jul 10, 2023
cgiesche added a commit that referenced this issue Jul 10, 2023
fixed #139: UrlEncode whole text in SVG so no characters get lost or break the button.
cgiesche added a commit that referenced this issue Jul 10, 2023
closes #115: Added support for newline character in entity states.
fixed #139: UrlEncode whole text in SVG so no characters get lost or break the button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working T-Shirt-Size: S
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants