[APP][Pro] Home Assistant - Community App

Thanks for answearing.

@RonnyW , may I ask you, is there some way how to add directly such ā€œlistboxā€ from HA ?

image

Thank you

Not in the GUI (App, WebApp) with dynamic content. Mode capabiities must be defined in the app with fixed entries. Thatā€™s why mist GUI selectors have standard HA values. If an integration uses custom values instead, you canā€™t use them in the app
Only possible way tonuse dynamic lists is as autocomplete field in flow cards - like already implemented for modes (vacuum, climate ā€¦).

1 Like

Hmm, thank you, not sure I understand but they are not dynamic.

I was hoping itā€™s possible like this ā€¦

Nevermind, thank you for answer! :+1:

Fan speed as list is deprecated. Percentage should be used instead (using the slider).

If there are mode lists in the app, then I took standard values from the HA classes to allow usage of standard lists in the GUI. In flows, the entity dependent list should be useable in autocomplete fields.

Thanks. I used FAN only as example how it can be implemented on Homey side, in HA itā€™s above (water heater modes - Antifreeze, Smart, Prog and Manual), which you said itā€™s Dynamic content and canā€™t be implemented. I just wasnā€™t sure if you understand, what I mean.

There is no generic systematic. It depends on HA entities, domains ans integrations.
But yes, thatā€™s the same for water heater.

The entity has a list of possible operations you can select one. This list can be different for different water heaters, but also it can be dependent on the mode.
Such mode lists can only be set in flow cards.

1 Like

If that could be set via flow, itā€™s OKay - I was assuming itā€™s no possible. Here I was rather speaking about ā€œvisualisationā€. Thank you anyway for follow-ups, I really appreciate !

update you mean
obrazek - can I do anything if the ā€œPresent modesā€ are not populated from HA ? In HA itā€™s entity called ā€œselect.water_heater_modeā€

Yeah, thatā€™s a good example of a bad implementation :grin:
The select entity is a standalone helper entity. The heater has surely added his own automation to listen on changes (like you would do in Homeynwith virtual devices and flows).
Itā€™s not part of the heater itself.

A workaround would be to use the generic app flow actions to call a HA service. With the entity ID and a service name for select domains it should be possible to change the preset mode via flows.

1 Like

ESPHomeā€¦

You mean this, right ?
obrazek

Thank youā€¦will try to play with that.

Yes, thatā€™s the right card.
You already selected your entity.
You will need one if these services. The data part shown kn the Yaml is needed as data JSON in the card.

Perhaps you need to check the IDs of your select list in HA developer tools.

1 Like

Hi all,

Iā€™m not able to realize two compound media_player attribute conversions :face_with_raised_eyebrow: :see_no_evil:
Iā€™d like to trim a string, returning the first 7 characters
Iā€™d like to convert a timestamp to a human readable time & date.

(And a future wish, to be able to load the entity_picture which is an external URL in the Homey compound device (class=speaker).
As there is no default capability for images, I donā€™t know how
Is it even possible atm?)

This is the attribute list:

Iā€™ve tried many, many things, but it doesnā€™t work:
  capabilitiesConverters:
    measure_generic.media_position_updated_at:
      from: (state) => { return as_timestamp(state) | timestamp_custom('%-H:%M %d-%m-%Y'); }
      to: (value) => { return value; }
    measure_generic.media_position_updated_at.2:
      from: (state) => { return (state.last_changed); }
      to: (value) => { return  value; }
    measure_generic.media_content_id:
     from: (state) => { return (state[0:7]); } # should return the 1st 7 chars
     to: (value) => { return value; } 
I used this as a start from a working conversion
#  capabilitiesConverters:
#    measure_power:
#      from: (state) => { return parseFloat(state) * 0.001; }
#      to: (value) => { return value / 1000; }

Hi Peter,

with your first 2 questions I can help after my holidays.
You have to deal with find method to find a string or extract the substring if itā€™s every time the same Ć¼ositio. with subtring function.
Itā€™s easier to try this if you donā€™t use compound device but use the add entity / change entity function instead. This will update the device directly after hitting the change button without HA restart.

Your 3th question:
What device should show the image? The media device is using local or remote url to show the image. But if there is another integration thatā€™s not using HAs default attributes itā€™s possible thatā€™s nor working.

Hi Ronny,

No rush,
I tried the add/change entity of course, but it doesnā€™t list any ā€˜media_playerā€™ capabilities. Also looking for ā€˜heosā€™ doesnā€™t return results.
Screenshot from 2023-04-23 01-21-02

