545 karma · joined November 14, 2010
Here's a snapshot of how it works in my office - bedroom and living room have similar setups and draw from the same colours:
https://ibb.co/ysxY3Lf https://ibb.co/9VgYVTb
And details on the setup in Node Red/Home Assistant: https://news.ycombinator.com/item?id=36018291
Prompt:
Happy to answer any questions if you hit a snag.
https://news.ycombinator.com/item?id=36018291
The flow is pretty simple in Node Red - render the prompt from Home Assistant and pass it to Chat GPT. The response from Chat GPT is parsed and sent back to Home Assistant in some "Helper" variables known as "input_number" and "input_text".
Once the values are in Home Assistant, it's pretty easy to change the colours of lights in an automation.
Here's an export and screenshot of the flow (these links will expire in 2 weeks):
I use a few custom "nodes" to make it easy to query and parse the response though:
* node-red-contrib-string
* node-red-contrib-custom-chatgpt
* node-red-contrib-home-assistant-websocket
On the Home Assistant side, you'll need to create some "Helpers" or "input_number" entities and an "input_text" entity for the reason.
Hopefully that helps you get up and running.
1. Every hour a Node Red flow runs 2. It generates a prompt using a Home Assistant Jinja template 3. The prompt is sent to Open AI 4. The response gets parsed from JSON and sent to Home Assistant's "input_number" entities 5. Lights in Home assistant pick up the state change and set the new colours
If you're keen, I can share the Node Red flow diagram (or JSON).
Where I see this working best is giving Chat GPT some context about the situation in your home and having it work out complex automation logic that can't be implemented through simple rules.
No code required (unless you count the prompt template).
Costs about $3/year in API quota.
Chat GPT is now our personal lighting DJ, giving us dynamic and interesting light combinations that respect our circadian rhythm.
Here's my prompt - the output of which feeds Home Assistant:
Set the hue for my home's lights using the HSL/HSB scale from 0-360 by providing a primary and complementary colour which considers the current situation. The HSL color spectrum ranges from 0 (red), 120 (green), to 240 (blue) and back to 360 (red). Lower values (0-60) represent warmer colors, while higher values (180-240) represent cooler colors. Middle values (60-180) are neutral.
Consider these factors in setting the primary hue (in order of importance):
1. Preferences throughout the day: - When about to wake: Reds, oranges or hot pinks - Approaching bedtime: Hot pinks or reds - During worktime: Blues, greens or yellows - Other times: Greens, yellows or oranges
2. Current activity: Bedtime
3. Sleep schedule: Bedtime 23:00, Wake-up time 07:00
4. Date & time: Sunday May 21, 05:40
5. Current primary hue: 10
6. Current complementary hue: 190
7. Weather: 13°C, wind speed 9 km/h, autumn
Respond in this format and provide a reason in <250 characters:
{"primary_hue": PRIMARY_HUE, "complementary_hue: COMPLEMENTARY_HUE, "reason": REASON }
The output looks like this:
{primary_hue: 10 complementary_hue: 190 reason: "Approaching bedtime and early hours of morning, so a warm and calming hue is needed. Complementary hue adjusted slightly to 195 to maintain balance."}
I'm guessing you don't cater to Australia.
Like that time Brave replaced links to a site with their own affiliate links? Yeah, I no longer trust them.
Bitcoin continues to thrive despite their bans.
As long as governments begin to accept Bitcoin, it becomes trivial to accept altcoins because they're often easily exchanged for Bitcoin.
It's quite common for us to rely on Snowplow as a source of truth, but use GA for quick exploration. Certain reports in GA are setup so nicely, like "navigation summary" and the more intuitive session definition for marketing. And while Snowplow is real time, there's no effective way to see the same reports as produced by GA.
Snowplow's JSON schema events and contexts give you complete flexibility to define a data model that suits your business. Combined with DBT and a BI tool, like Apache Superset, it's vastly more capable than Google Analytics. We have clients running Google Analytics 360 that can't do the stuff we're able to with Snowplow.