Cool. I’ll try that. Before I do… if it goes FUBAR, is there a way to restart HASS without just pulling the plug on the Pi if I don’t have access to the UI? SSH seems to be disabled.
print_entities_to_file:
alias: Print Entities To File
sequence:
- service: notify.entity_log
data:
message: "{% for state in states %}\n - {{- state.entity_id -}}\n{% endfor\
\ %}\n"
mode: single
Simply navigate to Dev tools>> Template and paste below
{% for state in states %}
- {{- state.entity_id -}}
^ {{- state.name -}}
{% endfor %}
The resukt will be shown at right side. You can copy paste into excel and use text to columns to split using ^ symbol for ID and Name and find replace to remove leading - on the entity. Boom - you will have a neat excel in less than a minute
With ssh set up its straightforward to access the entities from a terminal on your PC, at home I’m using Linux (Fedora) - any Linux would do. For example:
Thanks a lot for your script. It is working well. Quick question, is there a way to erase the Txt file before writing on it? Atm the script is appending data and for my purposes an erase/write process would be better.
The most cool way to get this overview. I just used File Editor to get the JSON. Before you can access it in the .config path you must configure File Editor to not hide files and folders with pattern .storage:
Added HA as networkdrive with Samba Share and pull the JSON directly into Excel, now i have a tableview in excel and its always uptodate.
Thanks for your tip where to find it
Edit:
To import this JSON data into Excel, follow these steps:
Open Excel: Start by opening Microsoft Excel.
Access Power Query:
Go to the “Data” tab.
Click on “Get Data” > “From File” > “From JSON”.
Navigate to where you’ve stored the JSON file and select it.
Transform Data (if necessary):
Excel will use Power Query to interpret the JSON file. Once loaded, Power Query Editor will open.
You may see the JSON organized into columns and rows. If the data is nested (like the “entities” array), you’ll need to expand this column by clicking the expand button next to the column header.
Choose the columns you wish to include or perform any transformations needed (like filtering, sorting, changing data types).
Load Data:
After setting up your data, click “Close & Load” to load the transformed data into an Excel worksheet.
Automatic Refresh Setup:
To set automatic data refreshes, go back to the “Data” tab.
Click on “Queries & Connections”.
Right-click your query in the side pane and select “Properties”.
In the “Query Properties” dialog, enable “Refresh data when opening the file”.
Optionally, set a refresh interval under “Refresh every X minutes” to update data at regular intervals.