Export all components to a text file

Is it possible to export all components I have within home assistant to a text file?

Just a list, for example

camera.lounge_cam
sensor.temp_lounge
sensor.humid_lounge
etc etc

Have you tried copying and pasting your < > tab? You may want to drop it into excel first as you are going to copy the attributes also. You should be able to paste from there and clean it up and then get it into a text file.

paste this into your dev tools/templates debug tool:

{% for state in states %}
{{ state.entity_id }}
{%- endfor -%}
14 Likes

If you need to get the info into another program, you can use python / api.

import homeassistant.remote as remote
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')

print('\n-- Available entities:')
entities = remote.get_states(api)
for entity in entities:
    print(entity)

https://home-assistant.io/developers/python_api/

1 Like

when I try this I get an error…

ImportError: No module named 'homeassistant'

You have to have homeassistant installed in the same place your running that python script. If you are in a virtual env on your pi, then make sure your in that enviroment before running the script.

You the OG!