Start developing a component

I want to develop a generic interface to comunicate my raspberry pi to multiple arduinos via nrf24l01+.To gather data and send commands.
So i guess i need to create a component, but the demo does not work.

What am i doing wrong?

Thanks.

INFO:homeassistant.core:Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config,     message=The following components and platforms could not be set up:

     - hello_state

Please check your config., notification_id=invalid_config, service_call_id=140508500986960-2>


garfius@Verge:~$ cd eclipse-workspace/
garfius@Verge:~/eclipse-workspace$ cd Homeassistant/
garfius@Verge:~/eclipse-workspace/Homeassistant$ find | grep hive.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/binary_sensor/hive.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/climate/hive.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/hive.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/light/hive.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/sensor/hive.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/switch/hive.py
./homeassistantVenv/lib/python3.6/site-packages/wheel/archive.py
garfius@Verge:~/eclipse-workspace/Homeassistant$ find | grep hellostate.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/hellostate.py
garfius@Verge:~/eclipse-workspace/Homeassistant$ cat ./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/hellostate.py
DOMAIN = 'hello_state'

def setup(hass, config):
hass.states.set('hello.world', 'Paulus')

return True
garfius@Verge:~/eclipse-workspace/Homeassistant$

Might sound offtopic, but are you aware of https://www.mysensors.org ?

Did you add hello_state to your config?
Or did you modified the provided code and maybe added some configuration parameter?

components/hellostate.py <-> <config_dir>/custom_components/hello_state.py

Maybe it should be in the custom_components folder for dev, and not in the components folder?

Already got my own protocol, thanks.:wink:

Downloaded via pip within eclipse project, added hellostate.py as seen on the 1st post.

configuration.yaml a meaningful part?-->

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

#test module by garfius
hello_state:

# Weather prediction
sensor:
  - platform: yr

Start by following the development guide.

If you really want to develop on the production version, you need to use the custom_components folder.

The folder does not seem to exist. Otherwise, later i will try the link you posted.

Thanks

garfius@Verge:~/eclipse-workspace/Homeassistant$ find | grep custom
./homeassistantVenv/lib/python3.6/site-packages/hass_frontend_es5/custom-elements-es5-adapter.js
./homeassistantVenv/lib/python3.6/site-packages/hass_frontend_es5/custom-elements-es5-adapter.js.gz
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/__pycache__/panel_custom.cpython-36.pyc
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/config/__pycache__/customize.cpython-36.pyc
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/config/customize.py
./homeassistantVenv/lib/python3.6/site-packages/homeassistant/components/panel_custom.py
garfius@Verge:~/eclipse-workspace/Homeassistant$ find | grep custom

Yes, the folder need to be created.
And it need to be in your config folder, not in your installation folder.

1 Like