Need to access time sensor
alternatively, use now
template:
- trigger:
- platform: time_pattern
seconds: "/1"
sensor:
- name: time
state: "{{ now().strftime('%H:%M:%S') }}"
{{ now().strftime("%I:%M %p") }}
{{ as_timestamp(state_attr("device_tracker.android_9050f88e39898022", "last_time_reachable")) | timestamp_local }}
{##{{ state_attr("device_tracker.android_9050f88e39898022", "last_time_reachable").strftime('%H:%M:%S') }}##}
- condition: template
value_template: '"{{ now().timestamp()+300 < (as_timestamp(state_attr("device_tracker.android_9050f88e39898022", "last_time_reachable")) | float)
}}"'
Change attribute value via automation
https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/21
- id: automation 3
trigger:
platform: time_pattern
minutes: '/1'
action:
service: python_script.set_state
data_template:
entity_id: sensor.cold_water_rate
state: 42
http://192.168.178.52:8123/
create user
user: bora, pass: bora
select location
activate advanced mode under profile settings
install add ons
Samba share
username: homeassistant, password: bora, workgroup: WORKGROUP
add a new network location: \\192.168.178.52\config
file editor
duckdns
domains:
- habora.duckdns.org
token: 799093a4-0b34-454f-99cb-25a4637bf404
aliases: []
lets_encrypt:
accept_terms: true
algo: secp384r1
certfile: fullchain.pem
keyfile: privkey.pem
seconds: 300
MariaDB
databases:
- homeassistant
logins:
- username: homeassistant
password: password1234
- username: read_only_user
password: password1234
rights:
- username: homeassistant
database: homeassistant
- username: read_only_user
database: homeassistant
privileges:
- SELECT
recorder:
db_url: mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4
Nginx Proxy Manager
Open WebUI → admin@example.com / changeme
Hosts – Proxy Hosts → Add Proxy Host
Domain Names: habora.duckdns.org
Als Scheme wählt Ihr http, unter „Forward Hostname / IP“ tragt Ihr die IP eures Home Assistant ein. → 192.168.178.52
Bei Forward Port gebt Ihr den Port ein, unter dem euer Home Assistant erreichbar ist. (Standardmäßig ist das der Port 8123)
Aktiviert abschließend noch den Punkt „Websockets Support„.
Anschließend wechselt Ihr auf den Reiter SSL.
Hier wählt ihr unter „SSL Certificate“ den Eintrag „Request a new SSL Certificate“ um ein neues Zertifikat zu erstellen aus.
Aktiviert nun den Punkt „Force SSL„, tragt eine gültige Email-Adresse für eure Zertifikat ein und akzeptiert die Let’s Encrypt Bedingungen durch aktivieren der Option am unteren Rand der Dialog.
Bestätigt nun die Eingaben durch einen Klick auf „Save“ und wartet, bis der Vorgang abgeschlossen ist.
Dann werden im Hintergrund die Zertifikate von Let’s Encrypt generiert. Das kann einen Augenblick in Anspruch nehmen.
Das registrieren des Zertifikates funktioniert nur, wenn die eingetragene Domain auch auf eure externe IP zeigt, und die Ports 80 und 443 auf die Home Assistant IP weitergeleitet sind.

configuration.yaml
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- 172.30.33.0/24
- ::1
Let's Encrypt
domains:
- habora.duckdns.org
email: boraers@googlemail.com
keyfile: privkey.pem
certfile: fullchain.pem
challenge: http
dns: {}
add to configuration.aml
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
influxdb
no adaptation of configuration was needed
http://192.168.178.52:8123/hassio/ingress/a0d7b954_influxdb
create database: home_assistant
create user: homeassistant, pass: homeassistant, permissions: ALL
mosquitto
Logins:
- username: note4
password: note4
MQTT integration configuration:
127.0.0.1 ← not core-mosquitto
1883
note4
note4
MQTT protocol: 5
Grafana
env_vars:
- name: GF_SECURITY_ALLOW_EMBEDDING
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: Main Org.
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_DISABLE_LOGIN_FORM
value: "false"
SSL: false or true, depending on having ssl set up
Network:
3000
http://192.168.178.52:8123/hassio/ingress/a0d7b954_grafana
in web panel
add data source: InfluxDB
URL: http://a0d7b954-influxdb:8086
database, user, pass
Terminal and SSH
integrations
HACS
github credentials required
OpenWeatherMap
API Ke:
solarman
re-use old config files
automations
blueprints
bosch_shc
custom_components
group
images
python_scripts
www
alarm_control_panel.yaml
automations.yaml
climate.yaml
configuration.yaml
influxdb.yaml
mqtt.yaml
scenes.yaml
scripts.yaml
secrets.yaml
sensor.yaml
move to external SSD
che

