Home-assistant: Difference between revisions
mNo edit summary |
|||
(28 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Home assistant | |||
=HOWTOs= | |||
==Add rfxtrx device== | = Links = | ||
*https://www.home-assistant.io/integrations/light.rfxtrx/ | |||
*[https://www.home-assistant.io Homepage] | |||
*[https://www.home-assistant.io/docs/installation/virtualenv/ Installing in python virtual environment] (remember to pip install --upgrade pip first) | |||
*[https://github.com/geekofweek/homeassistant/ a lot of examples] | |||
*[https://www.home-assistant.io/cookbook/ Cookbook, more examples] | |||
*[https://www.awesome-ha.com/ Awesome Home Assistant] | |||
*[https://github.com/chipriley/lovelace-css-values CSS values/themes] | |||
*[https://analytics.home-assistant.io/ Usage analytics] | |||
== Home assistant and MQTT == | |||
*[https://www.home-assistant.io/integrations/mqtt/ https://www.home-assistant.io/integrations/mqtt/] | |||
==Automations == | |||
== Triggers == | |||
https://www.home-assistant.io/docs/automation/trigger | |||
On multiple triggers logical OR applies | |||
= Cards = | |||
*[https://github.com/resoai/TileBoard TileBoard] | |||
*[https://github.com/kalkih/mini-graph-card mini-graph-card] | |||
*[https://github.com/RomRider/apexcharts-card Apexcharts-card] | |||
= HOWTOs = | |||
== Add rfxtrx device == | |||
*[https://www.home-assistant.io/integrations/light.rfxtrx/ https://www.home-assistant.io/integrations/light.rfxtrx/] | |||
but when you don't see new switch. enable debugging in configuration.yaml: | but when you don't see new switch. enable debugging in configuration.yaml: | ||
logger: | logger: | ||
default: info | default: info | ||
Line 22: | Line 51: | ||
debug: true | debug: true | ||
and look for | and look for | ||
homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 1ed0732_3 Class: LightingDevice Sub: 0, Pkt_id: 0b10000101ed071303010f60) | homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 1ed0732_3 Class: LightingDevice Sub: 0, Pkt_id: 0b10000101ed071303010f60) | ||
and use the Pkt_id in your configuration: | and use the Pkt_id in your configuration: | ||
Line 32: | Line 63: | ||
name: myswitch1 | name: myswitch1 | ||
=FAQ= | == Including files in configuration.yaml == | ||
==Config error. See dev-info panel for details.== | |||
group: !include groups.yaml | |||
In groups.yaml: | |||
samplegroup: | |||
name: my.samplegroup | |||
entities: | |||
- binary_sensor.one | |||
- binary_sensor.two | |||
=== Automations === | |||
Using this line your automations get saved here | |||
automation: !include automations.yaml | |||
script: !include scripts.yaml | |||
=== templates === | |||
template: !include templates.yaml | |||
In templates.yaml: | |||
- binary_sensor: | |||
name: "Is closed" | |||
state: >- | |||
{{ is_state('binary_sensor.openclose_30','on') | |||
or is_state('binary_sensor.openclose_31','on') }} | |||
== Migration to mysql == | |||
*[https://www.srm.im/2017/06/11/home-assistant-migration-from-sqlite3-to-mariadb-mysql/ https://www.srm.im/2017/06/11/home-assistant-migration-from-sqlite3-to-mariadb-mysql/] | |||
| |||
| |||
| |||
| |||
= FAQ = | |||
== The device is disabled by Config entry. == | |||
Means disabled, just click on edit icon and enable it | |||
| |||
==This entity does not have a unique ID== | |||
probably means adding "entity_id: foo.bar" | |||
== Error during logbook entry retrieval == | |||
refresh browser | |||
| |||
== Binary sensors == | |||
=== Door open or closed === | |||
on = Open | |||
offf = Closed | |||
| |||
In a group: | |||
Open + Closed = Open | |||
| |||
| |||
== Platform configuration is deprecated == | |||
"platform" being used in configuration file, while the integration no longer needs that | |||
== Config error. See dev-info panel for details. == | |||
That's under "Developer tools" tab "Logs" | That's under "Developer tools" tab "Logs" | ||
| |||
| |||
== Upgrading home-assissant == | |||
For this is, as user hass: | For this is, as user hass: | ||
| |||
cd homeassistant | cd homeassistant | ||
#python -m venv . ?? | |||
source bin/activate | source bin/activate | ||
pip3 install --upgrade | pip3 install --upgrade homeassistant | ||
| |||
== Find new zigbee device via conbee/deconz == | |||
Assuming phoscon already found it: Got to Developer Tools->Services and enter | |||
deconz.device_refresh | deconz.device_refresh | ||
and then look in home-assistant.log for a lines like | and then look in home-assistant.log for a lines like | ||
INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.deconz entity: sensor.temperature_20 | INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.deconz entity: sensor.temperature_20 | ||
==Reload configuration.yml== | after a while it should also show up in Configuration->Entities (TIP: here change the Entity ID to something more useful) | ||
The name you give the device on the deconz interface will show up in HA under "'''Devices'''" | |||
== Reload configuration.yml == | |||
That's done by the "restart server", make sure to run "check configuration" first | That's done by the "restart server", make sure to run "check configuration" first | ||
===reload configuration from commandline=== | === reload configuration from commandline === | ||
hass --script check-config ?? | |||
hass --script check-config ?? | |||
== Unable to open database "home-assistant_v2.db": file is encrypted or is not a database == | |||
try | try | ||
sqlite3 home-assistant_v2.db | sqlite3 home-assistant_v2.db | ||
| |||
== Test templates == | |||
ansible localhost -m debug -a 'msg={{ "0.005" | float > 0.001 }}' | ansible localhost -m debug -a 'msg={{ "0.005" | float > 0.001 }}' | ||
| |||
== homeassistant.exceptions.HomeAssistantError: Entity id already exists == | |||
In at least one case restarting home-assistant fixed it (deconz sensor) | In at least one case restarting home-assistant fixed it (deconz sensor) | ||
=Terms and meanings (or my guesses at it)= | == Unable to open the Home Assistant UI in a browser. == | ||
==device== | |||
?? | |||
== AttributeError: module 'homeassistant.util.yaml.loader' has no attribute 'Secrets' == | |||
An integration needs upgrading | |||
== UI showing "restored" in red == | |||
was re-enabled but without data (yet?) | |||
| |||
== Frontend == | |||
=== Show badge only when condition met === | |||
style: | | |||
:host { | |||
display: {% if states('sensor.motion_living_battery') | float > 90 %} none; {% endif %} | |||
} | |||
= Terms and meanings (or my guesses at it) = | |||
== device == | |||
seems to exist only if discovered? | seems to exist only if discovered? | ||
== service == | |||
== entity == | |||
a gnome? | a gnome? | ||
==deconz== | | ||
===pydeconz.errors.Unauthorized: /lights/2/state unauthorized user=== | |||
== Platform == | |||
[https://developers.home-assistant.io/docs/creating_platform_index/ https://developers.home-assistant.io/docs/creating_platform_index/] | |||
| |||
== binary_sensor == | |||
[https://esphome.io/components/binary_sensor/homeassistant.html https://esphome.io/components/binary_sensor/homeassistant.html] | |||
== deconz == | |||
=== pydeconz.errors.Unauthorized: /lights/2/state unauthorized user === | |||
I found simply restarting home-assistant made this go away again | I found simply restarting home-assistant made this go away again | ||
= Customizing home-assistant = | |||
== Module card-mod == | |||
==Custom-UI |
Revision as of 16:02, 10 October 2021
Home assistant
Links
- Homepage
- Installing in python virtual environment (remember to pip install --upgrade pip first)
- a lot of examples
- Cookbook, more examples
- Awesome Home Assistant
Home assistant and MQTT
Automations
Triggers
https://www.home-assistant.io/docs/automation/trigger On multiple triggers logical OR applies
Cards
HOWTOs
Add rfxtrx device
but when you don't see new switch. enable debugging in configuration.yaml:
logger: default: info logs: homeassistant.components.rfxtrx: debug
rfxtrx: device: /dev/ttyUSB0-RFX433XL debug: true
and look for
homeassistant.components.rfxtrx] Receive RFXCOM event from (Device_id: 1ed0732_3 Class: LightingDevice Sub: 0, Pkt_id: 0b10000101ed071303010f60)
and use the Pkt_id in your configuration:
switch: platform: rfxtrx devices: 0b10000101ed071303010f60: name: myswitch1
Including files in configuration.yaml
group: !include groups.yaml
In groups.yaml:
samplegroup: name: my.samplegroup entities: - binary_sensor.one - binary_sensor.two
Automations
Using this line your automations get saved here
automation: !include automations.yaml
script: !include scripts.yaml
templates
template: !include templates.yaml
In templates.yaml:
- binary_sensor: name: "Is closed" state: >- {{ is_state('binary_sensor.openclose_30','on') or is_state('binary_sensor.openclose_31','on') }}
Migration to mysql
FAQ
The device is disabled by Config entry.
Means disabled, just click on edit icon and enable it
This entity does not have a unique ID
probably means adding "entity_id: foo.bar"
Error during logbook entry retrieval
refresh browser
Binary sensors
Door open or closed
on = Open
offf = Closed
In a group:
Open + Closed = Open
Platform configuration is deprecated
"platform" being used in configuration file, while the integration no longer needs that
Config error. See dev-info panel for details.
That's under "Developer tools" tab "Logs"
Upgrading home-assissant
For this is, as user hass:
cd homeassistant #python -m venv . ?? source bin/activate pip3 install --upgrade homeassistant
Find new zigbee device via conbee/deconz
Assuming phoscon already found it: Got to Developer Tools->Services and enter
deconz.device_refresh
and then look in home-assistant.log for a lines like
INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.deconz entity: sensor.temperature_20
after a while it should also show up in Configuration->Entities (TIP: here change the Entity ID to something more useful)
The name you give the device on the deconz interface will show up in HA under "Devices"
Reload configuration.yml
That's done by the "restart server", make sure to run "check configuration" first
reload configuration from commandline
hass --script check-config ??
Unable to open database "home-assistant_v2.db": file is encrypted or is not a database
try
sqlite3 home-assistant_v2.db
Test templates
ansible localhost -m debug -a 'msg=Template:"0.005"'
homeassistant.exceptions.HomeAssistantError: Entity id already exists
In at least one case restarting home-assistant fixed it (deconz sensor)
Unable to open the Home Assistant UI in a browser.
??
AttributeError: module 'homeassistant.util.yaml.loader' has no attribute 'Secrets'
An integration needs upgrading
UI showing "restored" in red
was re-enabled but without data (yet?)
Frontend
Show badge only when condition met
style: | :host { display: {% if states('sensor.motion_living_battery') | float > 90 %} none; {% endif %} }
Terms and meanings (or my guesses at it)
device
seems to exist only if discovered?
service
entity
a gnome?
Platform
https://developers.home-assistant.io/docs/creating_platform_index/
binary_sensor
https://esphome.io/components/binary_sensor/homeassistant.html
deconz
pydeconz.errors.Unauthorized: /lights/2/state unauthorized user
I found simply restarting home-assistant made this go away again
Customizing home-assistant
Module card-mod
==Custom-UI