OK, better now, automation does not drop any errors and executes… but seems event: cannot be templated… Here is output from traces for this automation:
Executed: 8 July 2023, 20:00:06
Result:
event: '{{ trigger.entity_id }}_response'
event_data:
response: >-
Cantoma's self-titled album, Cantoma, is a captivating musical journey that
combines elements of world music, downtempo electronica, and Balearic beats.
Released in 2003, the album features intricate layers of lush
instrumentation, soothing melodies, and hypnotic rhythms. With its dreamy
and atmospheric soundscapes, Cantoma creates a serene and exotic ambiance
that transports listeners to faraway destinations. Each track on the album
is meticulously crafted, showcasing Cantoma's talent for blending organic
and electronic sounds seamlessly. From the enchanting vocals to the
intricate production, Cantoma's self-titled album is a timeless and
immersive musical experience.
It should contain event: media_player.player_name_response instead of event: {{ trigger.entity_id }}_response
Move the entity_id out of the event’s name and into the event’s data.
action:
- service: conversation.process
data:
agent_id: 9194fb3fee4a1e2220e2f47a524fce92
text: "Tell me about {{ artist }}'s album {{ album }} in less than 100 words"
response_variable: chatgpt
- event: chatgpt_response
event_data:
entity_id: "{{ trigger.entity_id }}"
response: "{{chatgpt.response.speech.plain.speech | trim | replace('\"','')}}"
Change the Event Trigger to listen for the “chatgpt_response” event and for a specific value of entity_id.
more in general I would really appreciate a separate topic where we can share ideas and implementations of the new functionality, which I must confess, is still very fuzzy for me.
I don’t have many of those conversation agents installed (only use the Cloud Agent, and GA connected too HA), as I feel those are not adding to the experience just yet and still meet at lot of “I am sorry, I don;t understand” (who’s afraid of AI here…)
Maybe the new responding services, that have been marketed as the next big thing without a lot of further suggestions to go, on can bridge that gap.
Hope someone with a good and useful real life example can open a Topic posting it, and have others follow suit so we can all benefit from it.
btw, can we filter the ever so present Shelly errors
i’am playing around with the new response from the Conversation: Process service.
I succesvol created a sensor to store a response from openai, except I cannot figure out how I can use sensor data.
For starters I’'am trying to make a random summary for in the morning with calendar events, weather and driving time to work, but I need the sensor data.
Do you mean - messages of some components cannot be filtered?
Too bad this is not mentioned in Docs.
Update: tested with other components (now and earlier) - no filtering. So this is not about just “loader”.
Need to check more.
Update: I see, for some components filtering works, for some - does not…
Well, anyway this is a good news for me)))
Although 95% of my filters do not work.
maybe bring this to a separate topic, because all of the filters work (can show what I use, but that might be considered spam here…), except the ‘Loader’ which probably isn’t even considered to be a ‘component’
could you please follow up on Taras earlier question too, and explains bit what brings about these triggers
It’s just that I am trying to figure out why and how, so even if this is a bit of a silly automation ( no offense meant ofc, but I dont think one would actually use this in HA as is currently, seems more of an experiment) Id still love to grasp the inner workings ;=)
@Marius in this specific case automation is triggered by change in album name attribute of media_player entity. In my later post you can find whole automation, so you can see triggers too. So nothing fancy. I’m just trying to recreate sort of roon web display finctionality; every time album is changed I ask ChatGPT for information about this album (interesting to read, as responces are varying over time and sometimes something interesting can be found. I’m not trying to use here any type of music service (something like IMDB for music) as I’d expect length of response to vary, but asking the right question to ChatGPT I can limit lenght of response to something I can fully fit onto screen (I’m actually planning to put Samsung The Frame next to my audio gear to display this). So might be not very functional automation per se, more designed to enrich listening experience and yet showing what H A can be used for Here is how it looks now:
Regarding other use cases; I just wanted to highlight that it is easy to retrieve long infomration string from internet (parsing json, scrapping web page etc), but storing of such data is not easy and requires some trickery, as in example we just went through. That’s why having possibility to use sort of input_text.set_attribute service and put very long text there would be huge simplification.
Thx, and yes this might actually be very nice and enriching indeed. I have to reconsider my initial perspective on that. Cool
And thx for your elaboration.
Might even have to install ChatGpt now…
w/o specifying http, https, ports etc - in case of locally stored images.
“Should” - means “from a noob user’s PoV”.
In all other places of HA we use either “/local/…” path or “http(s)://…” path when needed.
See no reason why the “image” entity is an exception.
that would have been a different approach indeed, not trying to filter logged messages, but set loglevel to a lower level (than my default warn) in the first place.
Doesn’t work though, all warnings are still logged. I fear it’s like I mentioned above, Loader is not the regular component, and can not be filtered/altered. I have that on authority of one of the core dev’s…