{## Imitate available variables: ##}
{% set my_test_json = {
"temperature": 25,
"unit": "°C"
} %}
The temperature is {{ my_test_json.temperature }} {{ my_test_json.unit }}.
{% if is_state("sun.sun", "above_horizon") -%}
The sun rose {{ relative_time(states.sun.sun.last_changed) }} ago.
{%- else -%}
The sun will rise at {{ as_timestamp(state_attr("sun.sun", "next_rising")) | timestamp_local }}.
{%- endif %}
For loop example getting entity values in the weather domain:
{% for state in states.weather -%}
{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
{{ state.name | lower }} is {{state.state_with_unit}}
{%- endfor %}.
{% set tado_temp = states('sensor.tado_wohnzimmer_temperature')|float(20) %}
{% set room_temp = states('sensor.meter_plus_90b4_temperature')|float(20) %}
{% set current_offset = state_attr('climate.tado_wohnzimmer',
'offset_celsius') %}
{{ tado_temp|round(1) }}
{{ room_temp|round(1) }}
{{ current_offset|round(1) }}
{{ (-(tado_temp - room_temp) + current_offset)|round(1) }}
{{ (tado_temp - current_offset)|round(1) }}
{% set average_temp = 0 %}
{% set active_rooms = 0 %}
{% set temp_bedroom = states('sensor.radiator_thermostat_bedroom_temperature')|float(15) %}
{% set climate_bedroom = states('climate.room_climate_bedroom') %}
{% set temp_top = states('sensor.radiator_thermostat_child_top_temperature')|float(15) %}
{% set climate_top = states('climate.room_climate_child_s_room_1_top') %}
{% set temp_bottom = states('sensor.radiator_thermostat_bottom_temperature')|float(15) %}
{% set climate_bottom = states('climate.room_climate_child_s_room_2_botto') %}
{% if climate_bedroom not in ("unavailable", "unknown", "off") %}
{% set active_rooms = active_rooms + 1 %}
{% set average_temp = average_temp + temp_bedroom %}
{% endif %}
{{ average_temp/active_rooms|round(1) if active_rooms>0 else 77 }}
https://www.home-assistant.io/integrations/python_script
https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/5
Scripts are placed in a python_scripts folder under the configuration directory, in my case it is /home/homeassistant/.homeassistant/python_scripts. You then need to either restart Home Assistant or click RELOAD SCRIPTS under Configuration, General, Configuration Reloading.
For what it’s worth, I have been hunting for a solution to this problem and I finally decided to make a small script:
# python_scripts/set_state.py
#==================================================================================================
# python_scripts/set_state.py
#==================================================================================================
#--------------------------------------------------------------------------------------------------
# Set the state or other attributes for the entity specified in the Automation Action
#--------------------------------------------------------------------------------------------------
inputEntity = data.get('entity_id')
if inputEntity is None:
logger.warning("===== entity_id is required if you want to set something.")
else:
inputStateObject = hass.states.get(inputEntity)
inputState = inputStateObject.state
inputAttributesObject = inputStateObject.attributes.copy()
for item in data:
newAttribute = data.get(item)
logger.debug("===== item = {0}; value = {1}".format(item,newAttribute))
if item == 'entity_id':
continue # already handled
elif item == 'state':
inputState = newAttribute
else:
inputAttributesObject[item] = newAttribute
hass.states.set(inputEntity, inputState, inputAttributesObject)
With this script in place, the action could be:
action:
service: python_script.set_state
data_template:
entity_id: Binary_sensor.sensor1
state: ON
https://www.home-assistant.io/integrations/python_script#calling-services
Start by enabling the Python script and create the first script.
Add to configuration.yaml: python_script:
Create folder <config>/python_scripts
Create a file <config>/python_scripts/hello_world.py in the folder and give it this content:
# `data` is available as builtin and is a dictionary with the input data.
name = data.get("name", "world")
# `logger` and `time` are available as builtin without the need of explicit import.
logger.info("Hello {} at {}".format(name, time.time()))
Start Home Assistant to reload the script configuration.
Call your new python_script.hello_world service (with parameters) from the Services, using the YAML mode.
service: python_script.hello_world
data:
name: "Input-Text"
Running this script show absolutely no output on the screen, but it logs with level info. You must have the Logger enabled at least for level info.
Your confiuration.yaml should include something like this.
logger:
default: info
https://www.pieterbrinkman.com/2022/01/01/2022-update-flash-esphome-on-esp32-esp2866-nodemcu-board/
Install using esphome-flasher:
download compiled firmware: In the Install menu click Manual Download. The compilation will now start and the .bin file will download when ready.
Go to the esphome-flasher GitHub page and download the flasher for the OS you’re using. There is a esp home flash tool for macOS, Ubuntu and Windows :
https://github.com/esphome/esphome-flasher/releases
Connect your ESP board with USB to your laptop.
Open the flasher tool
Serial port: select COM port where the board is connected (there is probably only one option 😊).
Firmware: Browse to the location where you downloaded your compiled firmware and select your firmware.
Click Flash ESP and wait
The ESP will be flashed now, you can follow the progress in the console window. When finished writing the firmware the ESP will restart and connect to your WiFi.

The ESP will be ready after it states that it’s ready for Over-The-Air Updates and that he API server is ready.
Note: Step 1 and 2 have been changed with new UI and features in both Home Assistant and ESPHome. Read the updated article to flash ESPhome on your ESP32 / ESP2866 NodeMCU board and skip step 1 and 2 below.
3. Wire the PMS5003 Particular Matter sensor and DHT22 to the ESP board
Wiring the DHT sensor is straight forward.
Connect the GND to any free GND pin on the ESP
Connect the VSS to any free 3V3 pin on the ESP
Connect the DATA to D4 on the ESP
4. Configure ESPHome to read the measurements and supply them to Home Assistant
Now it’s time to expose the measurement values to Home Assistant.
Open ESPHome and click EDIT on your node. The ESPHome configuration editor will now show. Add the following configuration at the bottom of the configuration.
uart:
When ready, press the Upload button and ESPHome will flash the new firmware OTA. Wait till ready and you should be good to go. ===> this can be done wirelessl now
You can verify the new switch and interval by going to Home Assistant and open the device. You will see that it will have a Start Measuring switch. Enable the switch and notice that the measurements value start changing.
Wait a two minutes and notice that the switch will be turned on for 20 seconds and then turned off again.

Now add the some graph to your dashboard.
6. Add air quality measurements to Home Assistant
For viewing the measurements in my lovelace dashboard I used a custom card called mini-graph-card, this card can be easily installed using HACS. I used the following Lovelace configuration.
type: 'custom:mini-graph-card' name: Air quality inside icon: 'mdi:server' line_width: 2 animate: true hours_to_show: 24 points_per_hour: 1.5 entities: - entity: sensor.particulate_matter_1_0um_concentration name: 1 µm > - entity: sensor.particulate_matter_2_5um_concentration name: 2.5 µm > - entity: sensor.particulate_matter_10_0um_concentration name: 10 µm >
To create additional context I also use Luftdaten integration to get outside air quality measurements nearby. This way you could automate opening windows or triggering ventilation to get better quality air from outside.
Luftdaten is making the world a better place through community driven, open environmental data. The coverage within northern Europe is impressive.

Exposing both inside and outside air quality with a vertical stack card will provide a nice comparison view.

That’s it. Now it’s time to start measuring and learn more about the air quality in your house. Let me know if you have any questions and if you managed to make it work!
ESP32 NodeMCU Development Board
Artikel-Nr.: NMCU-ESP32
|
EAN: 4251266700609
DHT on breakout board with SMD resistors and LED was used → might need 10 kOhm resistor for bare DHT11
12 = GPIO12
VCC = 3.3V
GND = Gnd
esphome:
name: test-esp32nmcu
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "MI1DnjQWboPRECsx7PlLQS4BiR7SQQSpYczCuzpupS4="
ota:
password: "bb47b47929f02cd349e51eddd8602edb"
wifi:
#ssid: !secret wifi_ssid
#password: !secret wifi_password
#ssid: "FRITZ!Box Gastzugang"
#password: "zakihasalittlewiener"
ssid: "FRITZ!Box 7530 GD"
password: "78302839617779115068"
# Optional manual IP
manual_ip:
static_ip: 192.168.178.42
gateway: 192.168.178.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test-Esp32Nmcu Fallback Hotspot"
password: "pJDTx6ABN80C"
captive_portal:
sensor:
- platform: dht
pin: 12
temperature:
name: "Air quality meter Temperature"
humidity:
name: "Air quality meter Humidity"
update_interval: 10s
model: DHT11
see above
after some minutes, the ESP32 should appear under Integrations with the initiall assigned name



https://github.com/tschamm/boschshc-hass
shc11d14d
192.168.178.34
add a Network Location in Windows Explorer
WLAN: \\192.168.179.43\config → not working??
user: homeassistant
pass: bora
custom_components
images
tests
https://smarthomescene.com/guides/top-10-home-assistant-lovelace-themes/
If you have not enabled custom themes already, add this to your configuration.yaml file and reboot Home Assistant:
frontend:
create a dedicated account for gests:
user: Guest
pass: guest
open http://192.168.178.32:8123
https://community.home-assistant.io/t/configuring-a-real-guest-user-an-alternative-approach/455910
Hi, I’d like to share the way I approached the configuration of a guest user in my HA and how I worked around some well-known limitations, especially those related to the lack of a global sidebar / default dashboard configuration.
My requirements:
Guest user allowed to login only from the internal network
Only specific views available to the guest user
No need for the guest user to switch to a different dashboard once logged in
No unnecessary items to show up in the sidebar for the guest user (including logbook, media, history, etc)
Basically a sort of kiosk mode without using frontend hacks (https://github.com/maykar/kiosk-mode 2 is now deprecated, https://github.com/Villhellm/custom-sidebar is no more working in latest HA versions, https://github.com/galloween/custom-sidebar-v2 works only for admin users).
Requirement #1 is the simplest: just create a guest user with a simple password and toggle the Can only log in from the local network option.
Requirement #2 is also stright-forward: create a dashboard, add a View for the guest user, under Visibility allow the guest user only to access that view, disable the guest user to access any other view of the dashboard.
Requirement #3 is tricky. As we know there is no global default dashboard configuration, it is per-user / per-device.
This means the guest user, upon the first login, lands in the over-complicated Overview dashboard and should go in his profile to change the default dashboard. Not something I want them to do neither I want to do it on their behalf.
After reading tons of posts here, the simplest approach I found is to take control of the Overview dashboard (if I need the same content I can always create a brand new admin-only dashboard) and put all my views there (both for regular and guest users).
True, the name of the Overview dashboard cannot be change as well as the icon but at least in this way every user (guests or not), when logging in, will land to a dashboard populated with the contents I want.
Requirement #4 was also a challenge. As we know also the order in which the items show up in the sidebar and which one is hidden or not is per-user / per-device. The way I approched it was the following:
I migrated all my dashbaords into views in order to have a single dashboard only (the Overview one). This is not mandatory of course, just an implementation choice, to avoid taking care of the order in which dashbaords are listed in the sidebar
I disabled in my configuration Energy, Map and Media since not using them at all (Ref. How can I hide the Energy/Media/Map tabs from the sidebar? - #9 by petro 5) resulting in the entries to disappear from the sidebar. This required switching from default_config to a long list taken from Default Config - Home Assistant 1 and commeting out those not needed
For Logbook and History, which are something I need as an admin but don’t want the other users to access and see, I made them available for admin users only, opting for the approach described in Admin only access for Logbook and History menus - #44 by dan_mc 8. This required to copy the code of the two components from /usr/src/homeassistant/homeassistant/components or core/homeassistant/components at master · home-assistant/core · GitHub 3 into config/custom_components, add version to the manifest file and making the views admin-only in async_register_built_in_panel() as described in the other post. Of course maintenance of this could be time-consuming since theoretically the code should be updated upon each upgrade
In this way not only guest user but also any user on any deice, has no need to touch the sidebar, hide unnecessary entries or set a default dashboard
Hope can be helpful
Thanks
Example 1
http://nilhcem.com/iot/home-monitoring-with-mqtt-influxdb-grafana
Example 2
http://www.iotsharing.com/2021/01/building-smart-home-system-with-home.html
Example 3
https://luigi-saetta.medium.com/evolving-my-home-automation-setup-af0323097d51
https://luigi-saetta.medium.com/evolving-my-home-automation-2-e9b30c2eae54
Example 4
https://randomnerdtutorials.com/esp32-influxdb/
https://randomnerdtutorials.com/esp32-esp8266-sensor-bme280-influxdb/
ssh into rapi via PUTT:
https://randomnerdtutorials.com/esp32-mqtt-publish-subscribe-arduino-ide/
https://diyi0t.com/home-assistant-mqtt-tutorial/
https://community.home-assistant.io/t/publish-mqtt/324939/2
https://www.home-assistant.io/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/
https://www.youtube.com/watch?v=U8f5FcnKdyw
Example 5
https://www.dummylabs.com/post/2019-01-13-influxdb-part1/
https://philhawthorne.com/getting-started-with-grafana-influxdb-for-home-assistant/
https://philhawthorne.com/installing-home-assistant-io-on-a-synology-diskstation-nas/
https://www.youtube.com/watch?v=rdvyYRBU7CM
https://selmi.medium.com/home-assistant-in-docker-the-ultimate-setup-16d4669dcb7
https://philhawthorne.com/breaking-down-presence-detection-with-home-assistant/
https://philhawthorne.com/making-home-assistants-presence-detection-not-so-binary/
https://peyanski.com/home-assistant-external-data-disk/
Home Assistant Operating System supports storing most data on an external storage medium (e.g. USB attached SSD or HDD). This data disk contains not only user data but also most of the Home Assistant software as well (Core, Supervisor etc.). This means a fast data disk will make the system overall much faster.

The data disk feature can be used on an existing installation without losing data: The system will move existing data to the external data disk automatically. However, it is recommended to create and download a full Backup before proceeding!
All data on the target disk will be overwritten!
The storage capacity of the external data disk must be larger than the storage capacity of the existing (boot) disk.
If you have been using a data disk previously with Home Assistant Operating System, you need to use your host computer to delete all partitions before using it as a data disk again.
Connect the data disk to your system.
Go to Settings > System > Storage in the UI.
Press the three dots on the top right and choose “Move datadisk”
Select the data disk from the list of available devices.
Press “Move”.

To see the current data disk use:
$ ha os info
...
data_disk: /dev/mmcblk1p4
...
Sh
Copy
To get a list of potential targets which can be used by datadisk:
ha os datadisk list
Sh
Copy
To initiate the move to the new data disk use the move command:
ha os datadisk move /dev/sdx
Sh
Copy
The system will prepare the data disk and immediately reboot. The reboot will take 10 minutes or more depending on the speed of the new data disk; please be patient!
Using an USB attached SSD can draw quite some power. For instance on Raspberry Pi 3 the official Raspberry Pi power supply (PSU) only provides 2.5A which can be too tight. Use a more powerful power supply if you experience issues. Alternatively use a powered USB hub. Connect the Hub to one of the USB slots of your Raspberry Pi, and connect the SSD to the Hub. In this setup the power supply of the Hub will power the attached device(s).
https://community.home-assistant.io/t/save-db-on-usb-stick-drive-hassio/82144/24
https://mary.codes/blog/home_automation/running_home_assistant_from_an_external_hard_drive/
https://learn.adafruit.com/quickstart-rp2040-pico-with-wifi-and-circuitpython/internet-connect
https://www.tomshardware.com/how-to/send-and-receive-data-raspberry-pi-pico-w-mqtt
https://www.hackster.io/FrankDelporte/sending-sensor-data-from-raspberry-pi-pico-to-mqtt-445c97
BoraEr
ineedweather_90
Follow instruction here to create new App: https://www.home-assistant.io/integrations/accuweather
app: ha_weather
API key: GV0GKNtlJZNUHYZ5YNW6YGySLVVz0Huq
search location key: https://www.accuweather.com/en/browse-locations
Leinfelden: 2604235, https://www.accuweather.com/en/de/leinfelden/70771/weather-forecast/2604235
create a sensor from the weather attributes to plot the data:
https://community.home-assistant.io/t/how-to-extract-temperature-from-weather-card/143260/3
# Temperatur-Attribut als Extra-Wert
sensor
- platform: template
sensors:
norwegian_temperature:
friendly_name: "met.no Temperatur Vorhersage"
unit_of_measurement: '°C'
value_template: "{{ state_attr('weather.home_musberg', 'temperature') }}"
https://www.home-assistant.io/integrations/openweathermap/
BoraEr
ineedweather_90
https://community.home-assistant.io/t/animated-weather-icons/206736
https://github.com/wowgamr/animated-weather-card
https://community.home-assistant.io/t/influxdb-removing-or-deleting-data/292637
https://itobey.dev/index.php/read-external-influxdb-in-home-assistant-as-sensor/
https://smarthomescene.com/guides/optimize-your-home-assistant-database/
https://community.home-assistant.io/t/where-does-influx-store-db-files-in-hassio/105502
location of influxdb database: https://community.home-assistant.io/t/influxdb-location-of-database-on-hass-io/169916/15
https://siytek.com/home-assistant-remote/
https://community.home-assistant.io/t/how-to-configure-remote-access-with-lets-encrypt/391432
Duckdns.org
account boraers@googlemail.com
type free
token 799093a4-0b34-454f-99cb-25a4637bf404
Domain: https://habora.duckdns.org
attention: if router is restartet, configuration of duckdns has to be updated!
to be accessed via the HA app:
https://habora.duckdns.org:8123/
https://192.168.178.32:8123/
https://habora.duckdns.org
habora.duckdns.org
duckdns.org
domains:
- https://habora.duckdns.org
token: 799093a4-0b34-454f-99cb-25a4637bf404
aliases: []
lets_encrypt:
accept_terms: true
algo: secp384r1
certfile: fullchain.pem
keyfile: privkey.pem
seconds: 300
domains:
- habora.duckdns.org
email: boraers@googlemail.com
keyfile: privkey.pem
certfile: fullchain.pem
challenge: http
dns: {}




→ this can be done already from the internet
→ the login screen of HA should appear
edit configuration.yaml:
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
attention: different HA installation need other paths:
https://community.home-assistant.io/t/remote-access-for-home-assistant/206072
Home Assistant OS or Supervised: → Let's Encrypt addon must be installed!
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
Home Assistant Container:
You’ll need to mount the location with your SSL keys and certificates to /ssl/ in the container.
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
Home Assistant Core:
http:
ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem
ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem
after restart, HA should only be available via https:
internall: https://192.168.178.32:8123/
externall: https://habora.duckdns.org:8123/
Harden the Home Assistant remote access even more by enabling MFA
Activating ip_ban_option and Multi-factor Authentication Modules is a must if you enable your Home Assistant Remote Access in the way that i’m showing with the port forwarding and SSL. So don’t skip this!
https://www.youtube.com/watch?v=jblBRuW1lu4
https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7590/30_Dynamic-DNS-in-FRITZ-Box-einrichten/
Klicken Sie in der Benutzeroberfläche der FRITZ!Box auf "Internet".
Klicken Sie im Menü "Internet" auf "Freigaben".
Klicken Sie auf die Registerkarte "DynDNS".
Aktivieren Sie die Option "DynDNS benutzen".
Tragen Sie im Feld "Update-URL" die Update-URL für Ihren Anbieter ein. Falls die Aktualisierungsanforderung sowohl für IPv4 als auch für IPv6 durchgeführt werden soll und Ihr Anbieter für IPv4 und IPv6 verschiedene Update-URLs erwartet, tragen Sie beide Update-URLs mit einem Leerzeichen getrennt ein.
Hinweis:Beispiele für Update-URLs verschiedener Anbieter finden Sie unten in dieser Anleitung. Falls Ihr Anbieter da nicht genannt wird, können Sie die Update-URL wie im Abschnitt "Update-URL selbst erstellen" beschrieben selbst erstellen.
Tragen Sie im Feld "Domainnamen" den Domainnamen ein, den Sie bei Ihrem Anbieter festgelegt haben.
Tragen Sie im Feld "Benutzername" den Benutzernamen Ihres Benutzerkontos beim Anbieter ein.
Tragen Sie im Feld "Kennwort" das Kennwort Ihres Benutzerkontos beim Anbieter ein.
Klicken Sie zum Speichern der Einstellungen auf "Übernehmen".
Jetzt übermittelt die FRITZ!Box nach dem Herstellen jeder Internetverbindung ihre jeweils aktuellen IP-Adressen an den Anbieter und ist somit immer unter ihrem individuellen Dynamic-DNS-Domainnamen erreichbar.
DuckDNS.org
Die Update-URL für die IPv4- und die IPv6-Adresse:
https://www.duckdns.org/update?domains=<domain>&token=<pass>&ip=<ipaddr>&ipv6=<ip6addr>
https://www.home-assistant.io/integrations/tts
https://community.home-assistant.io/t/tts-with-ssl-on/207875/3
DNS-Rebind-Schutz
filename: /Data/cams/{{ now().strftime("%Y-%m-%d %H.%M.%S") }} {{ entity_id.name }}.jpg
filename: ‘/tmp/armcrest_camera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg’
filename: '/home/homeassistant/.homeassistant/www/armcrest_camera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
filename: >-
/config/www/rtsp_esp32_{{ "%04d"|format(now().year) }}_{{
"%02d"|format(now().month) }}_{{ "%02d"|format(now().day)
}}_{{ "%02d"|format(now().hour) }}_{{ "%02d"|format(now().minute) }}_{{ "%02d"|format(now().second) }}.jpeg
https://www.home-assistant.io/examples/
Der folgende Eintrag muss in die configuration.yaml
waste_collection_schedule:
sources:
- name: ics
args:
file: "www/abfall.ics"
customize:
- type: Restabfall
alias: Restabfall
icon: mdi:trash-can
- type: Papiertonne
alias: Papiertonne
icon: mdi:trash-can
- type: Bioabfall
alias: Bioabfall
icon: mdi:trash-can
fetch_time: "04:00"
day_switch_time: "10:00"
sensor:
- platform: waste_collection_schedule
name: Papierabfall_date
value_template: '{{value.date.strftime("%d.%m.%Y")}}'
types:
- Papiertonne
- platform: waste_collection_schedule
name: Papierabfall_collection
value_template: "{{value.daysTo}}"
types:
- Papiertonne
- platform: waste_collection_schedule
name: Restmuelltonne_date
value_template: '{{value.date.strftime("%d.%m.%Y")}}'
types:
- Restabfall
- platform: waste_collection_schedule
name: Restmuelltonne_collection
value_template: "{{value.daysTo}}"
types:
- Restabfall
- platform: waste_collection_schedule
name: Biotonne_date
value_template: '{{value.date.strftime("%d.%m.%Y")}}'
types:
- Bioabfall
- platform: waste_collection_schedule
name: Biotonne_collection
value_template: "{{value.daysTo}}"
types:
- Bioabfall
- platform: waste_collection_schedule
name: next_waste_collection_daysto
details_format: upcoming
value_template: '{{value.types|join(", ")}} in {{value.daysTo}} Tagen'
#button-card#
- platform: waste_collection_schedule
name: MyButtonCardSensor
value_template: '{{value.types|join(", ")}}|{{value.daysTo}}|{{value.date.strftime("%d.%m.%Y")}}|{{value.date.strftime("%a")}}'
Folgende Integrationen aus dem HACS Store sind dafür notwendig:
custom-cards/button-card
custom:multiple-entity-row
type: entities
entities:
- entity: sensor.restmuelltonne_date
style: |
:host {
color: grey;
}
icon: 'mdi:delete-empty'
show_state: false
type: 'custom:multiple-entity-row'
name: Schwarze Tonne
secondary_info: last-changed
entities:
- entity: sensor.restmuelltonne_collection
name: Abholung in
unit: Tage(n)
- entity: sensor.restmuelltonne_date
name: Datum
- entity: sensor.biotonne_date
style: |
:host {
color: brown;
}
icon: 'mdi:bio'
show_state: false
type: 'custom:multiple-entity-row'
name: Braune Tonne
secondary_info: last-changed
entities:
- entity: sensor.biotonne_collection
name: Abholung in
unit: Tage(n)
- entity: sensor.biotonne_date
name: Datum
- entity: sensor.papierabfall_date
style: |
:host {
color: blue
}
icon: 'mdi:tree'
show_state: false
type: 'custom:multiple-entity-row'
name: Blaue Tonne
secondary_info: last-changed
entities:
- entity: sensor.papierabfall_collection
name: Abholung in
unit: Tage(n)
- entity: sensor.papierabfall_date
name: Datum
- entity: sensor.mybuttoncardsensor
type: 'custom:button-card'
layout: icon_name_state2nd
show_label: true
label: |
[[[
var days_to = entity.state.split("|")[1]
if (days_to == 0)
{ return "Heute" }
else if (days_to == 1)
{ return "Morgen" }
else
{ return "in " + days_to + " Tagen" }
]]]
show_name: true
name: |
[[[
return entity.state.split("|")[0]
]]]
state:
- color: red
operator: template
value: '[[[ return entity.state.split("|")[1] == 0 ]]]'
- color: orange
operator: template
value: '[[[ return entity.state.split("|")[1] == 1 ]]]'
- value: default
Connection step:
The app name is "Smart Life", please search for and install the app on Google Play or Apple Store.
Step 1: Scan code download APP
Step 2: Make sure your phone is connected to wifi
Step 3: Press "+" to add the button and select "Lighting"
Step 4: Long press the controller to make the light flash
Step 5: Press the Confirm Flash button on your phone
Step 6: Enter the WiFi password and confirm
Step 7: Wait for the connection to succeed
Step 8: Start using
boraers@gmail.com
tuyaforsmarthome_90
https://www.home-assistant.io/integrations/tuya
Cloud > Development >
boraers@googlemail.com
tuyaforsmarthome_90
UserID: boraers@gmail.com
Access ID/Client ID: 9wk4ecspwhveyycxev3r
Access Secret/Client Secret: 2c0ee61b3377443a88a94a611e1563e1
Project Code: p1671915179957wxkk7v
→ tuya integration in HA should recognize device → enter credentials
Add smart life to Home Assistant
You probably know us, we don’t want to use more apps. we want to control everything from one central home automation platform: Home Assistant in our case.
As told before: Make sure to can devices added in Smart Life before you can add them into Home Assistant.
For all the parameters and settings: https://www.home-assistant.io/components/tuya/
A sample configuration from me. 31 is the country code of The Netherlands. You can find your country codes in the second column of this site. The entry smart_life is the Tuya platform where I am registered. Add this into your own configuration.yaml and restart your Home Assistant instance. After starting it collects the compatible devices from Tuya. In my case only the Blitzwolf light.
tuya:
username: xxx
password: xxx
country_code: 49
platform: smart_life
After changing your configuration, restart and check out Unused devices. In my case I have 2 products in Smart Life and only one is supported for now in Home Assistant: the Blitzwolf Led Light strip.
https://github.com/rospogrigio/localtuya
https://community.home-assistant.io/t/am-i-missing-something-no-color-on-light-in-scene/373591/14
Add your bulbs as new devices with the following settings:
ID: 20
Brightness: 22
Color Temperature: 23
Brightness Lower Value: 0
Brightness Upper Value: 1000
Color Mode: 21
Color: 24
Minimum Color Temperature: 2701
Maximum Color Temperature: 6499
Scene: 25
https://community.home-assistant.io/t/get-local-key-tuya-since-june-2022/436399/7
https://www.youtube.com/watch?v=2kfv0W80NYk&t=481s
45625580bcddc2a2bf27: "local_key": "4b1e7572e8b54ca3", Hama_LED
bf3d5d9718ef1b2a8c5asm: "local_key": "67426b621cacaf5f", Treppe
Issue: Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists
https://github.com/rospogrigio/localtuya/issues/183
Adding in config manual works.
localtuya:
- host: 192.168.1.215
device_id: xxx
local_key: xxx
friendly_name: Tuya Device
protocol_version: "3.3"
entities:
- platform: sensor
friendly_name: Plug Voltage
id: 20
scaling: 0.1 # Optional
device_class: voltage # Optional
unit_of_measurement: "V" # Optional
Check compatibilit
https://templates.blakadder.com/search.html
Flashing:
https://siytek.com/esphome-vs-tasmota/#Flashing
https://siytek.com/flashing-tasmota-methods/#Flashing-Tasmota-Online-using-Chrome-Browser
https://tasmota.github.io/docs/Tuya-Convert/
https://siytek.com/tuya-convert-linux/
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
cd ~
git clone https://github.com/ct-Open-Source/tuya-convert
cd tuya-convert
sudo ./install_prereq.sh
sudo ./start_flash.sh
How To Use Tuya Convert On Raspberry Pi (Step-by-step Guide)
https://siytek.com/tuya-convert-and-raspberry-pi/
sudo apt-get update
sudo apt-get upgrade
sudo raspi-config → network options → select WiFi and enter your location and credentials → finish
rfkill unblock wifi
sudo apt-get install git
cd ~
git clone https://github.com/ct-Open-Source/tuya-convert
cd tuya-convert && sudo su
sudo ./install_prereq.sh
sudo ./start_flash.sh
→ http://10.42.42.1/ using tasmota-xxxxx SSID → 192.168.4.1
timeout issue with latest Ri OS version!
https://github.com/ct-Open-Source/tuya-convert/issues/1022
https://www.drejo.com/blog/neo-tuya-tasmota/
solution: install old version: https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2020-05-28/2020-05-27-raspios-buster-arm64.zip
issue: N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
solution: apt-get --allow-releaseinfo-change update
https://siytek.com/how-to-set-up-tasmota-mqtt-auto-discovery-for-home-assistant/
https://templates.blakadder.com/hama_00176547.html
Hama 10W 806lm RGBW Bulb (00176547)
{"NAME":"Hama Smart WiF","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
In order to turn on discovery mode so that Home Assistant can auto discover our device, we must turn on SetOption 19. Simply enter the following command in the Tasmota console.
SetOption19 onws
Whether your wireless card support Access Point mode.
sudo apt-get update
sudo apt-get -y install aptitude
sudo aptitude install iw
iw list
→ Look for supported interface section, where it should be a entry called AP like below
updateBroadcom wifi driver
https://askubuntu.com/questions/55868/installing-broadcom-wireless-drivers
https://www.technolaty.com/how-to-install-wireless-drivers-on-ubuntu/
sudo lshw -C network
sudo apt install firmware-b43-installer
sudo apt install linux-firmware
sudo reboot
Sunrise:
https://siytek.com/how-to-simulate-a-sunrise-with-home-assistant/
https://www.tomshardware.com/how-to/send-and-receive-data-raspberry-pi-pico-w-mqtt
install MicroPython firmware:
https://www.tomshardware.com/how-to/raspberry-pi-pico-setup
https://micropython.org/download/rp2-pico-w/
1. Download the MicroPython UF2 file for your model of Raspberry Pi Pico.
2. Push and hold the BOOTSEL button on the Pico, then connect to your computer using a micro USB cable. Release BOOTSEL once the drive RPI-RP2 appears on your computer.
3. Drag and drop the UF2 file on to the RPI-RP2 drive. The Raspberry Pi Pico will reboot and will now run MicroPython.
https://microcontrollerslab.com/hc-sr04-ultrasonic-sensor-raspberry-pi-pico-micropython-tutorial/
https://learn.adafruit.com/adafruit-qt-py-2040
Micopthon formware:
https://micropython.org/download/ADAFRUIT_QTPY_RP2040/
https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/
https://www.reddit.com/r/homeassistant/comments/pa8x5r/write_to_influxdb_at_regular_intervals/
https://community.home-assistant.io/t/send-metrics-to-influxdb-at-regular-intervals/9096
https://www.youtube.com/watch?v=iUgxwbfkIqU
https://www.arducam.com/esp32-machine-vision-learning-guide/
https://www.youtube.com/watch?v=mDIJEyElkAU
https://www.youtube.com/watch?v=zb3AEusPQLQ
https://www.youtube.com/watch?v=s6qQs4FN9B0
https://www.thingiverse.com/thing:4573481
https://github.com/jomjol/AI-on-the-edge-device/wiki
https://github.com/jomjol/water-meter-system-complete
https://www.hackster.io/mickeb/esp32-cam-real-time-water-usage-sensor-f9c29d
https://www.youtube.com/watch?v=iUgxwbfkIqU&t=2s
https://pyimagesearch.com/2017/02/13/recognizing-digits-with-opencv-and-python/
https://www.geeksforgeeks.org/text-detection-and-extraction-using-opencv-and-ocr/
https://medium.com/pythoneers/text-detection-and-extraction-from-image-with-python-5c0c75a8ff14
https://tesseract-ocr.github.io/tessdoc/Installation.html
https://tesseract-ocr.github.io/tessdoc/Command-Line-Usage.html#simplest-invocation-to-ocr-an-image
tesseract input.txt output.txt -l eng --psm 3
https://medium.com/quantrium-tech/installing-and-using-tesseract-4-on-windows-10-4f7930313f82
need to add esseract to sstempath!!!
cd C:\Users\Bora_2\Downloads
tesseract ziffer4.jpg stdout -l eng
tesseract ziffer4.jpg output.txt
tesseract input.txt output.txt -l eng
https://tesseract-ocr.github.io/tessdoc/ImproveQuality.html#examples
https://github.com/tesseract-ocr/tesstrain
make training MODEL_NAME=test-model DATA_DIR=/data GROUND_TRUTH_DIR=/data/foo-ground-truth
install GNU make on Win10
https://leangaurav.medium.com/how-to-setup-install-gnu-make-on-windows-324480f1da69
https://gnuwin32.sourceforge.net/packages/make.htm
install software
add to PATH
C:\Program Files (x86)\GnuWin32\bin
Copy the path and jump to edit environment variables from windows search
Click Environment Variables.
Under user variables, find Path and click Edit.
Hit New, paste the copied path and hit Ok.
Hit OK on all other windows also.
Now open a fresh CMD/Terminal and type make and and hit Enter.
https://medium.com/@ahmetxgenc/how-to-use-tesseract-on-windows-fe9d2a9ba5c6
pip install pytesseract
pip install numpy
pip install opencv-python
$ tesseract –help-psm
Page segmentation modes:
0 Orientation and script detection (OSD) only.
1 Automatic page segmentation with OSD.
2 Automatic page segmentation, but no OSD, or OCR. (not implemented)
3 Fully automatic page segmentation, but no OSD. (Default)
4 Assume a single column of text of variable sizes.
5 Assume a single uniform block of vertically aligned text.
6 Assume a single uniform block of text.
7 Treat the image as a single text line.
8 Treat the image as a single word.
9 Treat the image as a single word in a circle.
10 Treat the image as a single character.
11 Sparse text. Find as much text as possible in no particular order.
12 Sparse text with OSD.
13 Raw line. Treat the image as a single text line,
bypassing hacks that are Tesseract-specific.
$ tesseract --help-oem
OCR Engine modes:
0 Legacy engine only.
1 Neural nets LSTM engine only.
2 Legacy + LSTM engines.
3 Default, based on what is available.
https://nanonets.com/blog/ocr-with-tesseract/#training-tesseract-on-custom-data
https://muthu.co/all-tesseract-ocr-options/
https://studio.edgeimpulse.com/studio/select-project
https://github.com/edgeimpulse/example-esp32-cam
https://www.survivingwithandroid.com/tinyml-esp32-cam-edge-image-classification-with-edge-impulse/
https://peter-ing.medium.com/beginners-guide-to-object-detection-with-edge-impulse-c8ea95f844a0
https://docs.arduino.cc/tutorials/nano-33-ble-sense/edge-impulse
https://wiki.seeedstudio.com/XIAO-BLE-Sense-TFLite-Getting-Started/
https://developer.android.com/codelabs/digit-classifier-tflite#0
https://www.edgeimpulse.com/blog/get-plugged-in-to-the-future-of-smart-energy-meters
https://www.youtube.com/watch?v=pWp3PhYI-OU
https://github.com/leriomaggio/deep-learning-keras-tensorflow
https://scotthelme.co.uk/creating-a-house-alarm-system-with-home-assistant/
https://leonardosmarthomemakers.com/how-to-create-a-diy-alarm-system-with-home-assistant/
https://smarthomescene.com/guides/alarmo-make-your-own-alarm-system-in-home-assistant/
https://wolfpaulus.com/micro-python-esp32/
https://learn.adafruit.com/adafruit-esp32-feather-v2/micropython-setup
http://kentarotanaka.com/huzzah32-esp32-micropython-setup/
https://peyanski.com/how-to-install-home-assistant-community-store-hacs/
install addon Terminal & SSH
enter follwing code into WEB UI: wget -q -O - https://install.hacs.xyz | bash -
Restart Server
search for integration hacs
select all 4 check boxes
enter github credentials
You can further enable AppDaemon and NetDaemon apps discovery & tracking. In simple words these are more option to customize your Home Assistant.
https://docs.m5stack.com/en/quick_start/timer_cam/arduino
https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/
https://community.home-assistant.io/t/m5stack-unit-cam-with-esphome/474378
https://www.fambach.net/esp32-cam-modul/
Kamera Fernsteuern: http://<ip>/control?var=<Variablenname>&val=<Wert>
http://192.168.178.42/control?var=framesize&val=3
http://192.168.178.42:81/stream
commands work with web_cam example! → web_cam_M5Stack_Timer-CAM_working
https://randomnerdtutorials.com/esp32-cam-ov2640-camera-settings/
entity_id: camera.cam1
filename: /config/www/snapshot.jpg

alias: take periodic pictures
description: ""
trigger:
- platform: time_pattern
minutes: /1
condition: []
action:
- service: camera.snapshot
data:
filename: >-
/config/Timelapse/Plants_{{ "%04d"|format(now().year) }}_{{
"%02d"|format(now().month) }}_{{ "%02d"|format(now().day)
}}_{{ "%02d"|format(now().hour) }}_{{ "%02d"|format(now().minute) }}_{{ "%02d"|format(now().second) }}.jpeg
target:
entity_id: camera.esp32cam_1
mode: single
https://lemariva.com/blog/2020/06/micropython-m5camera-timelapse-over-mqtt
https://github.com/lemariva/uPyCam/tree/timelapse-camera
https://github.com/lemariva/micropython-camera-driver
due to missing PSRAM, the micropython code does not work...
https://www.youtube.com/watch?v=wrtNFFGXi5I&t=363s
https://drive.google.com/file/d/17kUsL4qcdAIRIxtfcCf5VnePcwTSmhqX/view
https://play.google.com/store/apps/details?id=com.electro_tex.bluetoothcar
https://www.youtube.com/watch?v=Pqs-3GgWW3s
Install via Microsoft store
https://docs.python.org/3/library/venv.html
create new venv:
python -m venv “D:\Home Assistant\Micropython\myenv”
activate in command prompt to install packages:
D:\”Home Assistant”\Python\myenv\Scripts\activate.bat
pip install ...
deactivate
to see the new venv in VSCode:
Python: Select Interpreter → D:\Home Assistant\Micropython\myenv\Scripts\python.exe
then, restart VSCode
https://keepassxc.org/download/
Use Yubico: https://www.yubico.com/de/works-with-yubikey/catalog/keepassxc/
Database > Database Security > Add Additional protection… > Add Challenge-Response → choose Yubikey from the drop-down menu
https://keepassxc.org/docs/KeePassXC_GettingStarted.html#_setup_browser_integration
KeePass2Android or KeePassDX
Download: https://docs.syncthing.net/users/contrib.html#contributions
Getting started: https://docs.syncthing.net/intro/getting-started.html#getting-started
Default Folder: C:\Users\Bora_2\Sync
Device Identification – BoraNB: 3YHOKRG-D57OAYW-QW7Z23T-MQPGWLJ-ZGR4UCV-DUB-LX1: KOVYWX3-M6CXGFE-M4UQSQQ
VOHODHG-KXFA7RQ-5NQ6LM3-3HLMSXC-6XMN4BH-XCIA7GC-LBZGX2G-N4APPQJ
Starting Syncthing Automatically: https://docs.syncthing.net/users/autostart.html
Windows:
create shortcut in following folder
folder: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
Alternatively, in newer versions of Windows, open shell:startup from the Run command (Win+R).
path: "D:\Home Assistant\syncthing-windows-amd64-v1.22.2\syncthing.exe" --no-console --no-browser
open: http://localhost:8384
Linux
https://docs.syncthing.net/users/autostart.html#linux
https://learn.adafruit.com/adafruit-stemma-soil-sensor-i2c-capacitive-moisture-sensor
3D models for assembling Adafruit soil sensor:
https://learn.adafruit.com/soil-node
https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io
https://community.home-assistant.io/t/mqtt-topic-wildcard/389382
topic: "stat/+/RESULT"
As you have already discovered, this is not an acceptable way to use a wildcard (#) in an MQTT topic:
topic: "#/batt"
The # wildcard can appear at the end of a topic, like this:
topic: "home/sensors/#"
or alone:
topic: "#"
You didn’t mention the format of the battery topic but maybe the + wildcard can be useful. It is designed to allow for any sub-topic like this:
topic: "home/OpenMQTTGateway/BttoMQTT/+/batt"
data_template:
message: “{{ trigger.payload }}”
title: From mqtt_notifier
service: persistent_notification.create
it works!
port forward router:
443 to 8123 tcp
and
80 to 3000 tcp
and grafana setings:
plugins: []