Originally this document was well written. Out of curiosity I passed it to GPT to see if it could clean it up slightly. It did such a terrible job I wondered what an intentionally bad revision would look like. It was too good not to use.
๐Hey there, fellow light enthusiast!๐ Step right up and get a dose of the shiniest, flashiest, and absolutely โจfabulousโจ program that I've whipped up to pimp out my smart lights using Home Assistant! ๐ ๐ค
-
mojodojo_flux: ๐โก๏ธ๐ Ever thought, "Hey, wouldn't it be totes rad if my lights vibed with the sun?" Well, dream no more! ๐ From sunrise blushes to high noon blues, my lights stay lit๐ก (just like me on a Friday night) and dance their way to a snuggly red by midnight. It's like having a sunset party in your room, every day! ๐๐กโค๏ธ
-
mojodojo_party: ๐๐ Ever wondered what magenta and cyan have in common? Me neither! But guess what, they're the VIPs at this party! Bounce between these two shades and let the party inside you awaken! (Warning: May bring out your inner disco star.โญ๏ธ)
I'm rocking an RGBWW light strip that's split into two personas: Mr. RGB (den.light_1
) and the always subtle Mrs. Dimmable (den.light_0
). If your lights have different names or vibes, give the code a little makeover! ๐๐
Now, go sprinkle some MojoDojo magic onto your lights! And if you find joy in this little creation of mine, send some virtual hugs! ๐ค๐ Stay luminous, peeps! ๐๐ฆ๐ฎ๐ ๐
Create config/config.secret.exs
with the following
import Config
config :mojodojo,
ha_key:
"the home assistant api key you generated",
ha_endpoint: "the ip of the computer you're running this from",
api_key: "output of mix phx.gen.secret"
config :mojodojo, MojodojoWeb.Endpoint,
secret_key_base: "output of mix phx.gen.secret"
Go in your Home Assistant configuration.yaml and configure the following. It's important to change the Authorization to "Bearer " + whatever your mojodojo :api_key
value is.
switch:
- platform: rest
name: mojodojo_flux
resource: http://localhost:4000/api/v1/flux
body_on: '{"service": "turn_on"}'
body_off: '{"service": "turn_off"}'
is_on_template: "{{ value_json.is_active }}"
headers:
Content-Type: application/json
Authorization: 'Bearer qwerty123_api_key_here'
- platform: rest
name: mojodojo_party
resource: http://localhost:4000/api/v1/party
body_on: '{"service": "turn_on"}'
body_off: '{"service": "turn_off"}'
is_on_template: "{{ value_json.is_active }}"
headers:
Content-Type: application/json
Authorization: 'Bearer qwerty123_api_key_here'