I wanted to share something I have been working on to make setting up scenes easier.
While I really like being able to specify every nuance of a scene, sometimes it is easier to set things up the way you want by eye, perhaps using native tools like the hue app, or HA tools to set and adjust specific colors and brightness, rather than making adjustments to a scene file and having to restart HA many times to get it right. To facilitate this, I have written a program called scenegen that will query HA for the current state of various devices and spit out a scene file suitable for pasting into configuration.yaml or standalone scene files.
If anyone wants to take a look and give me any feedback you can find it here:
Wow. Justā¦ wow! Almost overwhelmed with the functionality. This will be a HUGE time saver for guys like me who have scenes already set up in Wink or Hue that we can now call up and then capture for use and finessing in HA.
Iām definitely going to check this out as soon as I can get my new Pi and iBeacons set up.
Thanks for sharing your hard work with us. This looks well thought out and documented.
wow ā¦ i tried . but complaining
~/.homeassistant# ./scenegen.py http://192.168.2.203:8123 > my_new_scene.yaml
./scenegen.py: line 5: syntax error near unexpected token newline' ./scenegen.py: line 5: ā
but i dont know what is the API key is ā¦ i am not using any API key for my home assistance
Can you edit the text above to use codeblocks please? The quotes in the text are being munged by the forum and I am not sure exactly how to read the error message.
I am not sure quite what is happening though as line 5 is just an import statement. How did you download it?
I finally got around to trying this and got the following error. Iāve attached as a yaml file as the codeblock formatting in here is always extremely trying for me. If you have any tips on that as well (beside going from line to line and putting in spaces), Iād appreciate it.
OK, figured out my problem and Iām going to post what I found here for anyone new to thisā¦
Make sure you set the perms to 755. I did this when I set it up initially but just thought it bore mentioning for anyone new to the Pi.
I ran the example show in the readme exactly. Which was the whole problem; the example uses https:// but my setup is not SSL yet (this was actually one of the reasons I moved from WIndows to the Pi, to set up SSL with Letās Encryptā¦ but got sidetracked with other cool stuff. ) . So as soon as I realized this I correctly went http:// and immediately got the correct output.
I felt kinda dumb for not seeing this right away, but I thought I would post it for other Pi noobs like myself to help out. Sharing trumps ego.
Iām having some issues with this, but I am hoping that using the map option might help. I think my problem is that I am pulling the Hue lights from both the Wink Hub and the Hue Hub. Even though I have the Wink Hub lights hidden, Scenegen was using them instead of the proper lights and it resulted in colors that were completely off from what I expected. Iāll let you know how it works out with the map later on today.
Also if you get a chance could you fix the API password logic to account for special characters like ā!ā?