I am now stuck for multiple hours at implementing a very easy component (AutoRemote/ Tasker) and I feel as tho with just a little bit more information in the docs, this can be avoided - not just for me but for any other newcomer.
Where can I find more examples or tutorials on how to create custom components? I found 2 examples in the official docs, which didn’t even cover everything (like, when are subfolders within custom_components necessary? what exactly goes into the config? what about file permissions and ownerships?)
I created hello_state.py
and put it into the custom_components folder.
Content of my hello_state.py
:
DOMAIN = 'hello_state'
import requests
requests.get('https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxmessage=SayOn')
return True
In my config I added:
hello_state:
But nothing shows up in my services. I also tried an example code, with no success as well:
DOMAIN = 'hello_state'
def setup(hass, config):
hass.states.set('hello.world', 'Paulus')
return True
What am I doing wrong?
I hope this doesn’t come across as bitching or complaining, I simply feel like a lot of issues I’ve had (and still have), could have been very easily avoided with just a few more sentences or examples in the docs, targeted at newbies. It’s often those little things that go without saying for someone who has experience, but for a newbie, it will often take MANY hours to find out what’s missing.
Obviously, you gotta draw the line somewhere… if someone never touched a computer in their life, it wouldn’t be feasible to start from absolute 0 and hold their hand through the most simple steps. But I assume a lot of folks here (like me) do have some grasp of technology and maybe even coding (I’m ok at PHP and HTML). Those people will be heavily discouraged by the lack of “this goes without saying”-type information.