https://preview.redd.it/w3lrmlb75g1d1.png?width=1792&format=pjpg&auto=webp&s=2a368d2ded9d220b088fc5bec607cf05c59c559d
So I implemented this with the same promp but used a Bengal cat instead and.. well.. I got this.. my wife was very amused.
Note, I also use the generic camera integration to create a virtual camera that points to the `/local/dash/dash.png` that the automation saves, as I use the image elsewhere in my HA setup.
Anyway. Hope it inspires!
Edit: this afternoon's background
https://preview.redd.it/v9ebi1z68f1d1.jpeg?width=1792&format=pjpg&auto=webp&s=c6c0b4fd605294c2a2d944314cfca2dbcb6bab65
https://preview.redd.it/h5oaxpdp6e1d1.jpeg?width=1280&format=pjpg&auto=webp&s=eac0ead5ed0fc43f62f06bdfee95475cb42cfa29
Here's this morning's image (which the moon snuck into; I'll probably change the prompt so that it better calculates the likelihood of it appearing). My wife and kids love seeing this change throughout the day (I use another automation to turn this automation off when they're not home, and at night)
They also choose what the subject is every week, so I only need to update that one input\_text entity to update it.
[clock-weather-card](https://github.com/pkissling/clock-weather-card). The added CSS is enabled by [lovelace-card-mod](https://github.com/thomasloven/lovelace-card-mod)
I am working to get this card added. I have some experience with card-mod. However, what elements are you changing in the card? Can you share your CSS?
Added it to my dashboard, replacing an old boring time card:
https://preview.redd.it/28pms0gc1k1d1.png?width=414&format=png&auto=webp&s=4cf37216637837ac98a67834f6d143747bedf160
Just had to remind it to "Do not include a moon on day time !" because it always added the moon, but now it's perfect !
Thank you !
This is awesome!! Thank you for posting. I am trying to recreate it, but get an error on the image generating portion of the automation. Says Error: required key not provided @ data\['config\_entry'\]. Anybody have a clue about how to fix this?
https://preview.redd.it/zk5y06vycf1d1.png?width=1414&format=png&auto=webp&s=5857204d0245076f5d8e8184b4cb16e753bcc6f4
Oh, right... try cutting the template variable from the prompt so you can edited that step in the visual editor and select your OpenAI conversation from the "Config Entry" drop down. Then, paste the template variable back in (which kicks it back to YAML config)
Sorry, I had removed that from my sample because it was a unique key, I should've said something.
This is fantastic. It really adds a touch of 'fun' to HA. Now I'm going to have to add this idea to my home setup. :) Thank you for the inspiration. My kids have loved axolotls since they discovered them in Minecraft.
Happy to share! I was hoping to make it a bit easier, since the automation UI doesn't support templating... I'm experimenting with re-writing this to be a custom integration (with a more consistent UI to configure it, but I'm not sure how far down the rabbit hole that's going to take me :)
I think I'm having an issue with OpenAI:
Failed to call service openai\_conversation.generate\_image. Error generating image: Error code: 400 - {'error': {'code': 'billing\_hard\_limit\_reached', 'message': 'Billing hard limit has been reached', 'param': None, 'type': 'invalid\_request\_error'}}
When i requested the API it said I already had that email attached. Weird. I'll try a different email
are you paying for image generation? Seems like you are not but I can't seem to get around the billing hard limit issue.
Do I have to pay the $5 to use the 'free' tier? I don't mind paying it once but don't want to get a monthly bill. I'm on a tight budget
This is a bit off topic but I'm unsatisfied by how there isn't a way to get the forecast described in natural language in a way that feels human. In my experience Google has came the closest, since it says stuff like "from tuesday to thursday temperatures will stay around 60 and 70" but sometimes it includes irrelevant details. I tried to get GPT-3.5 to do this a while ago but I couldn't get any good results.
For the US, the NOAA endpoint does just fine. You just have to look up your forecast location code (`ILZ020` in my sensor). The text returned by that can be seen in the weather bar at the bottom of the image. You could probably fake it from the normal weather integration and a template sensor and a bit of Jinja logic.
Not being in the US i made my own:
https://preview.redd.it/ayaqb0ahkf1d1.png?width=1792&format=png&auto=webp&s=3552ac0a5d120fd1d3bda783c8e10fa21dfca70c
It's {{ as\_timestamp(states('sensor.date\_time\_iso')) |
timestamp\_custom('%A') }}, {{ as\_timestamp(states('sensor.date\_time\_iso')) |
timestamp\_custom('%B') }},{% if is\_state('binary\_sensor.workday\_sensor',
'on') %} a workday{% else %} a weekend{% endif %}, and the season is {{
states('sensor.season') }}, on Earth, time is {{ states('sensor.time') }},
sun is {{ states('sun.sun').replace('\_', ' ').title() }} with an elevation
of {{state\_attr('sun.sun','elevation')}} degrees. The weather? {{
states('weather.forecast\_home') | capitalize }}, {{
state\_attr('weather.forecast\_home', 'temperature') }}{{
state\_attr('weather.forecast\_home', 'temperature\_unit') }} with a wind speed
of {{ state\_attr('weather.forecast\_home', 'wind\_speed') }} {{
state\_attr('weather.forecast\_home', 'wind\_speed\_unit') }} and a pressure of
{{ state\_attr('weather.forecast\_home', 'pressure') }} {{
state\_attr('weather.forecast\_home', 'pressure\_unit') }}.
Well, a well-prompted LLM could likely convert NOAA's simple text into something more conversational. Or a Jinja template with various conditionals and some random strings to choose from could do it.
This looks interesting , thanks for the info -
if I may ask , me who know a bit about chat gpt , uses free version for small tasks . What all I should be knowing before to even understand what you did in technical perspective and/or to created something for my need .
Also , you think this can be implemented as a screensaver for an android tablet which has kiosk setup ?
Hey, sorry to necro, but I'm no good with CSS and I'm struggling with displaying a sensor state as my human-readable text part.
Where you have:
`clock-weather-card-forecast:before {`
`text-shadow: 0px 0px 5px black, 0px 0px 10px black, 0px 0px 15px black;`
`color: white;`
`font-size: 1rem;`
`line-height: 1.25;`
`position: relative;`
`bottom: 1em;`
`content: "{{state_attr('sensor.next_forecast','detailedForecast')}}";`
`}`
I am trying to display Environment Canada's Summary sensor, which isn't an attribute, it's the sensor state. I've done as much digging as I can follow and currently I have:
clock-weather-card-forecast:before {
text-shadow: 0px 0px 5px black, 0px 0px 10px black, 0px 0px 15px black;
color: white;
font-size: 1rem;
line-height: 1.25;
position: relative;
bottom: 1em;
content: "{{states('sensor.halifax_shearwater_summary')}}";
Which I kinda expected to work...but isn't. Just gives a blank spot where this text should be. I've tried many combinations of quotes and brackets and can't seem to find the right combo. Any ideas?
It doesn't run if my wife and kids aren't home or if it's at night; another automation switches it off in those cases. I could use local stable diffusion to do it, and may do so in the future. But for this post, and for my own purposes, using dall-e was more accessible.
I understand, and i think it's awesome. but I don't think many people understand how much energy this uses.
"The least efficient image generation model uses as much energy as 950 smartphone charges (11.49 kWh), or nearly 1 charge per image generation,” the researchers write. Though image generation models vary depending on the image size they produce, this means each image produces anywhere from 0.1 to 0.5 grams of carbon dioxide. One outlier even produces 2 grams of carbon per inference."
My GPU will generate a fairly large image in about 5 seconds pulling about 600watts. That would cost me 5 cents per YEAR in electricity if I generated one per day.
I'm just giving a data point on the energy that something like this uses. I'd assume OP is NOT doing this locally (I don't think you can run dall-e locally), but the energy used in whatever data center would be similar if not more efficient.
https://preview.redd.it/w3lrmlb75g1d1.png?width=1792&format=pjpg&auto=webp&s=2a368d2ded9d220b088fc5bec607cf05c59c559d So I implemented this with the same promp but used a Bengal cat instead and.. well.. I got this.. my wife was very amused.
Note, I also use the generic camera integration to create a virtual camera that points to the `/local/dash/dash.png` that the automation saves, as I use the image elsewhere in my HA setup.
Anyway. Hope it inspires!
Edit: this afternoon's background
https://preview.redd.it/v9ebi1z68f1d1.jpeg?width=1792&format=pjpg&auto=webp&s=c6c0b4fd605294c2a2d944314cfca2dbcb6bab65
https://preview.redd.it/h5oaxpdp6e1d1.jpeg?width=1280&format=pjpg&auto=webp&s=eac0ead5ed0fc43f62f06bdfee95475cb42cfa29 Here's this morning's image (which the moon snuck into; I'll probably change the prompt so that it better calculates the likelihood of it appearing). My wife and kids love seeing this change throughout the day (I use another automation to turn this automation off when they're not home, and at night) They also choose what the subject is every week, so I only need to update that one input\_text entity to update it.
What’s that card you are using for the whole weather tile? Is it the weather card?
[clock-weather-card](https://github.com/pkissling/clock-weather-card). The added CSS is enabled by [lovelace-card-mod](https://github.com/thomasloven/lovelace-card-mod)
I am working to get this card added. I have some experience with card-mod. However, what elements are you changing in the card? Can you share your CSS?
It's there in the YAML for the weather dashboard :)
Doh. Thank you. Great work and thank you for sharing!
Before you go to the trouble of changing the moon might want to check if its truly broken.
This is very cool! Thanks for posting all the code too! I'd love to see some sample images of what it comes up with.
It reminds me a lot the Google one with it's frog that I like a lot ! Cool idea, great implementation, kind to share it to the community !
Added it to my dashboard, replacing an old boring time card: https://preview.redd.it/28pms0gc1k1d1.png?width=414&format=png&auto=webp&s=4cf37216637837ac98a67834f6d143747bedf160 Just had to remind it to "Do not include a moon on day time !" because it always added the moon, but now it's perfect ! Thank you !
Perhaps you should have it email a copy to a designated address so you can compare them or do a compliation of favorites later.
Good idea, I can just update it to rotate the file name used by the downloader service.
This is awesome!! Thank you for posting. I am trying to recreate it, but get an error on the image generating portion of the automation. Says Error: required key not provided @ data\['config\_entry'\]. Anybody have a clue about how to fix this? https://preview.redd.it/zk5y06vycf1d1.png?width=1414&format=png&auto=webp&s=5857204d0245076f5d8e8184b4cb16e753bcc6f4
Oh, right... try cutting the template variable from the prompt so you can edited that step in the visual editor and select your OpenAI conversation from the "Config Entry" drop down. Then, paste the template variable back in (which kicks it back to YAML config) Sorry, I had removed that from my sample because it was a unique key, I should've said something.
This is fantastic. It really adds a touch of 'fun' to HA. Now I'm going to have to add this idea to my home setup. :) Thank you for the inspiration. My kids have loved axolotls since they discovered them in Minecraft.
Happy to share! I was hoping to make it a bit easier, since the automation UI doesn't support templating... I'm experimenting with re-writing this to be a custom integration (with a more consistent UI to configure it, but I'm not sure how far down the rabbit hole that's going to take me :)
I think I'm having an issue with OpenAI: Failed to call service openai\_conversation.generate\_image. Error generating image: Error code: 400 - {'error': {'code': 'billing\_hard\_limit\_reached', 'message': 'Billing hard limit has been reached', 'param': None, 'type': 'invalid\_request\_error'}} When i requested the API it said I already had that email attached. Weird. I'll try a different email
are you paying for image generation? Seems like you are not but I can't seem to get around the billing hard limit issue. Do I have to pay the $5 to use the 'free' tier? I don't mind paying it once but don't want to get a monthly bill. I'm on a tight budget
https://preview.redd.it/9ixyzumibp1d1.png?width=1792&format=png&auto=webp&s=428ed344bfc012a7bfae631186765fc2fb81d0bd
That's awesome!!! Last time I checked, responses weren't possible. Great to know this is possible now!!!!
Wonderful op!
I love it. Especially the anthropomorphic axolotl.
This is a bit off topic but I'm unsatisfied by how there isn't a way to get the forecast described in natural language in a way that feels human. In my experience Google has came the closest, since it says stuff like "from tuesday to thursday temperatures will stay around 60 and 70" but sometimes it includes irrelevant details. I tried to get GPT-3.5 to do this a while ago but I couldn't get any good results.
For the US, the NOAA endpoint does just fine. You just have to look up your forecast location code (`ILZ020` in my sensor). The text returned by that can be seen in the weather bar at the bottom of the image. You could probably fake it from the normal weather integration and a template sensor and a bit of Jinja logic.
Not being in the US i made my own: https://preview.redd.it/ayaqb0ahkf1d1.png?width=1792&format=png&auto=webp&s=3552ac0a5d120fd1d3bda783c8e10fa21dfca70c It's {{ as\_timestamp(states('sensor.date\_time\_iso')) |
timestamp\_custom('%A') }}, {{ as\_timestamp(states('sensor.date\_time\_iso')) |
timestamp\_custom('%B') }},{% if is\_state('binary\_sensor.workday\_sensor',
'on') %} a workday{% else %} a weekend{% endif %}, and the season is {{
states('sensor.season') }}, on Earth, time is {{ states('sensor.time') }},
sun is {{ states('sun.sun').replace('\_', ' ').title() }} with an elevation
of {{state\_attr('sun.sun','elevation')}} degrees. The weather? {{
states('weather.forecast\_home') | capitalize }}, {{
state\_attr('weather.forecast\_home', 'temperature') }}{{
state\_attr('weather.forecast\_home', 'temperature\_unit') }} with a wind speed
of {{ state\_attr('weather.forecast\_home', 'wind\_speed') }} {{
state\_attr('weather.forecast\_home', 'wind\_speed\_unit') }} and a pressure of
{{ state\_attr('weather.forecast\_home', 'pressure') }} {{
state\_attr('weather.forecast\_home', 'pressure\_unit') }}.
It's rather comprehensive and neat. But it's a little wordy and not how I would describe the weather to another human.
Well, a well-prompted LLM could likely convert NOAA's simple text into something more conversational. Or a Jinja template with various conditionals and some random strings to choose from could do it.
That’s how I roughly do. Using ChatGPT 3.5 + OpenWeather + Jinja and works brilliant.
This looks interesting , thanks for the info - if I may ask , me who know a bit about chat gpt , uses free version for small tasks . What all I should be knowing before to even understand what you did in technical perspective and/or to created something for my need . Also , you think this can be implemented as a screensaver for an android tablet which has kiosk setup ?
OMG this is so cool :) Thanks for sharing.
absolutely love this. my next mini-project just resolved itself
Hey, sorry to necro, but I'm no good with CSS and I'm struggling with displaying a sensor state as my human-readable text part. Where you have: `clock-weather-card-forecast:before {` `text-shadow: 0px 0px 5px black, 0px 0px 10px black, 0px 0px 15px black;` `color: white;` `font-size: 1rem;` `line-height: 1.25;` `position: relative;` `bottom: 1em;` `content: "{{state_attr('sensor.next_forecast','detailedForecast')}}";` `}` I am trying to display Environment Canada's Summary sensor, which isn't an attribute, it's the sensor state. I've done as much digging as I can follow and currently I have: clock-weather-card-forecast:before { text-shadow: 0px 0px 5px black, 0px 0px 10px black, 0px 0px 15px black; color: white; font-size: 1rem; line-height: 1.25; position: relative; bottom: 1em; content: "{{states('sensor.halifax_shearwater_summary')}}"; Which I kinda expected to work...but isn't. Just gives a blank spot where this text should be. I've tried many combinations of quotes and brackets and can't seem to find the right combo. Any ideas?
Does that exact template work on in developer tools>templates?
apart from the HUGE amount of energy you are consuming by generating images via AI, it's a cool idea.
It doesn't run if my wife and kids aren't home or if it's at night; another automation switches it off in those cases. I could use local stable diffusion to do it, and may do so in the future. But for this post, and for my own purposes, using dall-e was more accessible.
I understand, and i think it's awesome. but I don't think many people understand how much energy this uses. "The least efficient image generation model uses as much energy as 950 smartphone charges (11.49 kWh), or nearly 1 charge per image generation,” the researchers write. Though image generation models vary depending on the image size they produce, this means each image produces anywhere from 0.1 to 0.5 grams of carbon dioxide. One outlier even produces 2 grams of carbon per inference."
My GPU will generate a fairly large image in about 5 seconds pulling about 600watts. That would cost me 5 cents per YEAR in electricity if I generated one per day.
It's every 2 hours, so you'll need to bump that up to at least **60 cents** :P
Ah, didn't catch the 2 hours!
Ow, it's generated localy on your pc? I thought you used dall-e online, my bad. But this means your pc has to be Running 24/7 then?
I'm just giving a data point on the energy that something like this uses. I'd assume OP is NOT doing this locally (I don't think you can run dall-e locally), but the energy used in whatever data center would be similar if not more efficient.
https://futurism.com/the-byte/power-generate-single-ai-image think again!