Everything has a beginning this is the beginning of the beginning of this page
-
Home Assistant controler
-
Tasmota - ESP82xx
-
AppDaemon
-
InfluxDB/MySQL
-
Grafana
-
BlueIris
-
TasmotaAdmin - for OTA multi devices
-
Yolo3 plugin for BlueIris — object detection reduce false alarm to zero even in night
-
dnsmasq
-
dnscrypt-proxy
-
tinyproxy
-
openvpn server/phone client for remote connectivity
-
Home water consumption/leakage detection. see wiki
-
Tasmota + Wemo d1
-
Sensor water sensor ev 1 litter
-
-
Air Conditioner automation (Electra /Israel)
-
Uses SonOff 4ch pro for cold switch on/off
-
-
Alarm: Converting old PIMA Alarm + xiaomi mii sensros to be new smart alarm inspired by konnected
-
Tasmota/Wemo d1/i2c 16 gpio
-
Could scale with gpio/cheaper
-
It uses Tasmota firmware
-
-
Media automation
-
Israel Boiler — keep the water always hot in specific temperature. see wiki
-
Tasmota +Sonoff TH16 + DS18b20 raw chip inside the mechanical termostat of the Boiler
-
-
Light — turn them automaticly using PIR
-
Tasmota + WemoD1 mini
-
-
Cameras — BlueIris as DVR + PIR using Object detection Yolo3
-
Weather based Irrigation see wiki
-
Tasmota +Sonoff 4CH Pro
-
48vAC Power
-
Taps to control the taps
-
Used for defining Tasmota sensors/switch/binary sensors
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)
Using this, you could define a sensor that saves Tasmota counter_id pulses info to none-volatile home assistance database. See discussion here 4681
- platform: tasmota
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
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 18703
switch:
- platform: tasmota
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
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.
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
Aggregate /accumulate using events the time something is working (e.g. time TV is on) per day/week/month. No need to query the database which is a slow operation
sensor:
- platform: accumulator
name: boiler_total_hours2
entity_id: switch.b0
state_on: 'on'
state_off: 'off'
Support older firmware versions (my home versions) of devices and support more than 8 connected clients to each devices (bug in hass). Have a way to disable the C7 as there is only one that can be connected
Using script to trigger tracker from tracking-dhcp use custom component to let hass known mqtt_dnsmasq.py to get the info from dnsmasq.sh
The objective is to irrigate base on actual weather data (no forcast). A simple model of leaky bucket from networking (policer) is used.
-
Rain will fill the bucket (up to maximum)
-
Evaporation reduce the bucket - there are many models for ev
The simplet Blaney-Criddle is used here (base on mean temperature and p - hours of daylight )
see BlaneyCriddle
-
Irrigation time is based on the bucket level at the time of irrigation time.
Irrigation time = (-bucket level) * max_tap_time (min)
After Irrigation the bucket is zeroed WBI works the same as your old system it just reduce the time when it it fits (e.g. rain, cold days etc)
Example:
Day | old value | evaporation (-) | rain Ev (+) | new value | desc |
---|---|---|---|---|---|
0 |
0 |
-200 |
+500 |
+300 |
rain of ~5mm total |
1 |
+300 |
-200 |
0 |
+100 |
no rain , no irrigation |
2 |
+100 |
-200 |
0 |
-100 |
can irrigate |
3 |
-100 |
-200 |
0 |
-300 |
can irrigate |
4* |
-300 |
-100 |
0 |
0 |
can irrigate — scheduled calculate the time |
Day | old value | evaporation (-) | rain Ev (+) | new value | desc |
---|---|---|---|---|---|
0 |
0 |
-300 |
0 |
-300 |
rain of ~5mm total |
1 |
-300 |
-300 |
0 |
-600 |
no rain , no irrigation |
2 |
-600 |
-300 |
0 |
-900 |
can irrigate |
3 |
-900 |
-300 |
0 |
-1200 |
can irrigate |
4* |
-1200 |
-300 |
0 |
0 |
can irrigate — scheduled calculate the time |
As you can see this simple model can tune the irrigation time dynamically base on the weather actual data (again, no forcast needed) The feedback/calculation is slow and done per day
wb_irrigation:
api_key: !secret openweathermap_key
rain_factor: 120
max_ev: 3750
min_ev: -1500.0
name: "wb_irrigation"
longitude: !secret accurate_longitude
latitude: !secret accurate_latitude
taps:
- name: p1
- name: p2
-
api_key: a free key to openweathermap.org
-
rain_factor: ev/mm factor
-
max_ev: the maximum of the bucket level. if a rainy day has an evaporation of ~150 ev. 3750 means that after a good rain we can stop irrigation for ~20 days
-
min_ev: the minimum of the bucket level. it is not possible to compensate for more than this ev
-
longitude,latitude for accurate value for irrigation
-
taps names. each will have a sensor with bucket calculation
It will define a few sensors with prefix of name_xx for rain/ev/bucket for each tap With the above example there would be wb_irrigation_p1 and wb_irrigation_p2 sensors one for each tap.
For the switch relay (turn on/off the water taps) Sonoff 4ch pro is used. In this example the two first channels are used
Rule1 on Power1#state==1 do RuleTimer1 1800 endon on Rules#Timer=1 do power1 off endon on Power1#state==0 do RuleTimer1 off endon
Rule2 on Power2#state==1 do RuleTimer2 2700 endon on Rules#Timer=2 do power2 off endon on Power2#state==0 do RuleTimer2 off endon
Rule1 on
Rule2 on
poweronstate 0
TelePeriod 60
SetOption36 20
The first tap is limited to 30min (if it is disconnected for some reason from the controller) and for tap 2 it is 45 min
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
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} }
boiler_automation:
module: heat_app
class: CBoilerAutomation
switch: switch.b0
temp: sensor.btemp0
input_automation: input_boolean.boiler_auto_enable
input_temp_min: input_number.boiler_temp_min
input_temp_max: input_number.boiler_temp_max
sensor_eff_power: variable.boiler_eff_power0
sensor_eff_solar: variable.boiler_eff_solar0
Keep the water in the bolier always hot. calculate some efficiency metrics
Input: Temperator of the water inside the bolier Output: Enable/Disable the heater
Rule1 on Power1#state==1 do RuleTimer1 7200 endon on Rules#Timer=1 do power off endon on Power1#state==0 do RuleTimer1 off endon
Rule1 on
poweronstate 0
TelePeriod 60
SetOption36 20
-
Rule1 The first rule make sure that if sonoff (TH16) disconnect from controler (wifi/broker is down/hass is down) the power won’t stay on for more than 2 hours
-
poweronstate 0 : if sonoff reset set power to off (rules won’t help here, beacuse rules trigger by change and not at boot)
-
SetOption36 20 : to disable boot loop
-
TelePeriod 60 : set notification each 1 min
see wiki for a full example
Monitor the water consumption, notify in case of irregularity like leakage, high bursts, not at home etc
Water meter: pulse every 1 liter, ev output iot: wemo d1,tasmota, counter
water_monitor:
module: heat_app
class: CWaterMonitor
sensor_water_total: sensor.water_total
sensor_water_leak_detector: variable.water_leak_detector
sensor_water_bursts: variable.water_bursts
watchdog_duration_min: 50
watchdog_leakage_ticks: 3
max_day: 2000
max_burst: 400
see wiki for a full example
The app is responsible to to turn on the taps in specific schedule.
The total time is calculated from the weather component (wb_irrigation see below).
In case the tap state is changed to ON (manually) the time is taken from the input and weather queue is not updated.+
It is possible to estimate how much littler is consumed by each tap using the global water input sensor (if exists)
See here for switch and sensor defenition for this app to work pkgs/irrigation.yaml.+ The app is located here CWBIrrigation.+
# irrigation app
wb_irrigation:
module: heat_app
class: CWBIrrigation
m_temp_celsius: 26 #fill from here https://www.holiday-weather.com/[your location]/averages/
m_temp_hours: 12 #fill from here https://www.holiday-weather.com/[your location]/averages/
enabled: input_boolean.wbi_enabled #disable irrigation # disable the irrigation
water_sensor: sensor.water_total_external_norm # read total water # optional to read water global sensor in litters
taps:
- name: p1 # the name of the tap
days: [1,3,5] # 1-7 1 for sunday, .. 7 for saturday
stime: "05:45:00" # time to start irrigating
m_week_duration_min: 60 # weakly total time in minutes at the hottest season
switch: switch.wbi_p1 # the switch for on/off - on the tap is open, off - close
manual_duration: input_number.wbi_p1_duration # the time in minuts for manual on/off
queue_sensor: sensor.wb_irrigation_p1 # the calculated queue/bucket sensor from wb_irrigation sensors
water_sensor: variable.wbi_water_p1 # calculated from input water_sensor tht total for this tap
- name: p2
days: [2,5]
stime: "05:00:00"
m_week_duration_min: 20
switch: switch.wbi_p2
manual_duration: input_number.wbi_p2_duration
queue_sensor: sensor.wb_irrigation_p2
water_sensor: variable.wbi_water_p2