So I went to use the compound for this.
Background,
I like to enable a second receiver only when Spotify is playing.
The heos mediaplayer integration is the only device which shows Sfy in text and as a numeric code, which I can use in AND flow cards. (The Homey apps Marantz/Sfy donā€™t have that value available).

Well, that works now, but I got carried away about ā€œjustā€ adjusting the string and the timestamp.
For the timestamp I used a template sensor in the end, but that also doesnā€™t work yet.

While the album art is available as external link, I thought, when I set the device class to ā€˜Speakerā€™ I maybe can show the art in the device as well.
But that might be not as simple and for me no need to spend time on.

Ah, yes. As custom entities only simple domains are supported (sensor, button, switch). And only state and no attribute. So you are right with compound.
I just think about making it possible to insert any entity with attributes (without autocomplete hint - that will make the list too long) and reading its value like itā€™s done in compound, and write it into a target capability.
So you would have to set attribut and capability by yourself but can use the adhoc update for converters.

And you canā€™t set an album art only with a capability. You have to do it with SDK functions inside the device.
I could add an flow card to set an external url as album art source for you main media player to show the image from the second one. But then you still need a dummy compound device to have a capability with the url.

1 Like

Thx for looking into it, Ronny.
I just read about a sensor template for attributes, that makes life (and converting values) easier.

So, now these values are ā€˜humanizedā€™

  • media_content_id: spotify:track:3xmi6xxxxxxxxxxxxxxx
  • media_position_updated_at: 2023-04-23T11:50:04.814895+00:00

to these values

yaml
sensor:
  - platform: template
    sensors:
      # Used for converting some Marantz Heos values
      heos_media_play_position_update_timestamp:
        friendly_name: "HEOS media position update timestamp"
        value_template: >
          {{ as_timestamp(state_attr('media_player.marantz_sr5012_heos', 
          'media_position_updated_at')) 
          | timestamp_custom('%-H:%M:%S %d-%m-%Y') }}

      heos_content_id_stripped_for_spotify:
        friendly_name: "HEOS ContentID stripped for Spotify"
        value_template: >
          {{ state_attr('media_player.marantz_sr5012_heos', 
          'media_content_id')[0:7] }}

The album art is nice to have, but too messy imho, so for me, you may forget about it :upside_down_face:

Thank you Ronny. Iā€™m quite new with HA so Iā€™m not 100% sure what do you mean but trying to understandā€¦ seems that this is the entity details I need

obrazek

ā€¦but trying to set it in any form, failsā€¦

obrazek

I ave tried different DATA options - {ā€œoptionsā€: ā€œMANUALā€} , ā€œMANUALā€, MANUAL etc. but nothing works. ā€¦ what do it miss ?

I was testing a bit, and had similar error msgs. You were so close though :wink:

This is my test device, a thermostat.
I tried the data part of the flow card with {"hvac_modes":"off"} but it results in those errors ā€˜extra keys not allowed @ ā€¦ā€™

Screenshot from 2023-04-23 21-42-35

What was the issue in my case:

To check things, I made an automation action card for climate.set_hvac_mode and viewed the YAML afterwards:
Screenshot from 2023-04-23 21-24-21

Yup, hvac_mode is written without the trailing ā€˜sā€™ :face_with_spiral_eyes:
Screenshot from 2023-04-23 21-33-23

Iā€™d love to hear if it works for you with {"option":"MANUAL"}
2 Likes

@Peter_Kawa @Sharkys
Sorry for late answer. Peters answer should be the solution.

options = list of possible options.
option or state (depents whether itā€™s the entities state or an attribute) = selected option.

Like in linked service description for the select entity.

But @Sharkys, you inserted the entity (select.water_heater_mode) and the data (should be ā€œoptionā€), but your service is wrong. It must be the service from the ā€œselectā€ domain ā€œselect.select_optionā€ (see screenshot).

1 Like

@RonnyW thanks for pointing me to the ā€œserviceā€, now I actually understand what ā€œserviceā€ in HA is :wink:
@Peter_Kawa , ā€œsā€ ! like in your case but for option :laughing: (and yes, the HA automation while checking created YAML helps!) :

image

image

Yes, it does (also tested in HA naturally and it reflects the state correctly.

image

Thank you @Peter_Kawa for help and naturally @RonnyW for help and for creating such nice app !

2 Likes