hass icon indicating copy to clipboard operation
hass copied to clipboard

home assistant and appdaemon scripts and configuration file

== Home Assistant, Tasmota, AppDaemon, Custom Components

v1.0.x is based on two docker-compose files.

  • netdc for networking (dnsmasq,wireguard,dnscrypt)
  • main: for hass component (appd,influx,Grafana..)

=== Hardware Components

  1. Intel z83
  2. Almost any Tasmota hardware
  3. Xiaomi mii sesnors

=== Main components

  1. Home water consumption/leakage detection. see https://github.com/hhaim/hass/wiki/Monitor-water-consumption-and-more-with-Home-Assistant[wiki] ** Tasmota + Wemo d1
    ** Sensor link:https://www.revaho.nl/wp-content/uploads/Ch_11_Water_meters.pdf[water sensor ev 1 litter]
  2. Air Conditioner automation (Electra /Israel) ** Uses SonOff 4ch pro for cold switch on/off
  3. Alarm: Converting old PIMA Alarm + xiaomi mii sensros to be new smart alarm inspired by link:https://konnected.io/products/konnected-alarm-panel-wired-alarm-system-conversion-kit[konnected] ** Tasmota/Wemo d1/i2c 16 gpio
    ** Could scale with gpio/cheaper ** It uses Tasmota firmware
  4. Media automation
  5. Israel Boiler -- keep the water always hot in specific temperature. see https://github.com/hhaim/hass/wiki/Smart-solar-water-heating-using-Home-Assistant[wiki] ** Tasmota +Sonoff TH16 + DS18b20 raw chip inside the mechanical termostat of the Boiler
  6. Light -- turn them automaticly using PIR ** Tasmota + WemoD1 mini
  7. Cameras -- BlueIris as DVR + PIR using Object detection Yolo3
  8. Weather based Irrigation see link:https://github.com/hhaim/hass/wiki/Weather-based-irrigation[wiki] ** Tasmota +Sonoff 4CH Pro ** 48vAC Power
    ** Taps to control the taps

=== Home Assistant - custom components

Used for defining Tasmota sensors/switch/binary sensors

==== How to install custom components into your setup

Copy this project <config directory>/custom_components/ folder to your <config directory> directory make sure you are in sync with the the right version of hass (see above)

==== tasmota_counter (for Pulse counter/Water)

Using this, you could define a sensor that saves Tasmota counter_id pulses info to none-volatile home assistance database. See discussion here link:https://github.com/arendst/Sonoff-Tasmota/issues/4681[4681]

[source,bash]

  • platform: mytasmota name: water_total stopic: water_out
    id: 1
    max_valid_diff: 2000 unit_of_measurement: 'l' icon: mdi:water-pump expire_after: 300 value_template: "{{ (45497 + (value))|int }}"

stopic: the short topic. for example the full topic will be tele/*stopic*/SENSOR

counter_id: the id of the counter 1..4

max_valid_diff: maximum difference in 60 sec

==== mqtt_tasmota (Switch)

Define a switch in a simpler way. It just works

  • Always in sync with hass
  • No need Option59,
  • No need startup script command
  • No need to define LWT/Qos. Qos is 1

See discussion here link:https://github.com/home-assistant/home-assistant/issues/18703[18703]

[source,yaml]

switch: - platform: mytasmota name: HASS_DEVICE index: '1' stopic: SHORT_TOPIC

stopic: the short topic. for example the full topic will be tele/*stopic*/SENSOR e.g. tele/irrigation/SENSOR

name: e.g. wbi_p1 the switch.wbi_p1 the full name

==== tasmota_alarm MCP230xx

Define 16/8 binary sensors based on MCP230xx chipset in a simple way. This chip has two mqtt async responses(interrupt and status) and it is tedious to define all of them.

[source,yaml]

tasmota: devices: - name: HASS_NAME stopic: TOPIC binary_sensors: - name: door polar: true - name: vol polar: true - name: kitchen polar: true - name: backdoor polar: true

==== dnsmasq tracker

(does not work with docker-compose version) Using script to trigger tracker from link:https://jpmens.net/2013/10/21/tracking-dhcp-leases-with-dnsmasq/[tracking-dhcp] use custom component to let hass known link:custom_components/device_tracker/mqtt_dnsmasq.py[mqtt_dnsmasq.py] to get the info from link:linux_services/dnsmasq.sh[dnsmasq.sh]

==== Irrigation based on Weather actual data

see wiki

==== HeatApp app

A/C Type: Electra with SonOff 4ch for enable/disable, connected to CLK input (plan to reverse engineer modbus signal for better way controling this)

Keep the A/C at specific temperator, at specific days of the week

[source,yaml]

heater_ac1: module: heat_app class: HeatApp schedule: - { mode: a, start: { t: "17:10:00", d: 6}, end: { t: "17:11:00", d: 6} } - { mode: a, start: { t: "17:15:20", d: 6}, end: { t: "23:30:40", d: 6} } - { mode: a, start: { t: "08:00:00", d: 7}, end: { t: "13:30:00", d: 7} } - { mode: a, start: { t: "15:30:00", d: 7}, end: { t: "19:30:00", d: 7} }


==== CBoilerAutomation app

see wiki

==== CWaterMonitor app

see wiki

==== Weather base irrigation

see wiki