Thanks for answearing.
@RonnyW , may I ask you, is there some way how to add directly such ālistboxā from HA ?
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 ā¦).
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!
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.
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
- 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
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.
ESPHomeā¦
You mean this, right ?
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.
Hi all,
Iām not able to realize two compound media_player attribute conversions
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.
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.
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
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
ā¦but trying to set it in any form, failsā¦
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
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 @ ā¦ā
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:
Yup, hvac_mode
is written without the trailing āsā
Iād love to hear if it works for you with {"option":"MANUAL"}
@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).
@RonnyW thanks for pointing me to the āserviceā, now I actually understand what āserviceā in HA is
@Peter_Kawa , āsā ! like in your case but for option (and yes, the HA automation while checking created YAML helps!) :
Yes, it does (also tested in HA naturally and it reflects the state correctly.
Thank you @Peter_Kawa for help and naturally @RonnyW for help and for creating such nice app !