====== Home assistant ====== https://www.awesome-ha.com/ [[https://community.home-assistant.io/t/how-to-make-my-custom-card-wider-in-the-lovelace/619582| config energy]]\\ https://wiki.ip2u.ru/smart-home#home_assistant - multiroom \\ ===== HA. install ===== :!: HAAS [[https://haade.fr/en/blog/easy-installation-home-assistant-os-armbian-cubietruck-2024#preparing-for-haos|HAOS install on armbian]] [[https://gadget-freakz.com/the-best-home-assistant-addons-and-repos-of-2023/|additional HAAS addons repository]] \\ :!: in docker [[https://sequr.be/blog/2022/09/home-assistant-container-part-3-mariadb-and-influxdb/|HA right docker]] [[https://dzen.ru/media/smart_home_russia/prevrascaem-android-tvpristavku-v-umnyi-dom-ustanovka-home-assistant-v-docker-na-armbianubuntu-627d44cd82ca89686a420693|old Smart home Russia HA on armbian in docker]] \\ :!: in proxmox [[https://www.derekseaman.com/2023/10/home-assistant-proxmox-ve-8-0-quick-start-guide-2.html|HA in proxmox 8 ]] \\ :!: in openwrt install HA on openwrt https://github.com/openlumi/homeassistant_on_openwrt ==== HA hardware ==== открываем домофон https://habr.com/ru/articles/533812/ \\ ==== HA configure tracking user on wifi==== https://www.home-assistant.io/integrations/ubus/ \\ Xiaomi - >>> Solution >>> I have create via ES-FileExplorer a file /config/wifi/mac.txt with the wish MAC-Adress with chmod 444 permissions and it works !!!! << ==== HA CCTV frigate / scrypted ==== https://docs.scrypted.app/installation.html -- scrypted install docker \\ https://www.homeautomationguy.io/blog/running-frigate-on-proxmox -- frigate install docker on proxmox\\ https://coral.googlesource.com/webcoral/ - TPU accelerator coral start \\ ===== HA. configue ===== example http://kvazis.link/hassos \\ icons https://pictogrammers.com/library/mdi/ https://mdi.bessarabov.com/icon/memory\\ ==== HA. Floor plan beauty ==== https://www.youtube.com/watch?v=MCNxgb0mrSA \\ ==== HA articles ==== https://sprut.ai/user/AlexAz/contents/articles \\ ===== HA mysql ===== ++++ Get stats of mysql - where data located| -- get count of state entity and count of history data SELECT states_meta.entity_id, COUNT(*), -- states.state, from_unixtime(MIN(IF(states.last_changed_ts IS NULL, states.last_updated_ts, states.last_changed_ts))) AS first_changed_ts, from_unixtime(Max(IF(states.last_changed_ts IS NULL, states.last_updated_ts, states.last_changed_ts))) AS last_changed_ts FROM states LEFT JOIN states_meta ON (states.metadata_id = states_meta.metadata_id) GROUP BY states_meta.entity_id ORDER BY 2 DESC LIMIT 10; -- size of all tables SELECT table_schema as `DB`, table_name AS `Table`,TABLE_ROWS, ROUND(((data_length + index_length) / 1024 / 1024), 2) `Size (MB)` FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC limit 10; -- optimize OPTIMIZE TABLE homeassistant.states; ++++ ===== HA - template ===== # home assistant - executing in day 24h 01h 24 10m 144 05m 288 01m 1440 05s 17280 01s 86400 {% set result = namespace(sensors=[]) %} {% set exclude = [] %} {% set hours = 1 %} {% for state in states.sensor | rejectattr('attributes.device_class', 'undefined') | selectattr('attributes.device_class', '==', 'timestamp') %} {{state}} {% if 'last_seen' in state.entity_id and not state.entity_id in exclude.entity_id and (states(state.entity_id) == 'unavailable' or ((as_timestamp(now()) - as_timestamp(states(state.entity_id))) > ((hours | int) * 60 * 60))) %} {% set result.sensors = result.sensors + [state.name | regex_replace(find=' last seen', replace='') ~ ' (' ~ relative_time(strptime(states(state.entity_id), '%Y-%m-%dT%H:%M:%S%z', 'unavailable')) ~ ')'] %} {% endif %} {% endfor %} {{ result.sensors | join(', ') }}