WikiJS/homeassistant_3.html

5411 lines
236 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
title: Homeassistant WYSIWYG
description:
published: 1
date: 2024-02-03T20:49:47.021Z
tags:
editor: ckeditor
dateCreated: 2024-02-03T20:49:47.021Z
-->
<p>Need to access time sensor</p>
<p><br>&nbsp;</p>
<p>alternatively, use now</p>
<p><br>&nbsp;</p>
<p><br>template:<br>- trigger:<br>- platform: time_pattern<br>seconds: "/1"<br>sensor:<br>- name: time<br>state: "{{ now().strftime('%H:%M:%S') }}"<br><br>{{ now().strftime("%I:%M %p") }}<br><br>{{ as_timestamp(state_attr("device_tracker.android_9050f88e39898022", "last_time_reachable")) | timestamp_local }}<br>{##{{ state_attr("device_tracker.android_9050f88e39898022", "last_time_reachable").strftime('%H:%M:%S') }}##}<br><br>- condition: template<br>value_template: '"{{ now().timestamp()+300 &lt; (as_timestamp(state_attr("device_tracker.android_9050f88e39898022", "last_time_reachable")) | float)&nbsp;<br>}}"'</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Change attribute value via automation</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/21">https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/21</a></p>
<p>- id: automation 3</p>
<p>trigger:</p>
<p>platform: time_pattern</p>
<p>minutes: '/1'</p>
<p>action:</p>
<p>service: python_script.set_state</p>
<p>data_template:</p>
<p>entity_id: sensor.cold_water_rate</p>
<p>state: 42</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>new HA OS on RaPi4</h1>
<p>http://192.168.178.52:8123/</p>
<p>create user</p>
<p>user: bora, pass: bora</p>
<p>select location</p>
<p>activate advanced mode under profile settings</p>
<p>install add ons</p>
<p>Samba share</p>
<p>username: homeassistant, password: bora, workgroup: WORKGROUP</p>
<p>add a new network location: \\192.168.178.52\config</p>
<p>file editor</p>
<p>duckdns</p>
<p>domains:<br>- habora.duckdns.org<br>token: 799093a4-0b34-454f-99cb-25a4637bf404<br>aliases: []<br>lets_encrypt:<br>accept_terms: true<br>algo: secp384r1<br>certfile: fullchain.pem<br>keyfile: privkey.pem<br>seconds: 300</p>
<p>&nbsp;</p>
<p>MariaDB</p>
<p>databases:<br>- homeassistant<br>logins:<br>- username: homeassistant<br>password: password1234<br>- username: read_only_user<br>password: password1234<br>rights:<br>- username: homeassistant<br>database: homeassistant<br>- username: read_only_user<br>database: homeassistant<br>privileges:<br>- SELECT</p>
<p>recorder:<br>db_url: mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4</p>
<p>&nbsp;</p>
<p>Nginx Proxy Manager</p>
<p>Open WebUI → admin@example.com / changeme</p>
<p>Hosts Proxy Hosts → Add Proxy Host</p>
<p>Domain Names: habora.duckdns.org</p>
<p>Als Scheme wählt Ihr http, unter „Forward Hostname / IP“ tragt Ihr die IP eures Home Assistant ein. → 192.168.178.52</p>
<p>Bei Forward Port gebt Ihr den Port ein, unter dem euer Home Assistant erreichbar ist. (Standardmäßig ist das der Port 8123)</p>
<p>Aktiviert abschließend noch den Punkt „Websockets Support„.</p>
<p>Anschließend wechselt Ihr auf den Reiter SSL.</p>
<p>Hier wählt ihr unter „SSL Certificate“ den Eintrag „Request a new SSL Certificate“ um ein neues Zertifikat zu erstellen aus.</p>
<p>Aktiviert nun den Punkt „Force SSL„, tragt eine gültige Email-Adresse für eure Zertifikat ein und akzeptiert die Lets Encrypt Bedingungen durch aktivieren der Option am unteren Rand der Dialog.</p>
<p>Bestätigt nun die Eingaben durch einen Klick auf „Save“ und wartet, bis der Vorgang abgeschlossen ist.</p>
<p>Dann werden im Hintergrund die Zertifikate von Lets Encrypt generiert. Das kann einen Augenblick in Anspruch nehmen.</p>
<p>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.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_eeaf4fb9a08969e4.png"></figure>
<p>configuration.yaml</p>
<p>http:</p>
<p>use_x_forwarded_for: true</p>
<p>trusted_proxies:</p>
<p>- 127.0.0.1</p>
<p>- 172.30.33.0/24</p>
<p>- ::1</p>
<p>Let's Encrypt</p>
<p>domains:<br>- habora.duckdns.org<br>email: boraers@googlemail.com<br>keyfile: privkey.pem<br>certfile: fullchain.pem<br>challenge: http<br>dns: {}</p>
<p>add to configuration.aml<br>http:<br>ssl_certificate: /ssl/fullchain.pem<br>ssl_key: /ssl/privkey.pem</p>
<p>influxdb</p>
<p>no adaptation of configuration was needed</p>
<p><a href="http://192.168.178.52:8123/api/hassio_ingress/FJZMGvrT7OnlTzBKdUP9jKiKEe4yp4V4D5VT4zHP5cQ/sources/0/hosts">http://192.168.178.52:8123/api/hassio_ingress/FJZMGvrT7OnlTzBKdUP9jKiKEe4yp4V4D5VT4zHP5cQ/sources/0/hosts</a></p>
<p><a href="http://192.168.178.52:8123/hassio/ingress/a0d7b954_influxdb">http://192.168.178.52:8123/hassio/ingress/a0d7b954_influxdb</a></p>
<p>create database: home_assistant</p>
<p>create user: homeassistant, pass: homeassistant, permissions: ALL</p>
<p>mosquitto</p>
<p>Logins:<br>- username: note4<br>password: note4</p>
<p>MQTT integration configuration:<br>127.0.0.1 ← not core-mosquitto<br>1883<br>note4<br>note4<br>MQTT protocol: 5</p>
<p>Grafana</p>
<p>env_vars:<br>- name: GF_SECURITY_ALLOW_EMBEDDING<br>value: "true"<br>- name: GF_AUTH_ANONYMOUS_ORG_NAME<br>value: Main Org.<br>- name: GF_AUTH_ANONYMOUS_ENABLED<br>value: "true"<br>- name: GF_AUTH_DISABLE_LOGIN_FORM<br>value: "false"</p>
<p>SSL: false or true, depending on having ssl set up</p>
<p>Network:<br>3000</p>
<p><a href="http://192.168.178.52:8123/hassio/ingress/a0d7b954_grafana">http://192.168.178.52:8123/hassio/ingress/a0d7b954_grafana</a></p>
<p>in web panel</p>
<p>add data source: InfluxDB</p>
<p>URL: <a href="http://a0d7b954-influxdb:8086/">http://</a><a href="http://192.168.178.52:8123/hassio/ingress/a0d7b954_influxdb">a0d7b954</a><a href="http://a0d7b954-influxdb:8086/">-influxdb:8086</a></p>
<p>database, user, pass</p>
<p>&nbsp;</p>
<p>Terminal and SSH</p>
<p>integrations</p>
<p>HACS</p>
<p>github credentials required</p>
<p>OpenWeatherMap</p>
<p>API Ke:</p>
<p>solarman</p>
<p>re-use old config files</p>
<p>automations</p>
<p>blueprints</p>
<p>bosch_shc</p>
<p>custom_components</p>
<p>group</p>
<p>images</p>
<p>python_scripts</p>
<p>www</p>
<p>alarm_control_panel.yaml</p>
<p>automations.yaml</p>
<p>climate.yaml</p>
<p>configuration.yaml</p>
<p>influxdb.yaml</p>
<p>mqtt.yaml</p>
<p>scenes.yaml</p>
<p>scripts.yaml</p>
<p>secrets.yaml</p>
<p>sensor.yaml</p>
<p>move to external SSD</p>
<p>che</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_8c01be9bb611f888.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Home-Assistant script template</h1>
<p><br>&nbsp;</p>
<p>{## Imitate available variables: ##}<br>{% set my_test_json = {<br>"temperature": 25,<br>"unit": "°C"<br>} %}<br><br>The temperature is {{ my_test_json.temperature }} {{ my_test_json.unit }}.<br><br>{% if is_state("sun.sun", "above_horizon") -%}<br>The sun rose {{ relative_time(states.sun.sun.last_changed) }} ago.<br>{%- else -%}<br>The sun will rise at {{ as_timestamp(state_attr("sun.sun", "next_rising")) | timestamp_local }}.<br>{%- endif %}<br><br>For loop example getting entity values in the weather domain:<br><br>{% for state in states.weather -%}<br>{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}<br>{{ state.name | lower }} is {{state.state_with_unit}}<br>{%- endfor %}.<br><br>{% set tado_temp = states('sensor.tado_wohnzimmer_temperature')|float(20) %}<br>{% set room_temp = states('sensor.meter_plus_90b4_temperature')|float(20) %}<br>{% set current_offset = state_attr('climate.tado_wohnzimmer',<br>'offset_celsius') %}<br>{{ tado_temp|round(1) }}<br>{{ room_temp|round(1) }}<br>{{ current_offset|round(1) }}<br>{{ (-(tado_temp - room_temp) + current_offset)|round(1) }}<br>{{ (tado_temp - current_offset)|round(1) }}<br><br>&nbsp;</p>
<p><br>{% set average_temp = 0 %}<br>{% set active_rooms = 0 %}<br>{% set temp_bedroom = states('sensor.radiator_thermostat_bedroom_temperature')|float(15) %}<br>{% set climate_bedroom = states('climate.room_climate_bedroom') %}<br>{% set temp_top = states('sensor.radiator_thermostat_child_top_temperature')|float(15) %}<br>{% set climate_top = states('climate.room_climate_child_s_room_1_top') %}<br>{% set temp_bottom = states('sensor.radiator_thermostat_bottom_temperature')|float(15) %}<br>{% set climate_bottom = states('climate.room_climate_child_s_room_2_botto') %}<br><br>{% if climate_bedroom not in ("unavailable", "unknown", "off") %}<br>{% set active_rooms = active_rooms + 1 %}<br>{% set average_temp = average_temp + temp_bedroom %}<br>{% endif %}<br><br>{{ average_temp/active_rooms|round(1) if active_rooms&gt;0 else 77 }}<br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<h1>Python Scripts</h1>
<p><a href="https://www.home-assistant.io/integrations/python_script">https://www.home-assistant.io/integrations/python_script</a></p>
<p><br>&nbsp;</p>
<h2>Example 1</h2>
<p><a href="https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/5">https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/5</a></p>
<p>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.</p>
<p><br>&nbsp;</p>
<p>For what its worth, I have been hunting for a solution to this problem and I finally decided to make a small script:</p>
<p># python_scripts/set_state.py</p>
<p><br>&nbsp;</p>
<p>#==================================================================================================</p>
<p># python_scripts/set_state.py</p>
<p>#==================================================================================================</p>
<p><br>&nbsp;</p>
<p>#--------------------------------------------------------------------------------------------------</p>
<p># Set the state or other attributes for the entity specified in the Automation Action</p>
<p>#--------------------------------------------------------------------------------------------------</p>
<p><br>&nbsp;</p>
<p>inputEntity = data.get('entity_id')</p>
<p>if inputEntity is None:</p>
<p>logger.warning("===== entity_id is required if you want to set something.")</p>
<p>else:</p>
<p>inputStateObject = hass.states.get(inputEntity)</p>
<p>inputState = inputStateObject.state</p>
<p>inputAttributesObject = inputStateObject.attributes.copy()</p>
<p><br>&nbsp;</p>
<p>for item in data:</p>
<p>newAttribute = data.get(item)</p>
<p>logger.debug("===== item = {0}; value = {1}".format(item,newAttribute))</p>
<p>if item == 'entity_id':</p>
<p>continue # already handled</p>
<p>elif item == 'state':</p>
<p>inputState = newAttribute</p>
<p>else:</p>
<p>inputAttributesObject[item] = newAttribute</p>
<p>&nbsp;</p>
<p>hass.states.set(inputEntity, inputState, inputAttributesObject)</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>With this script in place, the action could be:</p>
<p><br>&nbsp;</p>
<p>action:</p>
<p>service: python_script.set_state</p>
<p>data_template:</p>
<p>entity_id: Binary_sensor.sensor1</p>
<p>state: ON</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Example 2</h2>
<p><a href="https://www.home-assistant.io/integrations/python_script#calling-services">https://www.home-assistant.io/integrations/python_script#calling-services</a></p>
<p><br>&nbsp;</p>
<p>Start by enabling the Python script and create the first script.</p>
<p>Add to&nbsp;<code>configuration.yaml</code>:&nbsp;<code>python_script:</code></p>
<p>Create folder&nbsp;<code>&lt;config&gt;/python_scripts</code></p>
<p>Create a file&nbsp;<code>&lt;config&gt;/python_scripts/hello_world.py</code>&nbsp;in the folder and give it this content:</p>
<p><code># `data` is available as builtin and is a dictionary with the input data.</code></p>
<p>
</p>
<p><code>name = data.get("name", "world")</code></p>
<p>
</p>
<p><code># `logger` and `time` are available as builtin without the need of explicit import.</code></p>
<p>
</p>
<p><code>logger.info("Hello {} at {}".format(name, time.time()))</code></p>
<p><br>&nbsp;</p>
<p>Start Home Assistant to reload the script configuration.</p>
<p>Call your new&nbsp;<a href="https://my.home-assistant.io/redirect/developer_call_service?service=python_script.hello_world"><code><u>python_script.hello_world</u></code></a>&nbsp;service (with parameters) from the&nbsp;<a href="https://my.home-assistant.io/redirect/developer_services"><u>Services</u></a>, using the YAML mode.</p>
<p><code>service: python_script.hello_world</code></p>
<p>
</p>
<p><code>data:</code></p>
<p>
</p>
<p><code>&nbsp; name: "Input-Text"</code></p>
<p>Running this script show absolutely no output on the screen, but it logs with level&nbsp;<code>info</code>. You must have the&nbsp;<a href="https://www.home-assistant.io/integrations/logger/"><u>Logger</u></a>&nbsp;enabled at least for level&nbsp;<code>info</code>.</p>
<p>Your&nbsp;<code>confiuration.yaml</code>&nbsp;should include something like this.</p>
<p><code>logger:</code></p>
<p>
</p>
<p><code>&nbsp; default: info</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Flash ESPhome on ESP32 ESP2866 NodeMCU board</h1>
<p><a href="https://www.pieterbrinkman.com/2022/01/01/2022-update-flash-esphome-on-esp32-esp2866-nodemcu-board/">https://www.pieterbrinkman.com/2022/01/01/2022-update-flash-esphome-on-esp32-esp2866-nodemcu-board/</a></p>
<p><br>&nbsp;</p>
<p>Install using esphome-flasher:</p>
<p>download compiled firmware: In the Install menu click Manual Download. The compilation will now start and the .bin file will download when ready.</p>
<p>Go to the esphome-flasher GitHub page and download the flasher for the OS youre using. There is a esp home flash tool for macOS, Ubuntu and Windows :<br><a href="https://github.com/esphome/esphome-flasher/releases"><strong><u>https://github.com/esphome/esphome-flasher/releases</u></strong></a></p>
<p>Connect your ESP board with USB to your laptop.</p>
<p>Open the flasher tool</p>
<p><strong>Serial port</strong>: select COM port where the board is connected (there is probably only one option 😊).</p>
<p><strong>Firmware</strong>: Browse to the location where you downloaded your compiled firmware and select your firmware.</p>
<p>Click<strong>&nbsp;Flash ESP&nbsp;</strong>and wait</p>
<p>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.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_c35888ec30af40ce.png"></figure>
<p>The ESP will be ready after it states that its&nbsp;<i>ready for Over-The-Air Updates</i>&nbsp;and&nbsp;<i>that he API server is ready</i>.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Measuring DHT22</h1>
<p><a href="https://www.pieterbrinkman.com/2021/02/03/build-a-cheap-air-quality-meter-using-esphome-home-assistant-and-a-particulate-matter-sensor/">https://www.pieterbrinkman.com/2021/02/03/build-a-cheap-air-quality-meter-using-esphome-home-assistant-and-a-particulate-matter-sensor/</a></p>
<p><i><strong>Note:&nbsp;</strong>Step 1 and 2 have been changed with new UI and features in both Home Assistant and ESPHome. Read the&nbsp;</i><a href="https://www.pieterbrinkman.com/2022/01/01/2022-update-flash-esphome-on-esp32-esp2866-nodemcu-board/"><i><strong><u>updated article to flash ESPhome on your ESP32 / ESP2866 NodeMCU board</u></strong></i></a>&nbsp;and skip step 1 and 2 below.</p>
<p>3. Wire the PMS5003 Particular Matter sensor and DHT22 to the ESP board</p>
<p>Wiring the DHT sensor is straight forward.</p>
<p>Connect the GND to any free GND pin on the ESP</p>
<p>Connect the VSS to any free 3V3 pin on the ESP</p>
<p>Connect the DATA to D4 on the ESP</p>
<p><strong>4. Configure ESPHome to read the measurements and supply them to Home Assistant</strong></p>
<p>Now its time to expose the measurement values to Home Assistant.</p>
<p>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.</p>
<pre><code class="language-plaintext">uart:</code></pre>
<p>When ready, press the Upload button and ESPHome will flash the new firmware OTA. Wait till ready and you should be good to go. ===&gt; this can be done wirelessl now</p>
<p>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. &nbsp;</p>
<p>Wait a two minutes and notice that the switch will be turned on for 20 seconds and then turned off again.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_6645eb4607246ee.png"></figure>
<p>Now add the some graph to your dashboard.</p>
<p><strong>6. Add air quality measurements to Home Assistant</strong></p>
<p>For viewing the measurements in my lovelace dashboard I used a custom card called&nbsp;<a href="https://github.com/kalkih/mini-graph-card"><strong><u>mini-graph-card</u></strong></a>, this card can be easily installed using HACS. I used the following Lovelace configuration.</p>
<p>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:
&nbsp;- entity: sensor.particulate_matter_1_0um_concentration
&nbsp; &nbsp;name: 1 µm &gt;
&nbsp;- entity: sensor.particulate_matter_2_5um_concentration
&nbsp; &nbsp;name: 2.5 µm &gt;
&nbsp;- entity: sensor.particulate_matter_10_0um_concentration
&nbsp; &nbsp;name: 10 µm &gt;
</p>
<h3>Adding measurements of outside air</h3>
<p>To create additional context I also use<a href="https://www.home-assistant.io/integrations/luftdaten/"><u>&nbsp;</u><strong><u>Luftdaten integration</u></strong></a>&nbsp;to get outside air quality measurements nearby. This way you could automate opening windows or triggering ventilation to get better quality air from outside.</p>
<p>Luftdaten is making the world a better place through community driven, open environmental data. The coverage within northern Europe is impressive.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_b7a34d7754cb750c.png"></figure>
<p>Exposing both inside and outside air quality with a vertical stack card will provide a nice comparison view.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_99d77d30d22d0a29.png"></figure>
<p>Thats it. Now its 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!</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Working DHT11 on Berrbase NodeMCU ESP32</h1>
<p><a href="https://www.berrybase.de/esp32-nodemcu-development-board?sPartner=g_shopping&amp;gclid=Cj0KCQiAnNacBhDvARIsABnDa68SnJ4bQ8qK-zWJiPZKsqYP245LF2rjMlnLhZHn7BHi7THLCbbWnOcaAvoOEALw_wcB">https://www.berrybase.de/esp32-nodemcu-development-board?sPartner=g_shopping&amp;gclid=Cj0KCQiAnNacBhDvARIsABnDa68SnJ4bQ8qK-zWJiPZKsqYP245LF2rjMlnLhZHn7BHi7THLCbbWnOcaAvoOEALw_wcB</a></p>
<p>ESP32 NodeMCU Development Board</p>
<p>Artikel-Nr.: NMCU-ESP32</p>
<p>|</p>
<p>EAN: 4251266700609</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Connection</h2>
<p>DHT on breakout board with SMD resistors and LED was used → might need 10 kOhm resistor for bare DHT11</p>
<p><br>&nbsp;</p>
<p>12 = GPIO12</p>
<p>VCC = 3.3V</p>
<p>GND = Gnd</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>test-esp32nmcu.yaml → test-esp32nmcu___working_20221211.bin</h2>
<p>esphome:</p>
<p>&nbsp; name: test-esp32nmcu</p>
<p><br>&nbsp;</p>
<p>esp32:</p>
<p>&nbsp; board: esp32dev</p>
<p>&nbsp; framework:</p>
<p>&nbsp; &nbsp; type: arduino</p>
<p><br>&nbsp;</p>
<p># Enable logging</p>
<p>logger:</p>
<p><br>&nbsp;</p>
<p># Enable Home Assistant API</p>
<p>api:</p>
<p>&nbsp; encryption:</p>
<p>&nbsp; &nbsp; key: "MI1DnjQWboPRECsx7PlLQS4BiR7SQQSpYczCuzpupS4="</p>
<p><br>&nbsp;</p>
<p>ota:</p>
<p>&nbsp; password: "bb47b47929f02cd349e51eddd8602edb"</p>
<p><br>&nbsp;</p>
<p>wifi:</p>
<p>&nbsp; #ssid: !secret wifi_ssid</p>
<p>&nbsp; #password: !secret wifi_password</p>
<p>&nbsp; #ssid: "FRITZ!Box Gastzugang"</p>
<p>&nbsp; #password: "zakihasalittlewiener"</p>
<p>&nbsp; ssid: "FRITZ!Box 7530 GD"</p>
<p>&nbsp; password: "78302839617779115068"</p>
<p><br>&nbsp;</p>
<p>&nbsp; # Optional manual IP</p>
<p>&nbsp; manual_ip:</p>
<p>&nbsp; &nbsp; static_ip: 192.168.178.42</p>
<p>&nbsp; &nbsp; gateway: 192.168.178.1</p>
<p>&nbsp; &nbsp; subnet: 255.255.255.0</p>
<p><br>&nbsp;</p>
<p>&nbsp; # Enable fallback hotspot (captive portal) in case wifi connection fails</p>
<p>&nbsp; ap:</p>
<p>&nbsp; &nbsp; ssid: "Test-Esp32Nmcu Fallback Hotspot"</p>
<p>&nbsp; &nbsp; password: "pJDTx6ABN80C"</p>
<p><br>&nbsp;</p>
<p>captive_portal:</p>
<p><br>&nbsp;</p>
<p>sensor:</p>
<p>&nbsp; - platform: dht</p>
<p>&nbsp; &nbsp; pin: 12</p>
<p>&nbsp; &nbsp; temperature:</p>
<p>&nbsp; &nbsp; &nbsp; name: "Air quality meter Temperature"</p>
<p>&nbsp; &nbsp; humidity:</p>
<p>&nbsp; &nbsp; &nbsp; name: "Air quality meter Humidity"</p>
<p>&nbsp; &nbsp; update_interval: 10s</p>
<p>&nbsp; &nbsp; model: DHT11</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>flashing using ESPHome-Flasher-1.4.0-Windows-x64</h2>
<p><br>&nbsp;</p>
<p>see above</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>activate the sensor in HA</h2>
<p>after some minutes, the ESP32 should appear under Integrations with the initiall assigned name</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_3f1f9bd2d382bd8b.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_3736a24f705ebf1f.png"></figure>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_da20b167c94ec7a9.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>How to integrate full functionality of Bosch smart home components</h1>
<p><a href="https://github.com/tschamm/boschshc-hass">https://github.com/tschamm/boschshc-hass</a></p>
<p><br>&nbsp;</p>
<p>shc11d14d</p>
<p>192.168.178.34</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Connect via Samba share</h2>
<p><br>&nbsp;</p>
<p>add a Network Location in Windows Explorer</p>
<p><br>&nbsp;</p>
<p>LAN: <a href="smb://192.168.178.32/config">\\192.168.178.32\config</a></p>
<p>WLAN: <a href="smb://192.168.179.43/config">\\192.168.179.43\config</a> → not working??</p>
<p><br>&nbsp;</p>
<p>user: homeassistant</p>
<p>pass: bora</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>cop following folders into the config folder on RaPi:</h2>
<p>custom_components</p>
<p>images</p>
<p>tests</p>
<p><br>&nbsp;</p>
<h2>after restarting HA all components and functions should be available</h2>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Dashboard individualization</h1>
<p><a href="https://smarthomescene.com/guides/top-10-home-assistant-lovelace-themes/">https://smarthomescene.com/guides/top-10-home-assistant-lovelace-themes/</a></p>
<p>If you have not enabled custom themes already, add this to your&nbsp;<strong>configuration.yaml</strong>&nbsp;file and reboot Home Assistant:</p>
<pre><code class="language-plaintext">frontend:</code></pre>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<h1>Guest access</h1>
<p>create a dedicated account for gests:</p>
<p>user: Guest</p>
<p>pass: guest</p>
<p>open http://<a href="smb://192.168.178.32/config">192.168.178.32</a>:8123</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/configuring-a-real-guest-user-an-alternative-approach/455910">https://community.home-assistant.io/t/configuring-a-real-guest-user-an-alternative-approach/455910</a></p>
<p>Hi, Id 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.</p>
<p>My requirements:</p>
<p>Guest user allowed to login only from the internal network</p>
<p>Only specific views available to the guest user</p>
<p><strong>No need for the guest user to switch to a different dashboard once logged in</strong></p>
<p><strong>No unnecessary items to show up in the sidebar for the guest user (including logbook, media, history, etc)</strong></p>
<p>Basically a sort of kiosk mode without using frontend hacks (<a href="https://github.com/maykar/kiosk-mode">https://github.com/maykar/kiosk-mode&nbsp;2</a>&nbsp;is now deprecated,&nbsp;<a href="https://github.com/Villhellm/custom-sidebar">https://github.com/Villhellm/custom-sidebar</a>&nbsp;is no more working in latest HA versions,&nbsp;<a href="https://github.com/galloween/custom-sidebar-v2">https://github.com/galloween/custom-sidebar-v2</a>&nbsp;works only for admin users).</p>
<p>Requirement&nbsp;#1&nbsp;is the simplest: just create a guest user with a simple password and toggle the&nbsp;<code>Can only log in from the local network</code>&nbsp;option.</p>
<p>Requirement&nbsp;#2&nbsp;is also stright-forward: create a dashboard, add a View for the guest user, under&nbsp;<code>Visibility</code>&nbsp;allow the guest user only to access that view, disable the guest user to access any other view of the dashboard.</p>
<p>Requirement&nbsp;#3&nbsp;is tricky. As we know there is no global default dashboard configuration, it is&nbsp;<i>per-user</i>&nbsp;/&nbsp;<i>per-device</i>.<br>This means the guest user, upon the first login, lands in the over-complicated&nbsp;<code>Overview</code>&nbsp;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.<br>After reading tons of posts here, the simplest approach I found is to take control of the&nbsp;<code>Overview</code>&nbsp;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).<br>True, the name of the&nbsp;<code>Overview</code>&nbsp;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.</p>
<p>Requirement&nbsp;#4&nbsp;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&nbsp;<i>per-user</i>&nbsp;/&nbsp;<i>per-device</i>. The way I approched it was the following:</p>
<p>I migrated all my dashbaords into views in order to have a single dashboard only (the&nbsp;<code>Overview</code>&nbsp;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</p>
<p>I disabled in my configuration&nbsp;<code>Energy</code>,&nbsp;<code>Map</code>&nbsp;and&nbsp;<code>Media</code>&nbsp;since not using them at all (Ref.&nbsp;<a href="https://community.home-assistant.io/t/how-can-i-hide-the-energy-media-map-tabs-from-the-sidebar/433297/9">How can I hide the Energy/Media/Map tabs from the sidebar? - #9 by petro&nbsp;5</a>) resulting in the entries to disappear from the sidebar. This required switching from&nbsp;<code>default_config</code>&nbsp;to a long list taken from&nbsp;<a href="https://www.home-assistant.io/integrations/default_config/">Default Config - Home Assistant&nbsp;1</a>&nbsp;and commeting out those not needed</p>
<p>For&nbsp;<code>Logbook</code>&nbsp;and&nbsp;<code>History</code>, which are something I need as an admin but dont want the other users to access and see, I made them available for admin users only, opting for the approach described in&nbsp;<a href="https://community.home-assistant.io/t/admin-only-access-for-logbook-and-history-menus/187722/44">Admin only access for Logbook and History menus - #44 by dan_mc&nbsp;8</a>. This required to copy the code of the two components from&nbsp;<code>/usr/src/homeassistant/homeassistant/components</code>&nbsp;or&nbsp;<a href="https://github.com/home-assistant/core/tree/master/homeassistant/components">core/homeassistant/components at master · home-assistant/core · GitHub&nbsp;3</a>&nbsp;into&nbsp;<code>config/custom_components</code>, add&nbsp;<code>version</code>&nbsp;to the manifest file and making the views admin-only in&nbsp;<code>async_register_built_in_panel()</code>&nbsp;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</p>
<p>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<br>Hope can be helpful</p>
<p>Thanks</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<h1>Influx DB storing of Arduino data</h1>
<p>Example 1</p>
<p><a href="http://nilhcem.com/iot/home-monitoring-with-mqtt-influxdb-grafana">http://nilhcem.com/iot/home-monitoring-with-mqtt-influxdb-grafana</a></p>
<p><br><br>&nbsp;</p>
<p>Example 2</p>
<p><a href="http://www.iotsharing.com/2021/01/building-smart-home-system-with-home.html">http://www.iotsharing.com/2021/01/building-smart-home-system-with-home.html</a></p>
<p><br><br>&nbsp;</p>
<p>Example 3</p>
<p><a href="https://luigi-saetta.medium.com/evolving-my-home-automation-setup-af0323097d51">https://luigi-saetta.medium.com/evolving-my-home-automation-setup-af0323097d51</a></p>
<p><a href="https://luigi-saetta.medium.com/evolving-my-home-automation-2-e9b30c2eae54">https://luigi-saetta.medium.com/evolving-my-home-automation-2-e9b30c2eae54</a></p>
<p><br><br>&nbsp;</p>
<p>Example 4</p>
<p><a href="https://randomnerdtutorials.com/esp32-influxdb/">https://randomnerdtutorials.com/esp32-influxdb/</a></p>
<p><br><br>&nbsp;</p>
<p><a href="https://randomnerdtutorials.com/esp32-esp8266-sensor-bme280-influxdb/">https://randomnerdtutorials.com/esp32-esp8266-sensor-bme280-influxdb/</a></p>
<p>ssh into rapi via PUTT:</p>
<p><a href="https://randomnerdtutorials.com/esp32-mqtt-publish-subscribe-arduino-ide/">https://randomnerdtutorials.com/esp32-mqtt-publish-subscribe-arduino-ide/</a></p>
<p><br><br>&nbsp;</p>
<p><a href="https://diyi0t.com/home-assistant-mqtt-tutorial/">https://diyi0t.com/home-assistant-mqtt-tutorial/</a></p>
<p><a href="https://community.home-assistant.io/t/publish-mqtt/324939/2">https://community.home-assistant.io/t/publish-mqtt/324939/2</a></p>
<p><a href="https://www.home-assistant.io/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/">https://www.home-assistant.io/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/</a></p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>https://www.youtube.com/watch?v=U8f5FcnKdyw</p>
<p><br>&nbsp;</p>
<p>Example 5</p>
<p><a href="https://www.dummylabs.com/post/2019-01-13-influxdb-part1/">https://www.dummylabs.com/post/2019-01-13-influxdb-part1/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Home Assistant with InfluxDB on Synology</h1>
<p><a href="https://philhawthorne.com/getting-started-with-grafana-influxdb-for-home-assistant/">https://philhawthorne.com/getting-started-with-grafana-influxdb-for-home-assistant/</a></p>
<p><a href="https://philhawthorne.com/installing-home-assistant-io-on-a-synology-diskstation-nas/">https://philhawthorne.com/installing-home-assistant-io-on-a-synology-diskstation-nas/</a></p>
<p><a href="https://www.youtube.com/watch?v=rdvyYRBU7CM">https://www.youtube.com/watch?v=rdvyYRBU7CM</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Home Assistant on Linux VM with Docker, reverse proxy, MQTT and Node Red</h1>
<p><a href="https://selmi.medium.com/home-assistant-in-docker-the-ultimate-setup-16d4669dcb7">https://selmi.medium.com/home-assistant-in-docker-the-ultimate-setup-16d4669dcb7</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Presence detection options</h1>
<p><a href="https://philhawthorne.com/breaking-down-presence-detection-with-home-assistant/">https://philhawthorne.com/breaking-down-presence-detection-with-home-assistant/</a></p>
<p><a href="https://philhawthorne.com/making-home-assistants-presence-detection-not-so-binary/">https://philhawthorne.com/making-home-assistants-presence-detection-not-so-binary/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Automation of dumb devices</h1>
<p><a href="https://philhawthorne.com/making-dumb-dishwashers-and-washing-machines-smart-alerts-when-the-dishes-and-clothes-are-cleaned/">https://philhawthorne.com/making-dumb-dishwashers-and-washing-machines-smart-alerts-when-the-dishes-and-clothes-are-cleaned/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Using external Data Disk</h1>
<p><a href="https://peyanski.com/home-assistant-external-data-disk/">https://peyanski.com/home-assistant-external-data-disk/</a></p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>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.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_eb38d3613d558289.png" alt="Graphics showing the architecture of the data disk feature"></figure>
<p>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&nbsp;<a href="https://www.home-assistant.io/common-tasks/os/#backups"><u>Backup</u></a>&nbsp;before proceeding!</p>
<p>All data on the target disk will be overwritten!</p>
<p>The storage capacity of the external data disk must be larger than the storage capacity of the existing (boot) disk.</p>
<p>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&nbsp;<i>before</i>&nbsp;using it as a data disk again.</p>
<h3>USING UI TO MOVE THE DATA PARTITION</h3>
<p>Connect the data disk to your system.</p>
<p>Go to&nbsp;<a href="https://my.home-assistant.io/redirect/storage"><strong><u>Settings &gt; System &gt; Storage</u></strong></a>&nbsp;in the UI.</p>
<p>Press the three dots on the top right and choose “Move datadisk”</p>
<p>Select the data disk from the list of available devices.</p>
<p>Press “Move”.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_bb6004c436b08021.png" alt="Screenshot of the “Move datadisk” feature"></figure>
<h3>USING CLI TO MOVE THE DATA PARTITION</h3>
<p>To see the current data disk use:</p>
<p><code>$ ha os info</code></p>
<p>
</p>
<p><code>...</code></p>
<p>
</p>
<p><code>data_disk: /dev/mmcblk1p4</code></p>
<p>
</p>
<p><code>...</code></p>
<p>Sh</p>
<p>Copy</p>
<p>To get a list of potential targets which can be used by&nbsp;<code>datadisk</code>:</p>
<p><code>ha os datadisk list</code></p>
<p>Sh</p>
<p>Copy</p>
<p>To initiate the move to the new data disk use the&nbsp;<code>move</code>&nbsp;command:</p>
<p><code>ha os datadisk move /dev/sdx</code></p>
<p>Sh</p>
<p>Copy</p>
<p>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!</p>
<p>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).</p>
<p><br><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Save DB on USB stick/drive (Hassio)</h1>
<p><a href="https://community.home-assistant.io/t/save-db-on-usb-stick-drive-hassio/82144/24">https://community.home-assistant.io/t/save-db-on-usb-stick-drive-hassio/82144/24</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Running Home Assistant on a Raspberry Pi 3 from an external hard drive</h1>
<p><a href="https://mary.codes/blog/home_automation/running_home_assistant_from_an_external_hard_drive/">https://mary.codes/blog/home_automation/running_home_assistant_from_an_external_hard_drive/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/solved-mount-usb-drive-in-hassio-to-be-used-on-the-media-folder-with-udev-customization/258406/68">https://community.home-assistant.io/t/solved-mount-usb-drive-in-hassio-to-be-used-on-the-media-folder-with-udev-customization/258406/68</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>MQTT with RP2040</h1>
<p><a href="https://learn.adafruit.com/quickstart-rp2040-pico-with-wifi-and-circuitpython/internet-connect">https://learn.adafruit.com/quickstart-rp2040-pico-with-wifi-and-circuitpython/internet-connect</a></p>
<p><a href="https://www.tomshardware.com/how-to/send-and-receive-data-raspberry-pi-pico-w-mqtt">https://www.tomshardware.com/how-to/send-and-receive-data-raspberry-pi-pico-w-mqtt</a></p>
<p><a href="https://www.hackster.io/FrankDelporte/sending-sensor-data-from-raspberry-pi-pico-to-mqtt-445c97">https://www.hackster.io/FrankDelporte/sending-sensor-data-from-raspberry-pi-pico-to-mqtt-445c97</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Weather</h1>
<h2>accuweather</h2>
<p>BoraEr</p>
<p>ineedweather_90</p>
<p>Follow instruction here to create new App: <a href="https://www.home-assistant.io/integrations/accuweather">https://www.home-assistant.io/integrations/accuweather</a></p>
<p>app: ha_weather</p>
<p>API key: GV0GKNtlJZNUHYZ5YNW6YGySLVVz0Huq</p>
<p><br>&nbsp;</p>
<p>search location key: <a href="https://www.accuweather.com/en/browse-locations">https://www.accuweather.com/en/browse-locations</a></p>
<p><br>&nbsp;</p>
<p>Leinfelden: 2604235, <a href="https://www.accuweather.com/en/de/leinfelden/70771/weather-forecast/2604235">https://www.accuweather.com/en/de/leinfelden/70771/weather-forecast/2604235</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>create a sensor from the weather attributes to plot the data:</p>
<p><a href="https://community.home-assistant.io/t/how-to-extract-temperature-from-weather-card/143260/3">https://community.home-assistant.io/t/how-to-extract-temperature-from-weather-card/143260/3</a></p>
<p><br># Temperatur-Attribut als Extra-Wert</p>
<p>sensor<br>- platform: template<br>sensors:<br>norwegian_temperature:<br>friendly_name: "met.no Temperatur Vorhersage"<br>unit_of_measurement: '°C'<br>value_template: "{{ state_attr('weather.home_musberg', 'temperature') }}"</p>
<p><br>&nbsp;</p>
<h2>openweathermap</h2>
<p><a href="https://www.home-assistant.io/integrations/openweathermap/">https://www.home-assistant.io/integrations/openweathermap/</a></p>
<p><br>&nbsp;</p>
<p>BoraEr</p>
<p>ineedweather_90</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>animated icons in weather card</h2>
<p><a href="https://community.home-assistant.io/t/animated-weather-icons/206736">https://community.home-assistant.io/t/animated-weather-icons/206736</a></p>
<p><a href="https://github.com/wowgamr/animated-weather-card">https://github.com/wowgamr/animated-weather-card</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>read content of DB</h1>
<p><a href="https://sqlitebrowser.org/">https://sqlitebrowser.org/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>InfluxDB: Removing or deleting data</h1>
<p><a href="https://community.home-assistant.io/t/influxdb-removing-or-deleting-data/292637">https://community.home-assistant.io/t/influxdb-removing-or-deleting-data/292637</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Read external InfluxDB in Home Assistant as a sensor</h1>
<p><a href="https://itobey.dev/index.php/read-external-influxdb-in-home-assistant-as-sensor/">https://itobey.dev/index.php/read-external-influxdb-in-home-assistant-as-sensor/</a></p>
<p><br>&nbsp;</p>
<h1>Using both MariaDB and InfluxDB</h1>
<p><a href="https://smarthomescene.com/guides/optimize-your-home-assistant-database/">https://smarthomescene.com/guides/optimize-your-home-assistant-database/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>InfluxDB hassio add-on: changing default database location</h1>
<p><a href="https://community.home-assistant.io/t/influxdb-hassio-add-on-changing-default-database-location/172354/10">https://community.home-assistant.io/t/influxdb-hassio-add-on-changing-default-database-location/172354/10</a></p>
<p><a href="https://community.home-assistant.io/t/where-does-influx-store-db-files-in-hassio/105502">https://community.home-assistant.io/t/where-does-influx-store-db-files-in-hassio/105502</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>location of influxdb database: <a href="https://community.home-assistant.io/t/influxdb-location-of-database-on-hass-io/169916/15">https://community.home-assistant.io/t/influxdb-location-of-database-on-hass-io/169916/15</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Remote access</h1>
<p><a href="https://peyanski.com/home-assistant-remote-access/#What_if_Home_Assistant_Remote_Access_is_not_working_or_you_loose_your_local_access">https://peyanski.com/home-assistant-remote-access/#What_if_Home_Assistant_Remote_Access_is_not_working_or_you_loose_your_local_access</a></p>
<p><br><br>&nbsp;</p>
<p><a href="https://siytek.com/home-assistant-remote/">https://siytek.com/home-assistant-remote/</a></p>
<p><a href="https://community.home-assistant.io/t/how-to-configure-remote-access-with-lets-encrypt/391432">https://community.home-assistant.io/t/how-to-configure-remote-access-with-lets-encrypt/391432</a></p>
<p><br>&nbsp;</p>
<h2>create DuckDNS subdomain:</h2>
<p>Duckdns.org</p>
<p>account boraers@googlemail.com</p>
<p>type free</p>
<p>token 799093a4-0b34-454f-99cb-25a4637bf404</p>
<p>Domain: https://habora.duckdns.org</p>
<p><br>&nbsp;</p>
<p>attention: if router is restartet, configuration of duckdns has to be updated!</p>
<p><br>&nbsp;</p>
<p>to be accessed via the HA app:</p>
<p><a href="https://habora.duckdns.org:8123/">https://habora.duckdns.org:8123/</a></p>
<p><br>&nbsp;</p>
<p>https://192.168.178.32:8123/</p>
<p><br>&nbsp;</p>
<p>https://habora.duckdns.org</p>
<p>habora.duckdns.org</p>
<p>duckdns.org</p>
<h2>edit configuration of DuckDNS addon:</h2>
<p>domains:<br>- https://habora.duckdns.org<br>token: 799093a4-0b34-454f-99cb-25a4637bf404<br>aliases: []<br>lets_encrypt:<br>accept_terms: true<br>algo: secp384r1<br>certfile: fullchain.pem<br>keyfile: privkey.pem<br>seconds: 300</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>install Let's Encrypt addon</h2>
<p><br><br>&nbsp;</p>
<p>domains:<br>- habora.duckdns.org<br>email: boraers@googlemail.com<br>keyfile: privkey.pem<br>certfile: fullchain.pem<br>challenge: http<br>dns: {}</p>
<p><br>&nbsp;</p>
<h2>port forwarding in fritz.box</h2>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_382f235fa92119d6.png"></figure>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_b6f47a768db3e3a0.png"></figure>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_aa3e230b366baeb8.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Start Let's Encrypt addon</h2>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_b50f5b35e0e18814.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>check access via calling the subomain (no https yet)</h2>
<p><a href="http://192.168.178.32:8123/">http://192.168.178.32:8123/</a></p>
<p>→ this can be done already from the internet</p>
<p>→ the login screen of HA should appear</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Enable HTTPS on your HA Install</h2>
<p><br>&nbsp;</p>
<p>edit configuration.yaml:</p>
<p>http:</p>
<p>ssl_certificate: /ssl/fullchain.pem</p>
<p>ssl_key: /ssl/privkey.pem</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>attention: different HA installation need other paths:</p>
<p><a href="https://community.home-assistant.io/t/remote-access-for-home-assistant/206072">https://community.home-assistant.io/t/remote-access-for-home-assistant/206072</a></p>
<p>Home Assistant OS or Supervised: → Let's Encrypt addon must be installed!</p>
<p>http:</p>
<p>ssl_certificate: /ssl/fullchain.pem</p>
<p>ssl_key: /ssl/privkey.pem</p>
<p><br>&nbsp;</p>
<p>Home Assistant Container:</p>
<p>Youll need to mount the location with your SSL keys and certificates to /ssl/ in the container.</p>
<p>http:</p>
<p>ssl_certificate: /ssl/fullchain.pem</p>
<p>ssl_key: /ssl/privkey.pem</p>
<p><br>&nbsp;</p>
<p>Home Assistant Core:</p>
<p>http:</p>
<p>ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem</p>
<p>ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>restart HA</h2>
<p>after restart, HA should only be available via https:</p>
<p>internall: <a href="https://192.168.178.32:8123/">https://192.168.178.32:8123/</a></p>
<p>externall: <a href="https://habora.duckdns.org:8123/">https://habora.duckdns.org:8123/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Harden the Home Assistant Remote Access Security more</h2>
<p>Harden the Home Assistant remote access even more by enabling MFA</p>
<p><br>&nbsp;</p>
<p>Activating ip_ban_option and Multi-factor Authentication Modules is a must if you enable your Home Assistant Remote Access in the way that im showing with the port forwarding and SSL. So dont skip this!</p>
<p><br>&nbsp;</p>
<p><a href="https://www.youtube.com/watch?v=jblBRuW1lu4">https://www.youtube.com/watch?v=jblBRuW1lu4</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Fritz Box Aktualisierungsanforderung mit DuckDNS</h2>
<p><a href="https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7590/30_Dynamic-DNS-in-FRITZ-Box-einrichten/">https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7590/30_Dynamic-DNS-in-FRITZ-Box-einrichten/</a></p>
<p>Klicken Sie in der Benutzeroberfläche der FRITZ!Box auf "Internet".</p>
<p>Klicken Sie im Menü "Internet" auf "Freigaben".</p>
<p>Klicken Sie auf die Registerkarte "DynDNS".</p>
<p>Aktivieren Sie die Option "DynDNS benutzen".</p>
<p>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.</p>
<p>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.</p>
<p>Tragen Sie im Feld "Domainnamen" den Domainnamen ein, den Sie bei Ihrem Anbieter festgelegt haben.</p>
<p>Tragen Sie im Feld "Benutzername" den Benutzernamen Ihres Benutzerkontos beim Anbieter ein.</p>
<p>Tragen Sie im Feld "Kennwort" das Kennwort Ihres Benutzerkontos beim Anbieter ein.</p>
<p>Klicken Sie zum Speichern der Einstellungen auf "Übernehmen".</p>
<p>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.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>DuckDNS.org</p>
<p>Die Update-URL für die IPv4- und die IPv6-Adresse:</p>
<p>https://www.duckdns.org/update?domains=&lt;domain&gt;&amp;token=&lt;pass&gt;&amp;ip=&lt;ipaddr&gt;&amp;ipv6=&lt;ip6addr&gt;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>GoogleNest TTS issues after setting up ssl</h1>
<p><a href="https://www.home-assistant.io/integrations/tts">https://www.home-assistant.io/integrations/tts</a></p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/tts-with-ssl-on/207875/3">https://community.home-assistant.io/t/tts-with-ssl-on/207875/3</a></p>
<p><br>&nbsp;</p>
<p>DNS-Rebind-Schutz</p>
<p><a href="https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7390/663_DNS-Auflosung-privater-IP-Adressen-nicht-moglich/">https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7390/663_DNS-Auflosung-privater-IP-Adressen-nicht-moglich/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>formatting of dates</h1>
<p><br>&nbsp;</p>
<p>filename: /Data/cams/{{ now().strftime("%Y-%m-%d %H.%M.%S") }} {{ entity_id.name }}.jpg</p>
<p>filename: /tmp/armcrest_camera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg</p>
<p>filename: '/home/homeassistant/.homeassistant/www/armcrest_camera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'</p>
<p><br>&nbsp;</p>
<p>filename: &gt;-<br>/config/www/rtsp_esp32_{{ "%04d"|format(now().year) }}_{{<br>"%02d"|format(now().month) }}_{{ "%02d"|format(now().day)<br>}}_{{ "%02d"|format(now().hour) }}_{{ "%02d"|format(now().minute) }}_{{ "%02d"|format(now().second) }}.jpeg</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>HA Examples</h1>
<p><a href="https://www.home-assistant.io/examples/">https://www.home-assistant.io/examples/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Müllkalender</h1>
<p><a href="https://smarthomeyourself.de/wiki/homeassistant/muellkalender-darstellung-mit-tagen-datum-in-einer-zeile/">https://smarthomeyourself.de/wiki/homeassistant/muellkalender-darstellung-mit-tagen-datum-in-einer-zeile/</a></p>
<p>Der folgende Eintrag muss in die configuration.yaml</p>
<p>waste_collection_schedule:</p>
<p>sources:</p>
<p>- name: ics</p>
<p>args:</p>
<p>file: "www/abfall.ics"</p>
<p>customize:</p>
<p>- type: Restabfall</p>
<p>alias: Restabfall</p>
<p>icon: mdi:trash-can</p>
<p>- type: Papiertonne</p>
<p>alias: Papiertonne</p>
<p>icon: mdi:trash-can</p>
<p>- type: Bioabfall</p>
<p>alias: Bioabfall</p>
<p>icon: mdi:trash-can</p>
<p>fetch_time: "04:00"</p>
<p>day_switch_time: "10:00"</p>
<p><br>&nbsp;</p>
<p>sensor:</p>
<p>- platform: waste_collection_schedule</p>
<p>name: Papierabfall_date</p>
<p>value_template: '{{value.date.strftime("%d.%m.%Y")}}'</p>
<p>types:</p>
<p>- Papiertonne</p>
<p>- platform: waste_collection_schedule</p>
<p>name: Papierabfall_collection</p>
<p>value_template: "{{value.daysTo}}"</p>
<p>types:</p>
<p>- Papiertonne</p>
<p>&nbsp;</p>
<p>- platform: waste_collection_schedule</p>
<p>name: Restmuelltonne_date</p>
<p>value_template: '{{value.date.strftime("%d.%m.%Y")}}'</p>
<p>types:</p>
<p>- Restabfall</p>
<p>- platform: waste_collection_schedule</p>
<p>name: Restmuelltonne_collection</p>
<p>value_template: "{{value.daysTo}}"</p>
<p>types:</p>
<p>- Restabfall</p>
<p>&nbsp;</p>
<p>- platform: waste_collection_schedule</p>
<p>name: Biotonne_date</p>
<p>value_template: '{{value.date.strftime("%d.%m.%Y")}}'</p>
<p>types:</p>
<p>- Bioabfall</p>
<p>- platform: waste_collection_schedule</p>
<p>name: Biotonne_collection</p>
<p>value_template: "{{value.daysTo}}"</p>
<p>types:</p>
<p>- Bioabfall</p>
<p>&nbsp;</p>
<p>- platform: waste_collection_schedule</p>
<p>name: next_waste_collection_daysto</p>
<p>details_format: upcoming</p>
<p>value_template: '{{value.types|join(", ")}} in {{value.daysTo}} Tagen'</p>
<p>&nbsp;</p>
<p>#button-card#</p>
<p>- platform: waste_collection_schedule</p>
<p>name: MyButtonCardSensor</p>
<p>value_template: '{{value.types|join(", ")}}|{{value.daysTo}}|{{value.date.strftime("%d.%m.%Y")}}|{{value.date.strftime("%a")}}'</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Folgende Integrationen aus dem HACS Store sind dafür notwendig:</p>
<p>custom-cards/button-card</p>
<p>custom:multiple-entity-row</p>
<p><br>&nbsp;</p>
<p>type: entities</p>
<p>entities:</p>
<p>- entity: sensor.restmuelltonne_date</p>
<p>style: |</p>
<p>:host {</p>
<p>color: grey;</p>
<p>}</p>
<p>icon: 'mdi:delete-empty'</p>
<p>show_state: false</p>
<p>type: 'custom:multiple-entity-row'</p>
<p>name: Schwarze Tonne</p>
<p>secondary_info: last-changed</p>
<p>entities:</p>
<p>- entity: sensor.restmuelltonne_collection</p>
<p>name: Abholung in</p>
<p>unit: Tage(n)</p>
<p>- entity: sensor.restmuelltonne_date</p>
<p>name: Datum</p>
<p>- entity: sensor.biotonne_date</p>
<p>style: |</p>
<p>:host {</p>
<p>color: brown;</p>
<p>}</p>
<p>icon: 'mdi:bio'</p>
<p>show_state: false</p>
<p>type: 'custom:multiple-entity-row'</p>
<p>name: Braune Tonne</p>
<p>secondary_info: last-changed</p>
<p>entities:</p>
<p>- entity: sensor.biotonne_collection</p>
<p>name: Abholung in</p>
<p>unit: Tage(n)</p>
<p>- entity: sensor.biotonne_date</p>
<p>name: Datum</p>
<p>- entity: sensor.papierabfall_date</p>
<p>style: |</p>
<p>:host {</p>
<p>color: blue</p>
<p>}</p>
<p>icon: 'mdi:tree'</p>
<p>show_state: false</p>
<p>type: 'custom:multiple-entity-row'</p>
<p>name: Blaue Tonne</p>
<p>secondary_info: last-changed</p>
<p>entities:</p>
<p>- entity: sensor.papierabfall_collection</p>
<p>name: Abholung in</p>
<p>unit: Tage(n)</p>
<p>- entity: sensor.papierabfall_date</p>
<p>name: Datum</p>
<p>- entity: sensor.mybuttoncardsensor</p>
<p>type: 'custom:button-card'</p>
<p>layout: icon_name_state2nd</p>
<p>show_label: true</p>
<p>label: |</p>
<p>[[[</p>
<p>var days_to = entity.state.split("|")[1]</p>
<p>if (days_to == 0)</p>
<p>{ return "Heute" }</p>
<p>else if (days_to == 1)</p>
<p>{ return "Morgen" }</p>
<p>else</p>
<p>{ return "in " + days_to + " Tagen" }</p>
<p>]]]</p>
<p>show_name: true</p>
<p>name: |</p>
<p>[[[</p>
<p>return entity.state.split("|")[0]</p>
<p>]]]</p>
<p>state:</p>
<p>- color: red</p>
<p>operator: template</p>
<p>value: '[[[ return entity.state.split("|")[1] == 0 ]]]'</p>
<p>- color: orange</p>
<p>operator: template</p>
<p>value: '[[[ return entity.state.split("|")[1] == 1 ]]]'</p>
<p>- value: default</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>connect LED strip</h1>
<p><a href="https://de.banggood.com/SOLMORE-Smart-APP-WiFi-LED-Strip-Controller-+-24-Keys-Remote-Control-Work-with-Alexa-Google-Assistant-p-1658159.html?cur_warehouse=CN">https://de.banggood.com/SOLMORE-Smart-APP-WiFi-LED-Strip-Controller-+-24-Keys-Remote-Control-Work-with-Alexa-Google-Assistant-p-1658159.html?cur_warehouse=CN</a></p>
<p><strong>Connection step:</strong></p>
<p>The app name is "Smart Life", please search for and install the app on Google Play or Apple Store.</p>
<p>Step 1: Scan code download APP</p>
<p>Step 2: Make sure your phone is connected to wifi</p>
<p>Step 3: Press "+" to add the button and select "Lighting"</p>
<p>Step 4: Long press the controller to make the light flash</p>
<p>Step 5: Press the Confirm Flash button on your phone</p>
<p>Step 6: Enter the WiFi password and confirm</p>
<p>Step 7: Wait for the connection to succeed</p>
<p>Step 8: Start using</p>
<p><br>&nbsp;</p>
<p>boraers@gmail.com</p>
<p>tuyaforsmarthome_90</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.home-assistant.io/integrations/tuya">https://www.home-assistant.io/integrations/tuya</a></p>
<p>Cloud &gt; Development &gt;</p>
<p><br>&nbsp;</p>
<p><a href="https://iot.tuya.com/">https://iot.tuya.com/</a></p>
<p>boraers@googlemail.com</p>
<p>tuyaforsmarthome_90</p>
<p><br>&nbsp;</p>
<p>UserID: boraers@gmail.com</p>
<p><br>&nbsp;</p>
<p>Access ID/Client ID: 9wk4ecspwhveyycxev3r</p>
<p>Access Secret/Client Secret: 2c0ee61b3377443a88a94a611e1563e1</p>
<p>Project Code: p1671915179957wxkk7v</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>→ tuya integration in HA should recognize device → enter credentials</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://gadget-freakz.com/tuya-smart-life-integrated-into-home-assistant/#Smart_Life_application_tested">https://gadget-freakz.com/tuya-smart-life-integrated-into-home-assistant/#Smart_Life_application_tested</a></p>
<p>Add smart life to Home Assistant</p>
<p>You probably know us, we dont want to use more apps. we want to control everything from one central home automation platform: Home Assistant in our case.</p>
<p>As told before: Make sure to can devices added in Smart Life before you can add them into Home Assistant.</p>
<p><br>&nbsp;</p>
<p>For all the parameters and settings: https://www.home-assistant.io/components/tuya/</p>
<p><br>&nbsp;</p>
<p>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.</p>
<p><br>&nbsp;</p>
<p>tuya:</p>
<p>username: xxx</p>
<p>password: xxx</p>
<p>country_code: 49</p>
<p>platform: smart_life</p>
<p>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.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Use local Tuya</h1>
<p><a href="https://github.com/rospogrigio/localtuya">https://github.com/rospogrigio/localtuya</a></p>
<p><a href="https://community.home-assistant.io/t/am-i-missing-something-no-color-on-light-in-scene/373591/14">https://community.home-assistant.io/t/am-i-missing-something-no-color-on-light-in-scene/373591/14</a></p>
<p>Add your bulbs as new devices with the following settings:</p>
<p>ID: 20</p>
<p>Brightness: 22</p>
<p>Color Temperature: 23</p>
<p>Brightness Lower Value: 0</p>
<p>Brightness Upper Value: 1000</p>
<p>Color Mode: 21</p>
<p>Color: 24</p>
<p>Minimum Color Temperature: 2701</p>
<p>Maximum Color Temperature: 6499</p>
<p>Scene: 25</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Get local key tuya since June 2022:</h2>
<p><a href="https://community.home-assistant.io/t/get-local-key-tuya-since-june-2022/436399/7">https://community.home-assistant.io/t/get-local-key-tuya-since-june-2022/436399/7</a></p>
<p><a href="https://www.youtube.com/watch?v=2kfv0W80NYk&amp;t=481s">https://www.youtube.com/watch?v=2kfv0W80NYk&amp;t=481s</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>45625580bcddc2a2bf27: "local_key": "4b1e7572e8b54ca3", Hama_LED</p>
<p>bf3d5d9718ef1b2a8c5asm: "local_key": "67426b621cacaf5f", Treppe</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Issue: Connection to device succeeded but no datapoints found, please try again. Create a new issue and include debug logs if problem persists</p>
<p><a href="https://github.com/rospogrigio/localtuya/issues/183">https://github.com/rospogrigio/localtuya/issues/183</a></p>
<p>Adding in config manual works.</p>
<p><code>localtuya:</code></p>
<p>
</p>
<p><code>&nbsp; - host: 192.168.1.215</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; device_id: xxx</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; local_key: xxx</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; friendly_name: Tuya Device</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; protocol_version: "3.3"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; entities:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; - platform: sensor</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; friendly_name: Plug Voltage</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; id: 20</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; scaling: 0.1 # Optional</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; device_class: voltage # Optional</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; unit_of_measurement: "V" # Optional</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Flash Tasmota on Hama LED</h1>
<p><br>&nbsp;</p>
<p>Check compatibilit</p>
<p><a href="https://templates.blakadder.com/search.html">https://templates.blakadder.com/search.html</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><strong>Flashing:</strong></p>
<p><a href="https://siytek.com/esphome-vs-tasmota/#Flashing">https://siytek.com/esphome-vs-tasmota/#Flashing</a></p>
<p><a href="https://siytek.com/flashing-tasmota-methods/#Flashing-Tasmota-Online-using-Chrome-Browser">https://siytek.com/flashing-tasmota-methods/#Flashing-Tasmota-Online-using-Chrome-Browser</a></p>
<p><a href="https://tasmota.github.io/docs/Tuya-Convert/">https://tasmota.github.io/docs/Tuya-Convert/</a></p>
<p><br>&nbsp;</p>
<p><a href="https://siytek.com/tuya-convert-linux/">https://siytek.com/tuya-convert-linux/</a></p>
<p>sudo apt-get update</p>
<p>sudo apt-get upgrade</p>
<p>sudo apt-get install git</p>
<p>cd ~</p>
<p>git clone https://github.com/ct-Open-Source/tuya-convert</p>
<p>cd tuya-convert</p>
<p>sudo ./install_prereq.sh</p>
<p>sudo ./start_flash.sh</p>
<p><br>&nbsp;</p>
<p><strong>How To Use Tuya Convert On Raspberry Pi (Step-by-step Guide)</strong></p>
<p><a href="https://siytek.com/tuya-convert-and-raspberry-pi/">https://siytek.com/tuya-convert-and-raspberry-pi/</a></p>
<p>sudo apt-get update</p>
<p>sudo apt-get upgrade</p>
<p>sudo raspi-config → network options → select WiFi and enter your location and credentials → finish</p>
<p>rfkill unblock wifi</p>
<p>sudo apt-get install git</p>
<p>cd ~</p>
<p>git clone https://github.com/ct-Open-Source/tuya-convert</p>
<p>cd tuya-convert &amp;&amp; sudo su</p>
<p>sudo ./install_prereq.sh</p>
<p>sudo ./start_flash.sh</p>
<p><br>&nbsp;</p>
<p><a href="http://10.42.42.1/">http://10.42.42.1/</a> using tasmota-xxxxx SSID → 192.168.4.1</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><strong>timeout issue with latest Ri OS version!</strong></p>
<p><a href="https://github.com/ct-Open-Source/tuya-convert/issues/1022">https://github.com/ct-Open-Source/tuya-convert/issues/1022</a></p>
<p><a href="https://www.drejo.com/blog/neo-tuya-tasmota/">https://www.drejo.com/blog/neo-tuya-tasmota/</a></p>
<p>solution: install old version: <a href="https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2020-05-28/2020-05-27-raspios-buster-arm64.zip">https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2020-05-28/2020-05-27-raspios-buster-arm64.zip</a></p>
<p><br>&nbsp;</p>
<p><strong>issue</strong>: N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.</p>
<p><strong>solution</strong>: apt-get --allow-releaseinfo-change update</p>
<p><a href="https://support.prepaid-hoster.de/faq/de/virtuelle-server/apt-fehler-this-must-be-accepted-explicitly-before-updates-for-this-repository-can-be-applied.html">https://support.prepaid-hoster.de/faq/de/virtuelle-server/apt-fehler-this-must-be-accepted-explicitly-before-updates-for-this-repository-can-be-applied.html</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://siytek.com/how-to-set-up-tasmota-mqtt-auto-discovery-for-home-assistant/">https://siytek.com/how-to-set-up-tasmota-mqtt-auto-discovery-for-home-assistant/</a></p>
<p><a href="https://templates.blakadder.com/hama_00176547.html">https://templates.blakadder.com/hama_00176547.html</a></p>
<p>Hama 10W 806lm RGBW Bulb (00176547)</p>
<p>{"NAME":"Hama Smart WiF","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}</p>
<p><br>&nbsp;</p>
<p>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.</p>
<p><strong>SetOption19 onws</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><strong>Whether your wireless card support Access Point mode.</strong></p>
<p><a href="https://askubuntu.com/questions/180733/how-to-create-a-wi-fi-hotspot-in-access-point-mode/180734#180734">https://askubuntu.com/questions/180733/how-to-create-a-wi-fi-hotspot-in-access-point-mode/180734#180734</a></p>
<p>sudo apt-get update</p>
<p>sudo apt-get -y install aptitude</p>
<p>sudo aptitude install iw</p>
<p>iw list</p>
<p>→ Look for supported interface section, where it should be a entry called AP like below</p>
<p><br>&nbsp;</p>
<p><strong>updateBroadcom wifi driver</strong></p>
<p><a href="https://askubuntu.com/questions/55868/installing-broadcom-wireless-drivers">https://askubuntu.com/questions/55868/installing-broadcom-wireless-drivers</a></p>
<p><a href="https://www.technolaty.com/how-to-install-wireless-drivers-on-ubuntu/">https://www.technolaty.com/how-to-install-wireless-drivers-on-ubuntu/</a></p>
<p>sudo lshw -C network</p>
<p>sudo apt install firmware-b43-installer</p>
<p>sudo apt install linux-firmware</p>
<p>sudo reboot</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>simulate sunrise</h1>
<p>Sunrise:</p>
<p><a href="https://siytek.com/how-to-simulate-a-sunrise-with-home-assistant/">https://siytek.com/how-to-simulate-a-sunrise-with-home-assistant/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>RP2040 Micropython</h1>
<h2>PIR sensor + MQTT</h2>
<p><a href="https://www.tomshardware.com/how-to/send-and-receive-data-raspberry-pi-pico-w-mqtt">https://www.tomshardware.com/how-to/send-and-receive-data-raspberry-pi-pico-w-mqtt</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>install MicroPython firmware:</p>
<p><a href="https://www.tomshardware.com/how-to/raspberry-pi-pico-setup">https://www.tomshardware.com/how-to/raspberry-pi-pico-setup</a></p>
<p><a href="https://micropython.org/download/rp2-pico-w/">https://micropython.org/download/rp2-pico-w/</a></p>
<p>1. Download the MicroPython UF2 file for your model of Raspberry Pi Pico.</p>
<p><br>&nbsp;</p>
<p>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.</p>
<p><br>&nbsp;</p>
<p>3. Drag and drop the UF2 file on to the RPI-RP2 drive. The Raspberry Pi Pico will reboot and will now run MicroPython.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Ultrasonic sensor</h2>
<p><a href="https://microcontrollerslab.com/hc-sr04-ultrasonic-sensor-raspberry-pi-pico-micropython-tutorial/">https://microcontrollerslab.com/hc-sr04-ultrasonic-sensor-raspberry-pi-pico-micropython-tutorial/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Adafruit QT Py RP2040</h2>
<p><a href="https://learn.adafruit.com/adafruit-qt-py-2040">https://learn.adafruit.com/adafruit-qt-py-2040</a></p>
<p><br>&nbsp;</p>
<p>Micopthon formware:</p>
<p><a href="https://micropython.org/download/ADAFRUIT_QTPY_RP2040/">https://micropython.org/download/ADAFRUIT_QTPY_RP2040/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Seeed Xiao ESP32C3</h1>
<p><a href="https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/">https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Force influxdb to update in regular intervals</h1>
<p><a href="https://www.reddit.com/r/homeassistant/comments/pa8x5r/write_to_influxdb_at_regular_intervals/">https://www.reddit.com/r/homeassistant/comments/pa8x5r/write_to_influxdb_at_regular_intervals/</a></p>
<p><a href="https://community.home-assistant.io/t/send-metrics-to-influxdb-at-regular-intervals/9096">https://community.home-assistant.io/t/send-metrics-to-influxdb-at-regular-intervals/9096</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>water meter; AI-on-the-edge</h1>
<p><a href="https://www.youtube.com/watch?v=iUgxwbfkIqU">https://www.youtube.com/watch?v=iUgxwbfkIqU</a></p>
<p><a href="https://www.arducam.com/esp32-machine-vision-learning-guide/">https://www.arducam.com/esp32-machine-vision-learning-guide/</a></p>
<p><a href="https://www.youtube.com/watch?v=mDIJEyElkAU">https://www.youtube.com/watch?v=mDIJEyElkAU</a></p>
<p><a href="https://www.youtube.com/watch?v=zb3AEusPQLQ">https://www.youtube.com/watch?v=zb3AEusPQLQ</a></p>
<p><a href="https://www.youtube.com/watch?v=s6qQs4FN9B0">https://www.youtube.com/watch?v=s6qQs4FN9B0</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.thingiverse.com/thing:4573481">https://www.thingiverse.com/thing:4573481</a></p>
<p><a href="https://github.com/jomjol/AI-on-the-edge-device/wiki">https://github.com/jomjol/AI-on-the-edge-device/wiki</a></p>
<p><a href="https://github.com/jomjol/water-meter-system-complete">https://github.com/jomjol/water-meter-system-complete</a></p>
<p><br>&nbsp;</p>
<p><a href="https://www.hackster.io/mickeb/esp32-cam-real-time-water-usage-sensor-f9c29d">https://www.hackster.io/mickeb/esp32-cam-real-time-water-usage-sensor-f9c29d</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.youtube.com/watch?v=iUgxwbfkIqU&amp;t=2s">https://www.youtube.com/watch?v=iUgxwbfkIqU&amp;t=2s</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>water meter with image recognition on PC</h1>
<p><br>&nbsp;</p>
<p><a href="https://pyimagesearch.com/2017/02/13/recognizing-digits-with-opencv-and-python/">https://pyimagesearch.com/2017/02/13/recognizing-digits-with-opencv-and-python/</a></p>
<p><a href="https://www.geeksforgeeks.org/text-detection-and-extraction-using-opencv-and-ocr/">https://www.geeksforgeeks.org/text-detection-and-extraction-using-opencv-and-ocr/</a></p>
<p><a href="https://medium.com/pythoneers/text-detection-and-extraction-from-image-with-python-5c0c75a8ff14">https://medium.com/pythoneers/text-detection-and-extraction-from-image-with-python-5c0c75a8ff14</a></p>
<p><br>&nbsp;</p>
<p><a href="https://tesseract-ocr.github.io/tessdoc/Installation.html">https://tesseract-ocr.github.io/tessdoc/Installation.html</a></p>
<p><a href="https://tesseract-ocr.github.io/tessdoc/Command-Line-Usage.html#simplest-invocation-to-ocr-an-image">https://tesseract-ocr.github.io/tessdoc/Command-Line-Usage.html#simplest-invocation-to-ocr-an-image</a></p>
<p>tesseract input.txt output.txt -l eng --psm 3</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://medium.com/quantrium-tech/installing-and-using-tesseract-4-on-windows-10-4f7930313f82">https://medium.com/quantrium-tech/installing-and-using-tesseract-4-on-windows-10-4f7930313f82</a></p>
<p>need to add esseract to sstempath!!!</p>
<p>cd C:\Users\Bora_2\Downloads</p>
<p>tesseract ziffer4.jpg stdout -l eng</p>
<p>tesseract ziffer4.jpg output.txt</p>
<p>tesseract input.txt output.txt -l eng</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://tesseract-ocr.github.io/tessdoc/ImproveQuality.html#examples">https://tesseract-ocr.github.io/tessdoc/ImproveQuality.html#examples</a></p>
<p><br>&nbsp;</p>
<p><a href="https://github.com/tesseract-ocr/tesstrain">https://github.com/tesseract-ocr/tesstrain</a></p>
<p>make training MODEL_NAME=test-model DATA_DIR=/data GROUND_TRUTH_DIR=/data/foo-ground-truth</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>install GNU make on Win10</p>
<p><a href="https://leangaurav.medium.com/how-to-setup-install-gnu-make-on-windows-324480f1da69">https://leangaurav.medium.com/how-to-setup-install-gnu-make-on-windows-324480f1da69</a></p>
<p><a href="https://gnuwin32.sourceforge.net/packages/make.htm">https://gnuwin32.sourceforge.net/packages/make.htm</a></p>
<p>install software</p>
<p>add to PATH</p>
<p>C:\Program Files (x86)\GnuWin32\bin</p>
<p>Copy the path and jump to edit environment variables from windows search</p>
<p>Click Environment Variables.</p>
<p>Under user variables, find Path and click Edit.</p>
<p>Hit New, paste the copied path and hit Ok.</p>
<p>Hit OK on all other windows also.</p>
<p>Now open a fresh CMD/Terminal and type make and and hit Enter.</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://medium.com/@ahmetxgenc/how-to-use-tesseract-on-windows-fe9d2a9ba5c6">https://medium.com/@ahmetxgenc/how-to-use-tesseract-on-windows-fe9d2a9ba5c6</a></p>
<p>pip install pytesseract</p>
<p>pip install numpy</p>
<p>pip install opencv-python</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>$ tesseract help-psm</p>
<p>Page segmentation modes:</p>
<p>0 Orientation and script detection (OSD) only.</p>
<p>1 Automatic page segmentation with OSD.</p>
<p>2 Automatic page segmentation, but no OSD, or OCR. (not implemented)</p>
<p>3 Fully automatic page segmentation, but no OSD. (Default)</p>
<p>4 Assume a single column of text of variable sizes.</p>
<p>5 Assume a single uniform block of vertically aligned text.</p>
<p>6 Assume a single uniform block of text.</p>
<p>7 Treat the image as a single text line.</p>
<p>8 Treat the image as a single word.</p>
<p>9 Treat the image as a single word in a circle.</p>
<p>10 Treat the image as a single character.</p>
<p>11 Sparse text. Find as much text as possible in no particular order.</p>
<p>12 Sparse text with OSD.</p>
<p>13 Raw line. Treat the image as a single text line,</p>
<p>bypassing hacks that are Tesseract-specific.</p>
<p><br>&nbsp;</p>
<p>$ tesseract --help-oem</p>
<p>OCR Engine modes:</p>
<p>0 Legacy engine only.</p>
<p>1 Neural nets LSTM engine only.</p>
<p>2 Legacy + LSTM engines.</p>
<p>3 Default, based on what is available.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Training Tesseract on custom data</h2>
<p><a href="https://nanonets.com/blog/ocr-with-tesseract/#training-tesseract-on-custom-data">https://nanonets.com/blog/ocr-with-tesseract/#training-tesseract-on-custom-data</a></p>
<p><br>&nbsp;</p>
<p><a href="https://muthu.co/all-tesseract-ocr-options/">https://muthu.co/all-tesseract-ocr-options/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Edge Impulse</h1>
<p><a href="https://studio.edgeimpulse.com/studio/select-project">https://studio.edgeimpulse.com/studio/select-project</a></p>
<p><a href="https://www.arduino.coach/edge-impulse-demonstration-of-accurate-digits-recognition-with-the-arduino-portenta.html">https://www.arduino.coach/edge-impulse-demonstration-of-accurate-digits-recognition-with-the-arduino-portenta.html</a></p>
<p><br>&nbsp;</p>
<p><a href="https://github.com/edgeimpulse/example-esp32-cam">https://github.com/edgeimpulse/example-esp32-cam</a></p>
<p><br>&nbsp;</p>
<p><a href="https://www.survivingwithandroid.com/tinyml-esp32-cam-edge-image-classification-with-edge-impulse/">https://www.survivingwithandroid.com/tinyml-esp32-cam-edge-image-classification-with-edge-impulse/</a></p>
<p><br>&nbsp;</p>
<p><a href="https://peter-ing.medium.com/beginners-guide-to-object-detection-with-edge-impulse-c8ea95f844a0">https://peter-ing.medium.com/beginners-guide-to-object-detection-with-edge-impulse-c8ea95f844a0</a></p>
<p><br>&nbsp;</p>
<p><a href="https://docs.arduino.cc/tutorials/nano-33-ble-sense/edge-impulse">https://docs.arduino.cc/tutorials/nano-33-ble-sense/edge-impulse</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Tensorflow Lite</h1>
<p><a href="https://wiki.seeedstudio.com/XIAO-BLE-Sense-TFLite-Getting-Started/">https://wiki.seeedstudio.com/XIAO-BLE-Sense-TFLite-Getting-Started/</a></p>
<p><br>&nbsp;</p>
<p><a href="https://developer.android.com/codelabs/digit-classifier-tflite#0">https://developer.android.com/codelabs/digit-classifier-tflite#0</a></p>
<p><br>&nbsp;</p>
<p><a href="https://www.edgeimpulse.com/blog/get-plugged-in-to-the-future-of-smart-energy-meters">https://www.edgeimpulse.com/blog/get-plugged-in-to-the-future-of-smart-energy-meters</a></p>
<p><br>&nbsp;</p>
<p><a href="https://www.youtube.com/watch?v=pWp3PhYI-OU">https://www.youtube.com/watch?v=pWp3PhYI-OU</a></p>
<p><br>&nbsp;</p>
<p><a href="https://github.com/leriomaggio/deep-learning-keras-tensorflow">https://github.com/leriomaggio/deep-learning-keras-tensorflow</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Alarm system</h1>
<p><a href="https://scotthelme.co.uk/creating-a-house-alarm-system-with-home-assistant/">https://scotthelme.co.uk/creating-a-house-alarm-system-with-home-assistant/</a></p>
<p><a href="https://leonardosmarthomemakers.com/how-to-create-a-diy-alarm-system-with-home-assistant/">https://leonardosmarthomemakers.com/how-to-create-a-diy-alarm-system-with-home-assistant/</a></p>
<p><a href="https://smarthomescene.com/guides/alarmo-make-your-own-alarm-system-in-home-assistant/">https://smarthomescene.com/guides/alarmo-make-your-own-alarm-system-in-home-assistant/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>MICRO PYTHON ON ESP32 (HUZZAH32)</h1>
<p><a href="https://wolfpaulus.com/micro-python-esp32/">https://wolfpaulus.com/micro-python-esp32/</a></p>
<p><a href="https://learn.adafruit.com/adafruit-esp32-feather-v2/micropython-setup">https://learn.adafruit.com/adafruit-esp32-feather-v2/micropython-setup</a></p>
<p><a href="http://kentarotanaka.com/huzzah32-esp32-micropython-setup/">http://kentarotanaka.com/huzzah32-esp32-micropython-setup/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>install HACS</h1>
<p><a href="https://peyanski.com/how-to-install-home-assistant-community-store-hacs/">https://peyanski.com/how-to-install-home-assistant-community-store-hacs/</a></p>
<p>install addon Terminal &amp; SSH</p>
<p>enter follwing code into WEB UI: wget -q -O - https://install.hacs.xyz | bash -</p>
<p>Restart Server</p>
<p>search for integration hacs</p>
<p>select all 4 check boxes</p>
<p>enter github credentials</p>
<p>You can further enable AppDaemon and NetDaemon apps discovery &amp; tracking. In simple words these are more option to customize your Home Assistant.</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Camera</h1>
<h2>M5Stack Timer Camera X</h2>
<h3>Arduino</h3>
<p><a href="https://docs.m5stack.com/en/quick_start/timer_cam/arduino">https://docs.m5stack.com/en/quick_start/timer_cam/arduino</a></p>
<p><a href="https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/">https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/</a></p>
<p><a href="https://community.home-assistant.io/t/m5stack-unit-cam-with-esphome/474378">https://community.home-assistant.io/t/m5stack-unit-cam-with-esphome/474378</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.fambach.net/esp32-cam-modul/">https://www.fambach.net/esp32-cam-modul/</a></p>
<p>Kamera Fernsteuern: http://&lt;ip&gt;/control?var=&lt;Variablenname&gt;&amp;val=&lt;Wert&gt;</p>
<p>http://192.168.178.42/control?var=framesize&amp;val=3</p>
<p>http://192.168.178.42:81/stream</p>
<p>commands work with web_cam example! → web_cam_M5Stack_Timer-CAM_working</p>
<p><br>&nbsp;</p>
<p><a href="https://randomnerdtutorials.com/esp32-cam-ov2640-camera-settings/">https://randomnerdtutorials.com/esp32-cam-ov2640-camera-settings/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>entity_id: camera.cam1</p>
<p>filename: /config/www/snapshot.jpg</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_b0a3a1c1e3c3da03.jpg"></figure>
<p><br>&nbsp;</p>
<p>alias: take periodic pictures<br>description: ""<br>trigger:<br>- platform: time_pattern<br>minutes: /1<br>condition: []<br>action:<br>- service: camera.snapshot<br>data:<br>filename: &gt;-<br>/config/Timelapse/Plants_{{ "%04d"|format(now().year) }}_{{<br>"%02d"|format(now().month) }}_{{ "%02d"|format(now().day)<br>}}_{{ "%02d"|format(now().hour) }}_{{ "%02d"|format(now().minute) }}_{{ "%02d"|format(now().second) }}.jpeg<br>target:<br>entity_id: camera.esp32cam_1<br>mode: single</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h3>Micropython</h3>
<p><a href="https://lemariva.com/blog/2020/06/micropython-m5camera-timelapse-over-mqtt">https://lemariva.com/blog/2020/06/micropython-m5camera-timelapse-over-mqtt</a></p>
<p><a href="https://github.com/lemariva/uPyCam/tree/timelapse-camera">https://github.com/lemariva/uPyCam/tree/timelapse-camera</a></p>
<p><a href="https://github.com/lemariva/micropython-camera-driver">https://github.com/lemariva/micropython-camera-driver</a></p>
<p><br>&nbsp;</p>
<p>due to missing PSRAM, the micropython code does not work...</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Android controller for ESP32</h1>
<p><a href="https://www.youtube.com/watch?v=wrtNFFGXi5I&amp;t=363s">https://www.youtube.com/watch?v=wrtNFFGXi5I&amp;t=363s</a></p>
<p><a href="https://drive.google.com/file/d/17kUsL4qcdAIRIxtfcCf5VnePcwTSmhqX/view">https://drive.google.com/file/d/17kUsL4qcdAIRIxtfcCf5VnePcwTSmhqX/view</a></p>
<p><a href="https://play.google.com/store/apps/details?id=com.electro_tex.bluetoothcar">https://play.google.com/store/apps/details?id=com.electro_tex.bluetoothcar</a></p>
<p><br>&nbsp;</p>
<p><a href="https://www.youtube.com/watch?v=Pqs-3GgWW3s">https://www.youtube.com/watch?v=Pqs-3GgWW3s</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Python on Win10</h1>
<p>Install via Microsoft store</p>
<p><br><br>&nbsp;</p>
<p><a href="https://docs.python.org/3/library/venv.html">https://docs.python.org/3/library/venv.html</a></p>
<p>create new venv:</p>
<p>python -m venv “D:\Home Assistant\Micropython\myenv”</p>
<p><br>&nbsp;</p>
<p>activate in command prompt to install packages:</p>
<p>D:\”Home Assistant”\Python\myenv\Scripts\activate.bat</p>
<p>pip install ...</p>
<p>deactivate</p>
<p><br>&nbsp;</p>
<p>to see the new venv in VSCode:</p>
<p>Python: Select Interpreter → D:\Home Assistant\Micropython\myenv\Scripts\python.exe</p>
<p>then, restart VSCode</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>using password manager</h1>
<h2>KepassXC</h2>
<p><a href="https://keepassxc.org/download/">https://keepassxc.org/download/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Use Yubico: <a href="https://www.yubico.com/de/works-with-yubikey/catalog/keepassxc/">https://www.yubico.com/de/works-with-yubikey/catalog/keepassxc/</a></p>
<p>Database &gt; Database Security &gt; Add Additional protection… &gt; Add Challenge-Response → choose Yubikey from the drop-down menu</p>
<p><br>&nbsp;</p>
<h3>browser plugin:</h3>
<p><a href="https://keepassxc.org/docs/KeePassXC_GettingStarted.html#_setup_browser_integration">https://keepassxc.org/docs/KeePassXC_GettingStarted.html#_setup_browser_integration</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>keepass for Android</h2>
<p>KeePass2Android or KeePassDX</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Syncthing</h2>
<p>Download: <a href="https://docs.syncthing.net/users/contrib.html#contributions">https://docs.syncthing.net/users/contrib.html#contributions</a></p>
<p>Getting started: <a href="https://docs.syncthing.net/intro/getting-started.html#getting-started">https://docs.syncthing.net/intro/getting-started.html#getting-started</a></p>
<p>Default Folder: C:\Users\Bora_2\Sync</p>
<p><br>&nbsp;</p>
<p>Device Identification BoraNB: 3YHOKRG-D57OAYW-QW7Z23T-MQPGWLJ-ZGR4UCV-DUB-LX1: KOVYWX3-M6CXGFE-M4UQSQQ</p>
<p>VOHODHG-KXFA7RQ-5NQ6LM3-3HLMSXC-6XMN4BH-XCIA7GC-LBZGX2G-N4APPQJ</p>
<p><br>&nbsp;</p>
<p>Starting Syncthing Automatically: <a href="https://docs.syncthing.net/users/autostart.html">https://docs.syncthing.net/users/autostart.html</a></p>
<p>Windows:</p>
<p>create shortcut in following folder</p>
<p>folder: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup</p>
<p>Alternatively, in newer versions of Windows, open shell:startup from the Run command (Win+R).</p>
<p>path: "D:\Home Assistant\syncthing-windows-amd64-v1.22.2\syncthing.exe" --no-console --no-browser</p>
<p>open: <a href="http://localhost:8384/">http://localhost:8384</a></p>
<p>Linux</p>
<p><a href="https://docs.syncthing.net/users/autostart.html#linux">https://docs.syncthing.net/users/autostart.html#linux</a></p>
<p>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Soil sensor</h1>
<p><a href="https://learn.adafruit.com/adafruit-stemma-soil-sensor-i2c-capacitive-moisture-sensor">https://learn.adafruit.com/adafruit-stemma-soil-sensor-i2c-capacitive-moisture-sensor</a></p>
<p><br>&nbsp;</p>
<p>3D models for assembling Adafruit soil sensor:</p>
<p><a href="https://learn.adafruit.com/soil-node">https://learn.adafruit.com/soil-node</a></p>
<p><a href="https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io">https://learn.adafruit.com/pyportal-pet-planter-with-adafruit-io</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>use wildcard for mqtt topics in automations</h1>
<p><a href="https://community.home-assistant.io/t/mqtt-topic-wildcard/389382">https://community.home-assistant.io/t/mqtt-topic-wildcard/389382</a></p>
<p>topic: "stat/+/RESULT"</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/automation-based-on-mqtt-message-with-wildcard-and-value-condition/311518/6">https://community.home-assistant.io/t/automation-based-on-mqtt-message-with-wildcard-and-value-condition/311518/6</a></p>
<p>As you have already discovered, this is not an acceptable way to use a wildcard (#) in an MQTT topic:</p>
<p><br>&nbsp;</p>
<p>topic: "#/batt"</p>
<p>The # wildcard can appear at the end of a topic, like this:</p>
<p><br>&nbsp;</p>
<p>topic: "home/sensors/#"</p>
<p>or alone:</p>
<p><br>&nbsp;</p>
<p>topic: "#"</p>
<p>You didnt 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:</p>
<p><br>&nbsp;</p>
<p>topic: "home/OpenMQTTGateway/BttoMQTT/+/batt"</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/try-to-send-the-mqtt-payload-as-a-message-to-notify-mobile-app-in-ios/169197/6">https://community.home-assistant.io/t/try-to-send-the-mqtt-payload-as-a-message-to-notify-mobile-app-in-ios/169197/6</a></p>
<p><br>&nbsp;</p>
<p>data_template:</p>
<p>message: “{{ trigger.payload }}”</p>
<p>title: From mqtt_notifier</p>
<p>service: persistent_notification.create</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Tutorial to fix 401: Unauthorised Error with Grafana for mobile devices</h1>
<p><a href="https://community.home-assistant.io/t/tutorial-to-fix-401-unauthorised-error-with-grafana-for-mobile-devices/242622/9">https://community.home-assistant.io/t/tutorial-to-fix-401-unauthorised-error-with-grafana-for-mobile-devices/242622/9</a></p>
<p><br>&nbsp;</p>
<p>it works!</p>
<p>port forward router:<br>443 to 8123 tcp<br>and<br>80 to 3000 tcp<br>and grafana setings:</p>
<pre><code class="language-plaintext">plugins: []</code></pre>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Shelly configuration via web interface</h1>
<p><a href="https://kb.shelly.cloud/knowledge-base/shelly-plus-1pm-web-interface-guide">https://kb.shelly.cloud/knowledge-base/shelly-plus-1pm-web-interface-guide</a></p>
<p>192.168.33.1</p>
<p>Id: A8032AB82968</p>
<p>bedroom: shellyplus1pm-a8032ab82968 → 192.168.178.53</p>
<p>top child room: shellyplus1pm-a8032abba0b0 → 192.168.178.54</p>
<p>living room: shellyplusi4-a8032ab1d7d0 → 192.168.178.55</p>
<p>bed room: shellyplusi4-a8032ab1c9e0 → 192.168.178.56</p>
<p>shellyrgbw2-E0AC83 → 192.168.178.76</p>
<p><br><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_64332a2908217e72.png"></figure>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>FRITZ!Box 7530 GD</p>
<p>78302839617779115068</p>
<p><br><br>&nbsp;</p>
<p>MQTT credentials:</p>
<p>192.168.178.32:1883 → 192.168.178.52:1883</p>
<p>note4</p>
<p>note4</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_c2e67b530b770151.png"></figure>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><a href="https://shelly-api-docs.shelly.cloud/gen2/General/RPCChannels">https://shelly-api-docs.shelly.cloud/gen2/General/RPCChannels</a></p>
<p>shellyplus1pm-a8032ab82968/rpc</p>
<p>shellyplus1pm-a8032ab82968/events/rpc</p>
<p>shellyplusi4-a8032ab1d7d0/events/rpc</p>
<p>shellyplusi4-a8032ab1c9e0/events/rpc</p>
<p>shellyrgbw2-E0AC83/events/rpc</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.home-assistant.io/integrations/shelly/">https://www.home-assistant.io/integrations/shelly/</a></p>
<p>Generation 2 devices use the values btn_down, btn_up, single_push, double_push and long_push as click_type.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="http://192.168.178.53/rpc/Shelly.GetStatus">http://192.168.178.53/rpc/Shelly.GetStatus</a></p>
<p><br>&nbsp;</p>
<p>power consumption LED (green channel stuck at 100%; red LEDs not connected on one strip; in total ca. 250 LEDs):</p>
<p>green 100%: 7.7 W</p>
<p>green+blue 100%: 16.3 W</p>
<p>green+red 100%: 18.7 W</p>
<p>white = green+blue+red 100%: 26.4 W</p>
<p>green 100%+blue 50%+red 50%: 17.8 W</p>
<p>green 100%+blue 1%+red 1%: 9.7 W</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>nice automations:</p>
<p><a href="https://community.home-assistant.io/t/shelly-plus-i4-wall-switch-example-automation/401625">https://community.home-assistant.io/t/shelly-plus-i4-wall-switch-example-automation/401625</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>example to send command to shell:</p>
<p>service: mqtt.publish</p>
<p>data:</p>
<p>topic: homeassistant/shellyplus1pm-fgfloodlights/rpc</p>
<p>payload: &gt;-</p>
<p>{{ {id: 1, src:homeassistant/shellyplus1pm-fgfloodlights/status,</p><p>method:Shelly.GetStatus} | to_json }}</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Shelly integration via MQTT</h1>
<p><a href="https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Mqtt">https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Mqtt</a></p>
<p>&lt;model&gt; = shellyplus1pm</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://shelly-api-docs.shelly.cloud/gen1/#shelly1-1pm-mqtt">https://shelly-api-docs.shelly.cloud/gen1/#shelly1-1pm-mqtt</a></p>
<p>Shelly1/1PM: MQTT</p>
<p><br>&nbsp;</p>
<p>Shelly1 and Shelly1PM uses the following topics, where &lt;model&gt; is either shelly1 or shelly1pm:</p>
<p><br>&nbsp;</p>
<p>shellies/&lt;model&gt;-&lt;deviceid&gt;/relay/0 to report status: on, off or overpower (the latter only for Shelly1PM)</p>
<p>shellies/&lt;model&gt;-&lt;deviceid&gt;/relay/0/command accepts on, off or toggle and applies accordingly</p>
<p>shellies/&lt;model&gt;-&lt;deviceid&gt;/input/0 reports the state of the SW terminal</p>
<p>shellies/&lt;model&gt;-&lt;deviceid&gt;/longpush/0 reports longpush state as 0 (shortpush) or 1 (longpush)</p>
<p>shellies/&lt;model&gt;-&lt;deviceid&gt;/input_event/0 reports input event and event counter, e.g.: {"event":"S","event_cnt":2} see /status for details</p>
<p><br>&nbsp;</p>
<p>Shelly1PM adds:</p>
<p><br>&nbsp;</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/relay/0/power reports instantaneous power in Watts</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/relay/0/energy reports an incrementing energy counter in Watt-minute</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/temperature reports internal device temperature in °C</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/temperature_f reports internal device temperature in °F</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/overtemperature reports 1 when device has overheated, normally 0</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/temperature_status reports Normal, High, Very High</p>
<p>shellies/shelly1pm-&lt;deviceid&gt;/relay/0/overpower_value reports the value in Watts, on which an overpower condition is detected</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/shelly-gen-2-plus-and-pro-using-mqtt/347979/19">https://community.home-assistant.io/t/shelly-gen-2-plus-and-pro-using-mqtt/347979/19</a></p>
<p>mqtt:</p>
<p>switch:</p>
<p>- name: "Garage: Heat pump switch"</p>
<p>state_topic: "garage-heat-pump-switch-pm/status/switch:0"</p>
<p>value_template: "{{ value_json.output }}"</p>
<p>state_on: true</p>
<p>state_off: false</p>
<p>command_topic: "garage-heat-pump-switch-pm/rpc"</p>
<p>payload_on: '{"id":1, "src": "homeassistant", "method": "Switch.Set", "params":{"id":0,"on":true}}'</p>
<p>payload_off: '{"id":1, "src": "homeassistant", "method": "Switch.Set", "params":{"id":0,"on":false}}'</p>
<p>optimistic: false</p>
<p>qos: 1</p>
<p>retain: false</p>
<p>sensor:</p>
<p>- name: "Garage: Heat pump switch temperature"</p>
<p>unique_id: 4ca71dd5-645d-48e5-a387-a655cc7dd42e</p>
<p>state_topic: "garage-heat-pump-switch-pm/status/switch:0"</p>
<p>value_template: "{{ value_json.temperature.tC }}"</p>
<p>unit_of_measurement: "°C"</p>
<p>device_class: temperature</p>
<p>&nbsp;</p>
<p>- name: "Garage: Heat pump switch current power"</p>
<p>unique_id: 44f6d6de-be45-4697-8ff9-882fae91c6a2</p>
<p>state_topic: "garage-heat-pump-switch-pm/status/switch:0"</p>
<p>value_template: "{{ value_json.apower }}"</p>
<p>unit_of_measurement: "W"</p>
<p>device_class: power</p>
<p>&nbsp;</p>
<p>- name: "Garage: Heat pump switch total power"</p>
<p>unique_id: 44f6d6de-be45-4697-8ff9-882fae91c6a1</p>
<p>state_topic: "garage-heat-pump-switch-pm/status/switch:0"</p>
<p>value_template: "{{ value_json.aenergy.total }}"</p>
<p>unit_of_measurement: "W"</p>
<p>device_class: power</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.openhab.org/t/shelly-plus-1pm-via-mqtt/139826">https://community.openhab.org/t/shelly-plus-1pm-via-mqtt/139826</a></p>
<p>Hi folkes,<br>I am a bit inpatient and cannot waiting for the Shelly binding to cover the new devices and I read that due to the new ESP32 and new API, Shelly devices can now run cloud and MQTT in parallel. So if you start controlling your new devices (e.g. the Shelly Plus 1PM) via MQTT, you are not missing out on anything else. So here is my thing code for the Shelly Plus 1PM:</p>
<pre><code class="language-plaintext">UID: mqtt:topic:5d0f79cab1:b0df524d88</code></pre>
<p><br><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><a href="https://sequr.be/blog/2020/10/mqtt-templates-for-shelly-devices/#mqtt-templates">https://sequr.be/blog/2020/10/mqtt-templates-for-shelly-devices/#mqtt-templates</a></p>
<p>## /sensors/room_x/lamp.yaml</p>
<p><br><br>&nbsp;</p>
<p># Input type</p>
<p>- platform: mqtt</p>
<p>name: Room X - lamp - input</p>
<p>expire_after: 86400</p>
<p>qos: 1</p>
<p>state_topic: shellies/shelly1pm-[SHELLY ID]/input_event/0</p>
<p># Device temperature °C</p>
<p>- platform: mqtt</p>
<p>name: Room X - lamp - temperature</p>
<p>expire_after: 86400</p>
<p>qos: 1</p>
<p>device_class: temperature</p>
<p>unit_of_measurement: '°C'</p>
<p>icon: mdi:temperature-celcius</p>
<p>state_topic: shellies/shelly1pm-[SHELLY ID]/temperature</p>
<p># Device temperature °F</p>
<p>- platform: mqtt</p>
<p>name: Room X - lamp - temperature F</p>
<p>expire_after: 86400</p>
<p>qos: 1</p>
<p>device_class: temperature</p>
<p>unit_of_measurement: '°F'</p>
<p>icon: mdi:temperature-fahrenheit</p>
<p>state_topic: shellies/shelly1pm-[SHELLY ID]/temperature_f</p>
<p># Power consumption (live)</p>
<p>- platform: mqtt</p>
<p>name: Room X - lamp - power</p>
<p>expire_after: 86400</p>
<p>qos: 1</p>
<p>device_class: power</p>
<p>unit_of_measurement: 'W'</p>
<p>icon: mdi:lightning-bolt-outline</p>
<p>state_topic: shellies/shelly1pm-[SHELLY ID]/relay/0/power</p>
<p># Power consumption (since reboot)</p>
<p>- platform: mqtt</p>
<p>name: Room X - lamp - energy</p>
<p>expire_after: 86400</p>
<p>qos: 1</p>
<p>device_class: energy</p>
<p>state_class: total_increasing</p>
<p>unit_of_measurement: 'Wh'</p>
<p>value_template: "{{ value | float / 60 }}"</p>
<p>icon: mdi:lightning-bolt</p>
<p>state_topic: shellies/shelly1pm-[SHELLY ID]/relay/0/energy</p>
<p># Overpower</p>
<p>- platform: mqtt</p>
<p>name: Room X - lamp - overpower</p>
<p>expire_after: 86400</p>
<p>qos: 1</p>
<p>device_class: power</p>
<p>unit_of_measurement: 'W'</p>
<p>icon: mdi:flash-alert</p>
<p>state_topic: shellies/shelly1pm-[SHELLY ID]/overpower_value</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<h2>rgbw2 via mqtt</h2>
<p><a href="https://usa.shelly.cloud/knowledge-base/shelly-rgbw2/">https://usa.shelly.cloud/knowledge-base/shelly-rgbw2/</a></p>
<p><a href="https://community.home-assistant.io/t/shelly-rgbw2-automations-mqtt/234564">https://community.home-assistant.io/t/shelly-rgbw2-automations-mqtt/234564</a></p>
<p><a href="https://cyan-automation.medium.com/setting-up-a-white-shelly-rgbw2-using-mqtt-in-home-assistant-d7996db6ce7d">https://cyan-automation.medium.com/setting-up-a-white-shelly-rgbw2-using-mqtt-in-home-assistant-d7996db6ce7d</a></p>
<p>shellies/shellyrgbw2-E0AC83/white/3/status</p>
<p>shellies/shellyrgbw2-E0AC83/color/0/status</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Shelly integration via ESPHome</h1>
<p><a href="https://www.esphome-devices.com/devices/Shelly-Plus-1PM">https://www.esphome-devices.com/devices/Shelly-Plus-1PM</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Shelly firmware update</h1>
<h2>Via MQTT</h2>
<p><a href="https://community.home-assistant.io/t/shelly-firmware-updates/123123/2">https://community.home-assistant.io/t/shelly-firmware-updates/123123/2</a></p>
<p>in configuration.yaml, add the rest integration and configure like so:</p>
<p><br>&nbsp;</p>
<p>rest_command:</p>
<p>update_shelly:</p>
<p>url: 'http://{{ shelly_ip }}/ota?update=true'</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>create a new automation, eg. shellyupdate.yaml that looks like this:</p>
<p><br>&nbsp;</p>
<p>- alias: "Shelly New Firmware Notification"</p>
<p>id: 'snfn'</p>
<p>trigger:</p>
<p>platform: mqtt</p>
<p>topic: shellies/announce</p>
<p>condition:</p>
<p>condition: template</p>
<p>value_template: "{{ trigger.payload_json['new_fw'] == true }}"</p>
<p>action:</p>
<p>- service: persistent_notification.create</p>
<p>data_template:</p>
<p>title: "New Shelly Firmware Update Released. Update will be attempted."</p>
<p>message: Update will be attempted"</p>
<p>notification_id: "{{ trigger.payload_json['id'] }}"</p>
<p>- service: rest_command.update_shelly</p>
<p>data:</p>
<p>shelly_ip: "{{ trigger.payload_json['ip'] }}"</p>
<p>&nbsp;</p>
<p>- alias: "Shelly New Firmware Notification Removal"</p>
<p>id: 'snfnr'</p>
<p>trigger:</p>
<p>platform: mqtt</p>
<p>topic: shellies/announce</p>
<p>condition:</p>
<p>condition: template</p>
<p>value_template: "{{ trigger.payload_json['new_fw'] == false }}"</p>
<p>action:</p>
<p>service: persistent_notification.dismiss</p>
<p>data_template:</p>
<p>notification_id: "{{ trigger.payload_json['id'] }}"</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Via REST API</h2>
<p><a href="https://community.home-assistant.io/t/shelly-firmware-updates-using-shelly-integration-not-mqtt/323833">https://community.home-assistant.io/t/shelly-firmware-updates-using-shelly-integration-not-mqtt/323833</a></p>
<p>http://[IP-OF-SHELLY/ota?update=1 does the trick</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Node Red</h1>
<p><a href="https://smarthome.university/home-assistant/node-red/">https://smarthome.university/home-assistant/node-red/</a></p>
<p><br>&nbsp;</p>
<p><a href="https://funprojects.blog/2020/03/23/home-assistant-with-node-red/">https://funprojects.blog/2020/03/23/home-assistant-with-node-red/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Deye Wechselrichter</h1>
<p>Solarman?</p>
<p>See KeePassXC</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<h1>Using Wemos Lolin ESP32 boards</h1>
<h2>C3 Mini</h2>
<p><a href="https://www.wemos.cc/en/latest/c3/c3_mini.html">https://www.wemos.cc/en/latest/c3/c3_mini.html</a></p>
<p><br>&nbsp;</p>
<p><a href="https://www.fambach.net/d1-mini-esp8266-modul-2-3/">https://www.fambach.net/d1-mini-esp8266-modul-2-3/</a></p>
<p>static const uint8_t LED_BUILTIN = 7;</p>
<p>#define BUILTIN_LED LED_BUILTIN // backward compatibility</p>
<p>static const uint8_t TX = 21;</p>
<p>static const uint8_t RX = 20;</p>
<p>static const uint8_t SDA = 8;</p>
<p>static const uint8_t SCL = 10;</p>
<p>static const uint8_t SS = 5;</p>
<p>static const uint8_t MOSI = 4;</p>
<p>static const uint8_t MISO = 3;</p>
<p>static const uint8_t SCK = 2;</p>
<p>static const uint8_t A0 = 0;</p>
<p>static const uint8_t A1 = 1;</p>
<p>static const uint8_t A2 = 2;</p>
<p>static const uint8_t A3 = 3;</p>
<p>static const uint8_t A4 = 4;</p>
<p>static const uint8_t A5 = 5;</p>
<p><br>&nbsp;</p>
<p>Wifi funktioniert nicht → Wifi TX auf 8,5 dBm setzen:</p>
<p>WiFi.setTxPower(WIFI_POWER_8_5dBm);</p>
<p><br>&nbsp;</p>
<h3>Arduino:</h3>
<p>Configure Board</p>
<p>Use lastest esp32 arduino package</p>
<p>Choose board LOLIN C3 MINI</p>
<p>Upload Code</p>
<p>Make C3 boards into Device Firmware Upgrade (DFU) mode.</p>
<p>Hold on Button 9</p>
<p>Press Button Reset</p>
<p>Release Button 9 When you hear the prompt tone on usb reconnection</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Wemos S2 Pico</h2>
<p>D:\”Home Assistant”\Python\myenv\Scripts\activate.bat</p>
<p>pip install esptool</p>
<p><br>&nbsp;</p>
<p>Make S2 boards into Device Firmware Upgrade (DFU) mode.</p>
<p>&nbsp;</p>
<p>Hold on Button 0</p>
<p>Press Button Reset</p>
<p>Release Button 0 When you hear the prompt tone on usb reconnection</p>
<p>Flash using esptool.py</p>
<p>esptool.py --port PORT_NAME erase_flash</p>
<p>esptool.py --port COM20 erase_flash</p>
<p>esptool.py --port PORT_NAME --baud 1000000 write_flash -z 0x1000 FIRMWARE.bin</p>
<p>esptool.py --port PORT_NAME --baud 1000000 write_flash -z 0x1000 FIRMWARE.bin</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://codeandlife.com/2022/02/25/using-ssd1306-oled-wemos-s2-pico-esp32-s2-board/">https://codeandlife.com/2022/02/25/using-ssd1306-oled-wemos-s2-pico-esp32-s2-board/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://microcontrollerslab.com/oled-display-raspberry-pi-pico-micropython-tutorial/">https://microcontrollerslab.com/oled-display-raspberry-pi-pico-micropython-tutorial/</a></p>
<h2>SSD1306 OLED MicroPython Library</h2>
<p><strong>We will have to install the SSD1306 OLED library for MicroPython to continue with our project.</strong></p>
<p><strong>To successfully do that, open your Thonny IDE with your Raspberry Pi Pico plugged in your system. Go to&nbsp;Tools &gt; Manage Packages. This will open up the Thonny Package Manager.</strong></p>
<p><br><br>&nbsp;</p>
<p><strong>Search for “ssd1306” in the search bar by typing its name and clicking the button Search on PyPI.</strong></p>
<p><br><br>&nbsp;</p>
<p><strong>From the following search results click on the one highlighted below: micropython-ssd1306</strong></p>
<p><br><br>&nbsp;</p>
<p><strong>Install this library.</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Home Assistant presence simulation</h1>
<p><a href="https://github.com/slashback100/presence_simulation">https://github.com/slashback100/presence_simulation</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://blog.jonsdocs.org.uk/2022/08/29/simulating-presence-with-home-assistant/">https://blog.jonsdocs.org.uk/2022/08/29/simulating-presence-with-home-assistant/</a></p>
<p><br>&nbsp;</p>
<p>I created an toggle helper called&nbsp;<code>input_boolean.holidaymode</code>:</p>
<p>Go to&nbsp;<i>Settings</i>&nbsp;then&nbsp;<i>Devices &amp; Services</i></p>
<p>Click on the&nbsp;<i>Helpers&nbsp;</i>tab (in the web interace this will be at the top, on the Android app it's an icon at the bottom</p>
<p>Click&nbsp;<i>create helper</i></p>
<p>Choose&nbsp;<i>Toggle</i></p>
<p>Type a name (e.g.,&nbsp;<code>HolidayMode</code>) and choose an icon (e.g.,&nbsp;<code>mdi:beach</code>) and click&nbsp;<i>Create</i></p>
<p>The list of helpers will now include&nbsp;<code>input_boolean.holidaymode</code></p>
<p>As the automation stores the light it is going to change (switch on or off) in the "<i>light to switch</i>" variable, we need to create that.</p>
<p>Go to&nbsp;<i>Settings</i>&nbsp;then&nbsp;<i>Devices &amp; Services</i></p>
<p>Click on the&nbsp;<i>Helpers&nbsp;</i>tab (in the web interace this will be at the top, on the Android app it's an icon at the bottom</p>
<p>Click&nbsp;<i>create helper</i></p>
<p>Choose&nbsp;<i>Text</i></p>
<p>For name, type&nbsp;<code>light_to_switch</code>&nbsp;and leave the other options as their defaults</p>
<p>Click&nbsp;<i>Create</i></p>
<p>The list of helpers will now include&nbsp;<code>input_text.light_to_switch</code></p>
<p>Once we've created the light group we'll be referencing it by name in the automation.</p>
<p>Go to&nbsp;<i>Settings</i>&nbsp;then&nbsp;<i>Devices &amp; Services</i></p>
<p>Click on the&nbsp;<i>Helpers&nbsp;</i>tab (in the web interace this will be at the top, on the Android app it's an icon at the bottom</p>
<p>Click&nbsp;<i>create helper</i></p>
<p>Choose&nbsp;<i>Group</i>&nbsp;(a circle with three dots in it)</p>
<p>When asked what type of group this is, choose&nbsp;<i>Light group</i></p>
<p>Give your group a name (e.g., "Presence simulation lights") and choose the members to include in the group</p>
<p>Click&nbsp;<i>Submit</i></p>
<p>In the helpers list you'll see a group called&nbsp;<code>light.presence_simulation_lights</code>&nbsp;- copy this name exactly as we'll need it in the automation</p>
<p>Create automation - random lights on</p>
<p><code>alias: "Holiday mode: Presence simulation"</code></p>
<p>
</p>
<p><code>trigger:</code></p>
<p>
</p>
<p><code>&nbsp; - platform: time_pattern</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; minutes: /30</code></p>
<p>
</p>
<p><code>condition:</code></p>
<p>
</p>
<p><code>&nbsp; - condition: state</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; entity_id: input_boolean.holidaymode</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; state: "on"</code></p>
<p>
</p>
<p><code>&nbsp; - condition: sun</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; after: sunset</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; after_offset: "-00:30:00"</code></p>
<p>
</p>
<p><code>&nbsp; - condition: time</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; before: "22:00:00"</code></p>
<p>
</p>
<p><code>action:</code></p>
<p>
</p>
<p><code>&nbsp; - delay: 00:{{ '{:02}'.format(range(0,30) | random | int) }}:00</code></p>
<p>
</p>
<p><code>&nbsp; - service: input_text.set_value</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; data_template:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; entity_id: input_text.light_to_switch</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; value: "{{ state_attr('light.presence_simulation_lights','entity_id') | random }}"</code></p>
<p>
</p>
<p><code>&nbsp; - service: homeassistant.toggle</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; data_template:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; entity_id: "{{states('input_text.light_to_switch')}}"</code></p>
<p>
</p>
<p><code>initial_state: true</code></p>
<p>
</p>
<p><code>hide_entity: false</code></p>
<p><br>&nbsp;</p>
<p>Create automation - lights off at random bedtime</p>
<p><code>alias: "Holiday mode: Turning off all toggled lights"</code></p>
<p>
</p>
<p><code>description: ""</code></p>
<p>
</p>
<p><code>trigger:</code></p>
<p>
</p>
<p><code>&nbsp; - platform: time</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; at: "23:00:00"</code></p>
<p>
</p>
<p><code>condition:</code></p>
<p>
</p>
<p><code>&nbsp; - condition: state</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; entity_id: input_boolean.holidaymode</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; state: "on"</code></p>
<p>
</p>
<p><code>action:</code></p>
<p>
</p>
<p><code>&nbsp; - delay: 00:{{ range(15,59) | random | int }}:00</code></p>
<p>
</p>
<p><code>&nbsp; - service: homeassistant.turn_off</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; data: {}</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; target:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; entity_id: light.presence_simulation_lights</code></p>
<p>
</p>
<p><code>initial_state: true</code></p>
<p>
</p>
<p><code>hide_entity: false</code></p>
<p>
</p>
<p><code>mode: single</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://blog.mornati.net/home-assistant-simple-presence-simulation-script">https://blog.mornati.net/home-assistant-simple-presence-simulation-script</a></p>
<p><br><br>&nbsp;</p>
<p>Add the following script in your scripts configuration file (ie&nbsp;<code>scripts.yaml</code>)</p>
<p>COPY</p>
<p><code>light_duration:</code></p>
<p>
</p>
<p><code>&nbsp; mode: parallel&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; description: "Turns on a light for a while, and then turns it off"</code></p>
<p>
</p>
<p><code>&nbsp; fields:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; light:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; description: "A specific light"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; example: "light.bedroom"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; duration:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; description: "How long the light should be on in minutes"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; example: "25"</code></p>
<p>
</p>
<p><code>&nbsp; sequence:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - service: homeassistant.turn_on</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; data:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; entity_id: "{{ light }}"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - delay: "{{ duration }}"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - service: homeassistant.turn_off</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; data:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; entity_id: "{{ light }}"</code></p>
<p><br>&nbsp;</p>
<p>The automation will then start the script providing the correct parameters.</p>
<p>COPY</p>
<p><code>- id: random_away_lights</code></p>
<p>
</p>
<p><code>&nbsp; alias: "Random Away Lights"</code></p>
<p>
</p>
<p><code>&nbsp; mode: parallel&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; trigger:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - platform: time_pattern</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; minutes: "/30"</code></p>
<p>
</p>
<p><code>&nbsp; condition:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - condition: state</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; entity_id: input_boolean.away</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; state: "on"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - condition: sun</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; after: sunset</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; after_offset: "-00:30:00"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - condition: time</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; before: "23:59:00"</code></p>
<p>
</p>
<p><code>&nbsp; action:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; service: script.light_duration</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; data:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; light: "{{states.group.simulation_lights.attributes.entity_id | random}}"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; duration: "00:{{ '{:02}'.format(range(5,30) | random | int) }}:00"</code></p>
<p><br>&nbsp;</p>
<p>I created a group with a list of lights I want to use to simulate the presence. I put only the lights within the rooms visible from the outside.</p>
<p>COPY</p>
<p><code>simulation_lights:</code></p>
<p>
</p>
<p><code>&nbsp; name: Lights Presence Simulation</code></p>
<p>
</p>
<p><code>&nbsp; entities:</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - light.salle_manger</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - light.cuisine_table</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - light.bureau_marco</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; - light.salon_corner</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>scheduler-component</h2>
<p><a href="https://github.com/nielsfaber/scheduler-component">https://github.com/nielsfaber/scheduler-component</a></p>
<p><a href="https://github.com/nielsfaber/scheduler-card">https://github.com/nielsfaber/scheduler-card</a></p>
<p><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>reduce size of database</h1>
<p><a href="https://www.home-assistant.io/integrations/recorder">https://www.home-assistant.io/integrations/recorder</a></p>
<p>recorder:</p>
<p>purge_keep_days: 5</p>
<p>db_url: sqlite:////home/user/.homeassistant/test</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/simple-way-to-reduce-your-db-size/234787">https://community.home-assistant.io/t/simple-way-to-reduce-your-db-size/234787</a></p>
<p>open up a terminal (SSH or via web, I use this extension for this purpose&nbsp;<a href="https://github.com/hassio-addons/addon-ssh">https://github.com/hassio-addons/addon-ssh&nbsp;130</a>)</p>
<p>change directory to config&nbsp;<code>cd ~/config</code></p>
<p>open sqlite shell&nbsp;<code>sqlite3 home-assistant_v2.db</code></p>
<p>enter the following commands in the shell:<br><code>.header on</code><br><code>.mode column</code><br><code>.width 50, 10,</code><br><code>SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 20;</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/how-to-keep-your-recorder-database-size-under-control/295795">https://community.home-assistant.io/t/how-to-keep-your-recorder-database-size-under-control/295795</a></p>
<p>homeassistant:</p>
<p>allowlist_external_dirs:</p>
<p>- /config</p>
<p>sensor:</p>
<p>- platform: filesize</p>
<p>file_paths:</p>
<p>- /config/home-assistant_v2.db</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_1a71f91fe23da888.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>WIZ light scenes</h1>
<p><a href="https://github.com/sbidy/pywizlight/blob/a11d2c7744d7110eb42ce8af5eddb3f6f40bd228/pywizlight/scenes.py">https://github.com/sbidy/pywizlight/blob/a11d2c7744d7110eb42ce8af5eddb3f6f40bd228/pywizlight/scenes.py</a></p>
<p>SCENES = {</p>
<p>1: "Ocean",</p>
<p>2: "Romance",</p>
<p>3: "Sunset",</p>
<p>4: "Party",</p>
<p>5: "Fireplace",</p>
<p>6: "Cozy",</p>
<p>7: "Forest",</p>
<p>8: "Pastel Colors",</p>
<p>9: "Wake up",</p>
<p>10: "Bedtime",</p>
<p>11: "Warm White",</p>
<p>12: "Daylight",</p>
<p>13: "Cool white",</p>
<p>14: "Night light",</p>
<p>15: "Focus",</p>
<p>16: "Relax",</p>
<p>17: "True colors",</p>
<p>18: "TV time",</p>
<p>19: "Plantgrowth",</p>
<p>20: "Spring",</p>
<p>21: "Summer",</p>
<p>22: "Fall",</p>
<p>23: "Deepdive",</p>
<p>24: "Jungle",</p>
<p>25: "Mojito",</p>
<p>26: "Club",</p>
<p>27: "Christmas",</p>
<p>28: "Halloween",</p>
<p>29: "Candlelight",</p>
<p>30: "Golden white",</p>
<p>31: "Pulse",</p>
<p>32: "Steampunk",</p>
<p>1000: "Rhythm",</p>
<p>}</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>ESP32 Wifi repeater</h1>
<p><a href="https://iotprojectsideas.com/portable-esp32-wifi-repeater/">https://iotprojectsideas.com/portable-esp32-wifi-repeater/</a></p>
<p><br>&nbsp;</p>
<p>download repository and flash tool:</p>
<p><a href="https://github.com/martin-ger/esp32_nat_router">https://github.com/martin-ger/esp32_nat_router</a></p>
<p><a href="https://www.espressif.com/en/support/download/other-tools">https://www.espressif.com/en/support/download/other-tools</a></p>
<p><br>&nbsp;</p>
<p>run the tool and select the three files in the folder D:\Home Assistant\ESP32_wifi_repeater\esp32_nat_router-master\build\esp32: bootloader.bin, firmware.bin, partitions.bin</p>
<p><br>&nbsp;</p>
<p>Now, we also need to specify the hex code indicating where the files are. For the bootloader type 0x1000, for esp32 nat router file type 0x10000, and for partition file type 0x8000.</p>
<p><br>&nbsp;</p>
<p>Press and hold the boot button on your ESP32 board and click on the start button to start flashing firmware.</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_a271954676b4d389.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>After the first boot, it provides an open WiFi SSID “ESP32_NAT_Router“. Connect to this WiFi network and perform basic configuration via a simple web interface.</p>
<p><br>&nbsp;</p>
<p>The web interface allows for the configuration of all the parameters required for basic forwarding functionality. Open your web browser and enter the following address: “<strong>http://192.168.4.1</strong>“. Now you should see the following page.</p>
<p><br>&nbsp;</p>
<p>Firstly, in the “STA Settings” enter the correct WiFi credentials of your main WiFi network that you want to extend. Leave the password field for open networks. Click on “Connect“. The ESP32 reboots and will connect to your WiFi router. You should see the status LED ON after a few seconds.</p>
<p><br>&nbsp;</p>
<p>You can now reload the page and change the “AP Settings“. Enter New SSID and Password and click “Set” and again the ESP reboots. Now it is ready for forwarding traffic over the newly configured Access Point.</p>
<p><br>&nbsp;</p>
<p><strong>SSID: ESP32_NAT_Router</strong></p>
<p><strong>pass: mysupersecurepassword</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>install home assistant in docker</h1>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>install Docker</h2>
<p>192.168.178.52</p>
<p>pi</p>
<p>raspberry</p>
<p><br>&nbsp;</p>
<p><a href="https://raspberrytips.com/docker-on-raspberry-pi/">https://raspberrytips.com/docker-on-raspberry-pi/</a></p>
<p>sudo apt update</p>
<p>sudo apt upgrade -y</p>
<p>sudo reboot</p>
<p>curl -sSL https://get.docker.com | sh</p>
<p>Allow Docker to be used without being a root → So, here is the command to add the current user to the docker group: sudo usermod -aG docker $USER → sudo usermod -aG docker pi</p>
<p>Exit your SSH session, or restart the Raspberry Pi, and you should then be able to run any docker command without sudo. → docker ps → If it works, you are ready to move forward.</p>
<p>Test your Docker setup: docker run hello-world</p>
<p><br>&nbsp;</p>
<h3>Docker commands you need to know</h3>
<p>Monitor the running containers:</p>
<p>docker ps</p>
<p>Display the current version of Docker:</p>
<p>docker version</p>
<p>Download a new image:</p>
<p>docker pull [IMAGE]</p>
<p>Run an image (and download it if not existing on your local system):</p>
<p>docker run [IMAGE]</p>
<p>Search for an image in the Docker repository:</p>
<p>docker search [X]</p>
<p>Show the usage statistics:</p>
<p>docker stats</p>
<p>Display the list of all the Docker commands:</p>
<p>docker help</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>install HA on docker</h2>
<p><a href="https://www.home-assistant.io/installation/raspberrypi#install-home-assistant-container">https://www.home-assistant.io/installation/raspberrypi#install-home-assistant-container</a></p>
<p>docker run -d \</p>
<p>--name homeassistant \</p>
<p>--privileged \</p>
<p>--restart=unless-stopped \</p>
<p>-e TZ=Europe/Berlin \</p>
<p>-v /PATH_TO_YOUR_CONFIG:/config \</p>
<p>--network=host \</p>
<p>ghcr.io/home-assistant/home-assistant:stable</p>
<p><br>&nbsp;</p>
<p>Once the Home Assistant Container is running Home Assistant should be accessible using http://&lt;host&gt;:8123</p>
<p>http://192.168.178.52:8123</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>RESTART HOME ASSISTANT</p>
<p>docker restart homeassistant</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>configuration</h2>
<p><a href="https://community.home-assistant.io/t/configurator-file-editor-for-ha-core-in-docker/238472/4">https://community.home-assistant.io/t/configurator-file-editor-for-ha-core-in-docker/238472/4</a></p>
<p>cd ~/docker</p>
<p>mkdir configurator</p>
<p>cd configurator</p>
<p>sudo nano docker-compose.yaml</p>
<p><br>&nbsp;</p>
<p><strong>version: "3.5"</strong></p>
<p><strong>services:</strong></p>
<p><strong>configurator:</strong></p>
<p><strong>container_name: configurator</strong></p>
<p><strong>image: causticlab/hass-configurator-docker:latest</strong></p>
<p><strong>restart: always</strong></p>
<p><strong>network_mode: host</strong></p>
<p><strong>labels:</strong></p>
<p><strong>- "com.centurylinklabs.watchtower.enable=true" # for Watchtower automatic updates</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- "3218:3218/tcp"</strong></p>
<p><strong>volumes:&nbsp;</strong></p>
<p><strong>- ${HASSIODIR}/:/config # map this volume to your hassio config directory</strong></p>
<p><strong>environment:&nbsp;</strong></p>
<p><strong>- HC_BASEPATH=/config</strong></p>
<p><strong>- HC_HASS_API_PASSWORD=${CONFIGURATORPSWD} #Create a Long-Lived Access Token</strong></p>
<p><strong>- HC_IGNORE_SSL=True&nbsp;</strong></p>
<p><strong>- PUID=${PUID}</strong></p>
<p><strong>- PGID=${PGID}</strong></p>
<p><strong>- TZ=${TZ}'</strong></p>
<p><br>&nbsp;</p>
<p>docker-compose up -d</p>
<p><br>&nbsp;</p>
<p>http://192.168.178.52:3218</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/configure-ssl-with-docker/196878">https://community.home-assistant.io/t/configure-ssl-with-docker/196878</a></p>
<p>edit configuration.yaml:</p>
<p><strong>http:</strong></p>
<p><strong>base_url: https://myhomeassistant.com:8123</strong></p>
<p><strong>ssl_certificate: /config/fullchain.pem</strong></p>
<p><strong>ssl_key: /config/privkey.pem</strong></p>
<p><br>&nbsp;</p>
<p>create certifactes:</p>
<p>cd /PATH_TO_YOUR_CONFIG</p>
<p>sudo openssl req -sha256 -addext "subjectAltName = IP:192.168.178.52" -newkey rsa:4096 -nodes -keyout privkey.pem -x509 -days 730 -out fullchain.pem</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>install Nginx on docker</h2>
<p>Home Assistant in Docker with Nginx and Let's Encrypt on Raspberry Pi</p>
<p><br>&nbsp;</p>
<p>cd ~/docker</p>
<p>mkdir proxy</p>
<p>cd proxy</p>
<p>sudo nano docker-compose.yaml</p>
<p><br>&nbsp;</p>
<p><strong>version: '3'</strong></p>
<p><strong>services:</strong></p>
<p><strong>nginx:</strong></p>
<p><strong>image: arm64v8/nginx</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- "80:80"</strong></p>
<p><strong>volumes:</strong></p>
<p><strong>- ./data/nginx:/etc/nginx/conf.d:ro</strong></p>
<p><strong>- ./data/wwwroot:/var/www/root:ro</strong></p>
<p><br>&nbsp;</p>
<p>mkdir data</p>
<p>cd data</p>
<p>mkdir nginx</p>
<p>cd nginx</p>
<p>sudo nano app.conf</p>
<p><br>&nbsp;</p>
<p><strong>server {</strong></p>
<p><strong>listen 80;</strong></p>
<p><strong>server_name habora.duckdns.org; #replace this</strong></p>
<p><strong>location / {</strong></p>
<p><strong>root /var/www/root;</strong></p>
<p><strong>}</strong></p>
<p><strong>}</strong></p>
<p><br>&nbsp;</p>
<p>cd ..</p>
<p>mkdir wwwroot</p>
<p>cd wwwroot</p>
<p>sudo nano index.html</p>
<p><br>&nbsp;</p>
<p><strong>&lt;html&gt;</strong></p>
<p><strong>&lt;body&gt;</strong></p>
<p><strong>&lt;h1&gt;Welcome&lt;/h1&gt;</strong></p>
<p><strong>It works!</strong></p>
<p><strong>&lt;/html&gt;T</strong></p>
<p><br>&nbsp;</p>
<p>cd ~/docker/proxy</p>
<p>docker-compose up -d</p>
<p><br>&nbsp;</p>
<p>http://192.168.178.52:80/</p>
<p><br>&nbsp;</p>
<p>cd ~/docker/proxy</p>
<p>sudo nano docker-compose.yaml</p>
<p><br>&nbsp;</p>
<p><strong>version: '3'</strong></p>
<p><strong>services:</strong></p>
<p><strong>nginx:</strong></p>
<p><strong>image: arm64v8/nginx</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- "80:80"</strong></p>
<p><strong>- "443:443" # added</strong></p>
<p><strong>volumes:</strong></p>
<p><strong>- ./data/nginx:/etc/nginx/conf.d:ro</strong></p>
<p><strong>- ./data/wwwroot:/var/www/root:ro</strong></p>
<p><strong>- ./data/certbot/conf:/etc/letsencrypt:ro # added</strong></p>
<p><strong>- ./data/certbot/www:/var/www/certbot:ro # added</strong></p>
<p><br>&nbsp;</p>
<p><strong>certbot: # added</strong></p>
<p><strong>image: certbot/certbot:arm64v8-latest # added</strong></p>
<p><strong>volumes: # added</strong></p>
<p><strong>- ./data/certbot/conf:/etc/letsencrypt # added</strong></p>
<p><strong>- ./data/certbot/www:/var/www/certbot # added</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>cd ~/docker/proxy/data/nginx</p>
<p>sudo nano app.conf</p>
<p><br>&nbsp;</p>
<p><strong>server {</strong></p>
<p><strong>listen 80;</strong></p>
<p><strong>server_name habora.duckdns.org; # replace this</strong></p>
<p><strong>location /.well-known/acme-challenge/ { # added</strong></p>
<p><strong>root /var/www/certbot; # added</strong></p>
<p><strong>} # added</strong></p>
<p><strong>location / {</strong></p>
<p><strong>root /var/www/root;</strong></p>
<p><strong>}</strong></p>
<p><strong>}</strong></p>
<p><strong>server {</strong></p>
<p><strong>listen 443 ssl;</strong></p>
<p><strong>server_name habora.duckdns.org;</strong></p>
<p><br>&nbsp;</p>
<p><strong>location / {</strong></p>
<p><strong>root /var/www/root;</strong></p>
<p><strong>}</strong></p>
<p><br>&nbsp;</p>
<p><strong>ssl_certificate /etc/letsencrypt/live/habora.duckdns.org/fullchain.pem;</strong></p>
<p><strong>ssl_certificate_key /etc/letsencrypt/live/habora.duckdns.org/privkey.pem;</strong></p>
<p>&nbsp;</p>
<p><strong>#Optional: Only works with Philipp's script (see below)</strong></p>
<p><strong>include /etc/letsencrypt/options-ssl-nginx.conf;</strong></p>
<p><strong>ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;</strong></p>
<p><strong>}</strong></p>
<p><br>&nbsp;</p>
<p>cd ~/docker/proxy</p>
<p>curl -L https://raw.githubusercontent.com/wmnnd/nginx-certbot/master/init-letsencrypt.sh &gt; init-letsencrypt.sh</p>
<p><br>&nbsp;</p>
<p>sudo nano init-letsencrypt.sh</p>
<p><strong>Edit the script to add in your domain(s) and your email address. If youve changed the directories of the shared Docker volumes, make sure you also adjust the data_path variable as well.</strong></p>
<p><strong>Email: </strong><a href="mailto:boraers@googlemail.com"><strong>boraers@googlemail.com</strong></a><strong>, </strong><a href="https://habora.duckdns.org/"><strong>https://habora.duckdns.org</strong></a></p>
<p><br>&nbsp;</p>
<p>chmod +x init-letsencrypt.sh</p>
<p>sudo ./init-letsencrypt.sh</p>
<p><br>&nbsp;</p>
<p>docker-compose up -d</p>
<p>http://habora.duckdns.org:80/</p>
<p><br>&nbsp;</p>
<p>rm docker-compose.yaml</p>
<p>sudo nano docker-compose.yaml</p>
<p><br>&nbsp;</p>
<p><strong>version: '3'</strong></p>
<p><strong>services:</strong></p>
<p><strong>nginx:</strong></p>
<p><strong>image: arm64v8/nginx</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- "80:80"</strong></p>
<p><strong>- "443:443"&nbsp;</strong></p>
<p><strong>volumes:</strong></p>
<p><strong>- ./data/nginx:/etc/nginx/conf.d:ro</strong></p>
<p><strong>- ./data/wwwroot:/var/www/root:ro</strong></p>
<p><strong>- ./data/certbot/conf:/etc/letsencrypt:ro&nbsp;</strong></p>
<p><strong>- ./data/certbot/www:/var/www/certbot:ro&nbsp;</strong></p>
<p><strong>command: "/bin/sh -c 'while :; do sleep 6h &amp; wait $${!}; nginx -s reload; done &amp; nginx -g \"daemon off;\"'"</strong></p>
<p><strong>certbot:&nbsp;</strong></p>
<p><strong>image: certbot/certbot:arm64v8-latest&nbsp;</strong></p>
<p><strong>volumes:&nbsp;</strong></p>
<p><strong>- ./data/certbot/conf:/etc/letsencrypt&nbsp;</strong></p>
<p><strong>- ./data/certbot/www:/var/www/certbot&nbsp;</strong></p>
<p><strong>entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h &amp; wait $${!}; done;'"</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="http://192.168.178.52:81/">http://192.168.178.52:81/</a></p>
<p>http://192.168.178.52:9000/</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h3>working procedure:</h3>
<p><a href="https://nginxproxymanager.com/guide/#quick-setup">https://nginxproxymanager.com/guide/#quick-setup</a></p>
<p>cd ~/docker/proxy</p>
<p>sudo rm * -R</p>
<p>sudo nano docker-compose.yml</p>
<p><br>&nbsp;</p>
<p><strong>version: '3'</strong></p>
<p><strong>services:</strong></p>
<p><strong>app:</strong></p>
<p><strong>image: 'jc21/nginx-proxy-manager:latest'</strong></p>
<p><strong>restart: unless-stopped</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- '80:80'</strong></p>
<p><strong>- '81:81'</strong></p>
<p><strong>- '443:443'</strong></p>
<p><strong>volumes:</strong></p>
<p><strong>- ./data:/data</strong></p>
<p><strong>- ./letsencrypt:/etc/letsencrypt</strong></p>
<p><br>&nbsp;</p>
<p>docker-compose up -d</p>
<p><br>&nbsp;</p>
<p><a href="https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/">https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/</a></p>
<p>open the admin page:</p>
<p>http://127.0.0.1:81</p>
<p>http://192.168.178.52:81</p>
<p>Email: admin@example.com</p>
<p>Password: changeme</p>
<p><br>&nbsp;</p>
<p>add prox host:</p>
<p>domain names: habora.duckdns.org</p>
<p>scheme: http</p>
<p>forward hostname / ip: 192.168.178.52:8123</p>
<p>forward port: 8123</p>
<p>ache asset: false</p>
<p>block common explots: true</p>
<p>websockets support: true</p>
<p>access list: publicl accessible</p>
<p>SSL</p>
<p>“request a new ssl certificate”</p>
<p>force SSL: true</p>
<p><a href="mailto:boraers@googlemail.com">boraers@googlemail.com</a></p>
<p><br>&nbsp;</p>
<p>edit configuration.yaml</p>
<p><strong>http:</strong></p>
<p><strong>use_x_forwarded_for: true</strong></p>
<p><strong>trusted_proxies:</strong></p>
<p><strong>- 172.16.0.0/12</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>these options work now ==&gt;</p>
<p>http://192.168.178.52:8123/lovelace/0</p>
<p>https://habora.duckdns.org/lovelace/0</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>install duckdns containers</h2>
<p><a href="https://www.addictedtotech.net/nginx-proxy-manager-tutorial-duckdns-configuration-episode-7/">https://www.addictedtotech.net/nginx-proxy-manager-tutorial-duckdns-configuration-episode-7/</a></p>
<p><br>&nbsp;</p>
<p>STEP 1: SET UP A DUCKDNS ACCOUNT.</p>
<p>The First thing to do will be to set up a DuckDNS account which is easy.</p>
<p>Just navigate to their homepage and log in using one of the many sign in options they offer. In our example we use Google.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_91538cd5f68befa0.png"></figure>
<p>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>https://www.duckdns.org&nbsp;</p>
<p>&nbsp;</p>
<p>STEP 2: ENTER A DUCKDNS SUBDOMAIN.</p>
<p>Once logged in we are going to create a subdomain by entering into the white box a name you would like to use for your service.</p>
<p><i><strong>Note: You will need to create a new subdomain for each docker container service you host.</strong></i></p>
<p>In our example, we just put in “<strong>a2t</strong>“. Then click on the green “add domain” button.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_389f1c0b6fc30dbf.png"></figure>
<p>This now gives us a domain name to use. In our case it is&nbsp;<strong>a2t.duckdns.org</strong>.</p>
<p>The DuckDNS service will automatically take the public IP address you are currently on and add this to the IP field. If you are using a VPN, proxy or are using any other network that is different from the one you want to host your service on you will need to update this IP manually to start with to ensure the correct IP address is used. (This will be auto-updated later by our DuckDNS container either way).</p>
<p>STEP 3: CREATE AND DEPLOY THE DUCKDNS CONTAINER USING A STACK.</p>
<p>Now we have our subdomain we are going to<strong>&nbsp;“log in”</strong>&nbsp;to our “<strong>Portainer”&nbsp;</strong>dashboard on our Raspberry Pi and navigate to the “<strong>Stacks”&nbsp;</strong>page:</p>
<p>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>http://192.168.2.5:9000/#!/1/docker/stacks&nbsp;</p>
<p>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_e860aebf32582055.png"></figure>
<p>From there we are going click on the&nbsp;<strong>“Add stack”</strong>&nbsp;button.</p>
<p>This will open up a new Stack creation window. We will then name our stack “<strong>duckdns</strong></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_369856bc9da6e51a.png"></figure>
<p>Then in the&nbsp;<strong>Web editor</strong>&nbsp;we will paste the following Docker compose data into the empty field.</p>
<p>DOCKER COMPOSE STACK:</p>
<p>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>---&nbsp;</p>
<p>&nbsp;</p>
<p>version: "2.1"</p>
<p>services:</p>
<p>duckdns:</p>
<p>image: ghcr.io/linuxserver/duckdns</p>
<p>container_name: duckdns</p>
<p>environment:</p>
<p>- PUID=1000 #optional</p>
<p>- PGID=1000 #optional</p>
<p>- TZ=Europe/London</p>
<p>- SUBDOMAINS=subdomain1,subdomain2</p>
<p>- TOKEN=token</p>
<p>- LOG_FILE=<strong>false</strong> #optional</p>
<p>volumes:</p>
<p>- /path/to/appdata/config:/config #optional</p>
<p>restart: unless-stopped</p>
<p><strong>---</strong></p>
<p><strong>version: "2.1"</strong></p>
<p><strong>services:</strong></p>
<p><strong>duckdns:</strong></p>
<p><strong>image: ghcr.io/linuxserver/duckdns</strong></p>
<p><strong>container_name: duckdns</strong></p>
<p><strong>environment:</strong></p>
<p><strong>#- PUID=1000 #optional</strong></p>
<p><strong>#- PGID=1000 #optional</strong></p>
<p><strong>- TZ= Europe/Berlin</strong></p>
<p><strong>- SUBDOMAINS=habora #subdomain1,subdomain2</strong></p>
<p><strong>- TOKEN=799093a4-0b34-454f-99cb-25a4637bf404</strong></p>
<p><strong>- LOG_FILE=false #optional</strong></p>
<p><strong>volumes:</strong></p>
<p><strong>- /path/to/appdata/config:/config #optional</strong></p>
<p><strong>restart: unless-stopped</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>You will then need to change the fields to match your installation. If you would like to use a specific user account then you will need to find the&nbsp;<strong>PUID&nbsp;</strong>and&nbsp;<strong>GUID&nbsp;</strong>of that user account. We have shown how to do this in our Youtube Video so please watch that. If you would like to go with the defaults just remove both these fields as they are optional.</p>
<p>Set your timezone “<strong>TZ</strong>” to your current location.</p>
<p>Add your subdomain name to the “<strong>SUBDOMAIN</strong>” field. If you have more than one you will need to add an entry for each subdomain you wish to use and separate them with a comma.</p>
<p><i>Note you do not need to add the full domain name only the subdomain part. In our example, we would only put “<strong>a2t</strong>” into the “<strong>SUBDOMAIN</strong>” field. not a2t.duckdns.org.</i></p>
<p>Add your Token to the&nbsp;<strong>TOKEN&nbsp;</strong>field, which can be found on the Duckdns subdomain creation page at the top right. This is unique to every user and only needs to be put in once regardless of how many subdomains you use.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_f30863f684b0ca6f.png"></figure>
<p>If you would like to use logs then you can change the field to “<strong>true</strong>” this is optional.</p>
<p>Under Volumes add the location of where you install all your Docker data.</p>
<p>Now you have set them fields your Docker compose Stack should look something like this:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_ee45f619877bd165.png"></figure>
<p>Now you have confirmed all is set up correctly you can press the “<strong>Deploy the stack</strong>” button.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_c47f69cff7760f16.png"></figure>
<p>You can now check the Portainer containers page to confirm the “<strong>duckdns</strong>” container has been created correctly.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_464c08548a198f9f.png"></figure>
<p>Press the Logs button to check all is as expected. It should look like this:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_67e1fbd7fa00d5ad.png"></figure>
<p>To confirm your domain is working correctly you can open a browser window and enter your domain name into the address field.</p>
<p>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p><br><br>&nbsp;</p>
<p>http://a2t.duckdns.org&nbsp;</p>
<p>&nbsp;</p>
<p>You should now see this:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_6cab1c59d3acac74.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Mosquitto (MQTT broker) on Raspberry Pi / Docker</h2>
<p><a href="https://www.schaerens.ch/raspi-setting-up-mosquitto-mqtt-broker-on-raspberry-pi-docker/">https://www.schaerens.ch/raspi-setting-up-mosquitto-mqtt-broker-on-raspberry-pi-docker/</a></p>
<p>Install Docker on Raspberry Pi</p>
<p>curl -sSL https://get.docker.com | sh</p>
<p><br>&nbsp;</p>
<p>Add user pi to group docker:</p>
<p>sudo usermod -aG docker pi</p>
<p><br>&nbsp;</p>
<p>Install Docker Compose (first install Python and Pip)</p>
<p>sudo apt-get install libffi-dev libssl-dev python3-dev python3 python3-pip -y</p>
<p>sudo pip3 install docker-compose</p>
<p><br>&nbsp;</p>
<p>sudo reboot</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Create the following directory tree</p>
<p>sudo mkdir /docker</p>
<p>sudo mkdir /docker/mosquitto</p>
<p>sudo mkdir /docker/mosquitto/config</p>
<p><br>&nbsp;</p>
<p>Create the config file for Mosquitto with the following content:</p>
<p>sudo nano /docker/mosquitto/config/mosquitto.conf</p>
<p><strong># Config file for mosquito</strong></p>
<p><strong>listener 1883</strong></p>
<p><strong>#protocol websockets</strong></p>
<p><strong>persistence true</strong></p>
<p><strong>persistence_location /mosquitto/data/</strong></p>
<p><strong>log_dest file /mosquitto/log/mosquitto.log</strong></p>
<p><strong>allow_anonymous false</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Create the config file for docker-compose with the following content (pay attention to the indentation of the lines in the YAML file, use 4 spaces per indentation, no tabs):</p>
<p>cd /docker</p>
<p>sudo nano docker-compose.yaml</p>
<p><br>&nbsp;</p>
<p><strong>version: '3'</strong></p>
<p><br>&nbsp;</p>
<p><strong>services:</strong></p>
<p><strong>mosquitto:</strong></p>
<p><strong>container_name: mosquitto</strong></p>
<p><strong>restart: always</strong></p>
<p><strong>image: eclipse-mosquitto</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- "1883:1883"</strong></p>
<p><strong>- "9001:9001"</strong></p>
<p><strong>volumes:&nbsp;</strong></p>
<p><strong>- ./mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf</strong></p>
<p><strong>- ./mosquitto/data:/mosquitto/data</strong></p>
<p><strong>- ./mosquitto/log:/mosquitto/log</strong></p>
<p><strong>networks:</strong></p>
<p><strong>- default</strong></p>
<p><br>&nbsp;</p>
<p><strong>networks:</strong></p>
<p><strong>default:</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><strong>version: "3"</strong></p>
<p><br>&nbsp;</p>
<p><strong>services:</strong></p>
<p><strong>mosquitto:</strong></p>
<p><strong>image: eclipse-mosquitto</strong></p>
<p><strong>network_mode: host</strong></p>
<p><strong>volumes:</strong></p>
<p><strong>- ./conf:/mosquitto/conf</strong></p>
<p><strong>- ./data:/mosquitto/data</strong></p>
<p><strong>- ./log:/mosquitto/log</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>sudo nano /docker/mosquitto/config/mosquitto.conf</p>
<p><br>&nbsp;</p>
<p><strong>## Config file for mosquito</strong></p>
<p><strong>listener 1883</strong></p>
<p><strong>#protocol websockets</strong></p>
<p><strong>persistence true</strong></p>
<p><strong>persistence_location /mosquitto/data/</strong></p>
<p><strong>log_dest file /mosquitto/log/mosquitto.log</strong></p>
<p><strong>#allow_anonymous false</strong></p>
<p><strong>password_file /mosquitto/config/mosquitto.conf</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>docker-compose exec mosquitto mosquitto_passwd -c /mosquitto/config/mosquitto.passwd mosquitto</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>sudo apt install docker-compose</p>
<p>pip3 install --upgrade requests</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>docker run -d -p 8080:80 --name webserver nginx</p>
<p>docker rm mosquitto</p>
<p>sudo docker run -d -it --name mosquitto -p 127.0.0.1:1883:1883 eclipse-mosquitto</p>
<p>sudo docker run -d -it --name mosquitto -p 8001:8001 myserver_new</p>
<p><a href="https://community.openhab.org/t/mosquitto-error-address-already-in-use/121506">https://community.openhab.org/t/mosquitto-error-address-already-in-use/121506</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Now you can install and start Mosquitto:</p>
<p>docker-compose up -d</p>
<p><br>&nbsp;</p>
<p>Check if Mosquitto is running:</p>
<p>docker ps</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://hub.docker.com/_/eclipse-mosquitto/">https://hub.docker.com/_/eclipse-mosquitto/</a></p>
<p>docker pull eclipse-mosquitto</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h3>working approach</h3>
<p><a href="https://medium.com/himinds/mqtt-broker-with-secure-tls-and-docker-compose-708a6f483c92">https://medium.com/himinds/mqtt-broker-with-secure-tls-and-docker-compose-708a6f483c92</a></p>
<p><a href="https://www.diyhobi.com/install-mqtt-and-openhab-3-in-docker-raspberry-pi-4/">https://www.diyhobi.com/install-mqtt-and-openhab-3-in-docker-raspberry-pi-4/</a></p>
<p>curl -sSL https://get.docker.com | sh</p>
<p>sudo usermod -aG docker pi</p>
<p>sudo apt-get install libffi-dev libssl-dev python3-dev python3 python3-pip -y</p>
<p>sudo pip3 install docker-compose</p>
<p>sudo reboot</p>
<p>cd</p>
<p>mkdir docker</p>
<p>cd docker</p>
<p>mkdir smarthome</p>
<p>mkdir smarthome/mqtt</p>
<p>mkdir smarthome/mqtt/config</p>
<p><br>&nbsp;</p>
<p>sudo nano smarthome/mqtt/config/mosquitto.conf</p>
<p><strong># Config file for mosquitto</strong></p>
<p><br>&nbsp;</p>
<p><strong>listener 1883</strong></p>
<p><br>&nbsp;</p>
<p><strong>persistence true</strong></p>
<p><br>&nbsp;</p>
<p><strong>persistence_location /mosquitto/data/</strong></p>
<p><br>&nbsp;</p>
<p><strong>log_dest file /mosquitto/log/mosquitto.log</strong></p>
<p><br>&nbsp;</p>
<p><strong>allow_anonymous false</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>cd smarthome</p>
<p>nano docker-compose.yaml</p>
<p><br>&nbsp;</p>
<p><strong>version: '3.5'</strong></p>
<p><br>&nbsp;</p>
<p><strong>services:</strong></p>
<p><strong>#mqtt</strong></p>
<p><strong>mosquitto:</strong></p>
<p><strong>container_name: mqtt</strong></p>
<p><strong>#hostname: mosquitto</strong></p>
<p><strong>restart: always</strong></p>
<p><strong>image: eclipse-mosquitto</strong></p>
<p><strong>ports:</strong></p>
<p><strong>- "8883:8883"</strong></p>
<p><strong>- "9001:9001"</strong></p>
<p><strong>volumes:&nbsp;</strong></p>
<p><strong>- ./mqtt/config/mosquitto.conf:/mosquitto/config/mosquitto.conf</strong></p>
<p><strong>- ./mqtt/data:/mosquitto/data</strong></p>
<p><strong>- ./mqtt/log:/mosquitto/log</strong></p>
<p><strong>networks:</strong></p>
<p><strong>- default</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><strong>networks:</strong></p>
<p><strong>default:</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>docker-compose up -d</p>
<p><br>&nbsp;</p>
<p>docker ps</p>
<p>cd ~/docker/smarthome</p>
<p>sudo rm * -R</p>
<p><br>&nbsp;</p>
<p>cd mqtt</p>
<p>cd config</p>
<p>ls</p>
<p>sudo rm mosquitto.conf -R</p>
<p><br>&nbsp;</p>
<p>sudo nano mosquitto.conf</p>
<p><br>&nbsp;</p>
<p><strong># Config file for mosquitto</strong></p>
<p><br>&nbsp;</p>
<p><strong>listener 1883</strong></p>
<p><br>&nbsp;</p>
<p><strong>persistence true</strong></p>
<p><br>&nbsp;</p>
<p><strong>persistence_location /mosquitto/data/</strong></p>
<p><br>&nbsp;</p>
<p><strong>log_dest file /mosquitto/log/mosquitto.log</strong></p>
<p><br>&nbsp;</p>
<p><strong>allow_anonymous false</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>cd ~/docker/smarthome</p>
<p><br>&nbsp;</p>
<p>docker-compose up -d</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>docker exec -it mqtt sh</p>
<p>mosquitto_passwd -c /mosquitto/data/pwfile mymqtt</p>
<p>Username: mymqtt, Password: mypassword</p>
<p><br>&nbsp;</p>
<p>exit</p>
<p><br>&nbsp;</p>
<p>sudo nano ~/docker/smarthome/mqtt/config/mosquitto.conf</p>
<p>Paste this at the bottom: <strong>password_file /mosquitto/data/pwfile</strong></p>
<p><br>&nbsp;</p>
<p>docker start mqtt</p>
<p>docker ps</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>192.168.178.52:1883</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Installation of portainer</h2>
<p><a href="https://darkwolfcave.de/raspberry-pi-docker-ohne-probleme-installieren/">https://darkwolfcave.de/raspberry-pi-docker-ohne-probleme-installieren/</a></p>
<p>docker volume create portainer_data</p>
<p>docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest</p>
<p>docker ps</p>
<p><br>&nbsp;</p>
<p><a href="https://IP-DEINES-RASPBERRYS:9443/">https://IP-DEINES-RASPBERRYS:9443</a> → https://192.168.178.52:9443</p>
<p>user: admin, pass: password1234</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>install influxdb</h2>
<p>sudo mkdir /opt/influxdb</p>
<p>sudo mkdir /opt/grafana</p>
<p>sudo chmod 775 /opt/influxdb/ /opt/grafana/</p>
<p><br>&nbsp;</p>
<p>influxdb:1.8</p>
<p>8086</p>
<p>/var/lib/influxdb</p>
<p><br>&nbsp;</p>
<p>grafana/grafana</p>
<p>3000</p>
<p>/var/lib/grafana (was leider nur auf der Grafana Seite direkt steht und nicht hier)</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Starte, am besten in einem neuen Tab, deine Portainer-Umgebung (<strong>https://IP-DES_RASPBERRY:9443</strong>) und logge dich ein.<br>In der linken Menüseite wähle den Punkt „<strong>Containers</strong>“ und dann klicke auf den Button “&nbsp;<strong>+ Add container</strong>„:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_66e29c76134aef0a.png" alt="Raspberry Pi Monitoring - Portainer - Container"></figure>
<p>Lass dich von den Einstellungen nicht erschlagen. Nicht alle benötigen wir, und alle anderen werden nach und nach klarer.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_3cd0de6670758b76.png" alt="Raspberry Pi Monitoring - Portainer Einstellungen"></figure>
<p>Als Erstes geben wir unserem Container einen&nbsp;<i>Namen(1)</i>:&nbsp;<strong>influxDB</strong></p>
<p>Dann suchen wir das entsprechende&nbsp;<i>Image (2)&nbsp;</i>bei „<strong>DockerHub</strong>“ :&nbsp;<strong>influxdb:1.8</strong></p>
<p>Jetzt klickst du auf den&nbsp;<i>Button&nbsp;</i><strong>publish a new network port</strong>(3) und trägst bei&nbsp;<i>Host(4)&nbsp;</i>und&nbsp;<i>Container(5)</i>&nbsp;jeweils den Port&nbsp;<strong>8086&nbsp;</strong>ein</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_3352870c1d946201.png" alt="image 42"></figure>
<p>Unter dem Punk&nbsp;<strong>„Command &amp; logging“</strong>&nbsp;solltest du für die&nbsp;<strong>Console</strong>&nbsp;<strong>„Interactive &amp; TTY“</strong>&nbsp;auswählen.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_eec6b1679e52d3b.png" alt="image 16"></figure>
<p>Etwas weiter unten klickst du jetzt auf „<strong>Volumes(1)</strong>„, dann auf „<strong>map additional volume(2)</strong>“ sowie auf den Button „<strong>Bind(3)</strong>„.<br>Du erinnerst dich noch an den Pfad, den wir auf der hub.docker Seite unter influxDB in der Beschreibung gesehen haben?<br>Denn diesen müssen wir jetzt bei „<strong>container(4)</strong>“ eintragen:&nbsp;<strong>/var/lib/influxdb</strong>.<br>Bei „<strong>Host(5)</strong>“ kommt jetzt das Gegenstück dazu rein, nämlich der Ordner, den wir für die persistenten Daten auf unserem Raspberry angelegt haben:&nbsp;<strong>/opt/influxdb</strong></p>
<p>Im Reiter „<strong>Restart policy“</strong>&nbsp;geben wir noch an, wie sich unser Container verhalten soll, falls der Raspberry mal neu startet oder der Container selbst sich mit einem Fehler beendet hat. Hier wählen wir „<strong>Always</strong> er soll also immer wieder selbst neu starten.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_62c4cec3debb56a8.png" alt="image 38"></figure>
<p><br>Nun haben wir soweit alles angegeben was wir benötigen und können, wieder etwas weiter oben, auf den Button „<strong>Deploy the container</strong>“ klicken.<br>Das Ganze dauert dann ein wenig, da zu erst das Image heruntergeladen, entpackt und der Container entsprechend angelegt werden muss. Beim nächsten Deploy des Containers würde es deutlich schneller gehen:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_cfe66c1744a9018f.png" alt="image 18"></figure>
<p>Hiermit hast du jetzt influxDB erfolgreich als Container gestartet. Prüfen kannst du das natürlich auch. Im Menüpunkt Containers wirst du in der Übersicht einen neuen influxDB Container im Status running sehen. Schaue auch ruhig einmal in die Logs.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="http://192.168.178.52:8086/">http://192.168.178.52:8086/</a></p>
<p>user:bora, pass:password1234, orga:home, bucket:influxdb_rapi4</p>
<p>token_01: <strong>GK_kb2fTPaEknWQ7c9c5VRU5c5GeRXv8is3_e0qhn9qXLOdbxHkdAfqYZNrfn1jexfQ-RVKYtX7Co9HvKgIJqg==</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h3><strong>subscribe to MQTT broker</strong></h3>
<p><a href="https://diyi0t.com/visualize-mqtt-data-with-influxdb-and-grafana/"><strong>https://diyi0t.com/visualize-mqtt-data-with-influxdb-and-grafana/</strong></a></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_4202aa273ecf0532.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://thenewstack.io/python-mqtt-tutorial-store-iot-metrics-with-influxdb/"><strong>https://thenewstack.io/python-mqtt-tutorial-store-iot-metrics-with-influxdb/</strong></a></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_faa23644238e228c.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Install Grafana</h2>
<p><a href="https://darkwolfcave.de/raspberry-pi-monitoring-grafana-installieren/">https://darkwolfcave.de/raspberry-pi-monitoring-grafana-installieren/</a></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_571f817e4c9a0b99.png" alt="Raspberry Pi Monitoring - Portainer - Container deploy"></figure>
<p>(1) Name des Containers: „Grafana„</p>
<p>(2) Name des Image: „grafana/grafana„</p>
<p>(3) Anklicken um neue Ports eingeben/binden zu können</p>
<p>(4) Port des Hosts(Raspberry): 3000</p>
<p>(5) Port des Containers: 3000</p>
<p>(6) Button „Volumes“ anklicken</p>
<p>(7) Den Button bei Volume mapping klicken damit wir die Pfade eingeben können</p>
<p>(8) Button „Bind“ anklicken</p>
<p>(9) Pfad des Containers: /var/lib/grafana</p>
<p>(10) Pfad auf dem Host(Raspberry) dazu: /opt/grafana</p>
<p>Im Reiter „Restart policy“ geben wir jetzt noch an, wie sich unser Container verhalten soll, falls der Raspberry mal neu startet oder der Container selbst sich mit einem Fehler beendet hat. Hier wählen wir „Always“ er soll also immer wieder selbst neu starten.</p>
<p>Unter dem Punk „Command &amp; logging“ solltest du für die Console „Interactive &amp; TTY“ auswählen.</p>
<p>(11) Button „Deploy the container“ klicken</p>
<p><br>&nbsp;</p>
<p><a href="http://IP-DEINES-RASPBERRY:3000/">http://IP-DEINES-RASPBERRY:3000</a> → http://192.168.178.52:3000</p>
<p><br>&nbsp;</p>
<p>Mit dem Default User und Passwort (admin/admin) kannst du dich einloggen und direkt das Passwort ändern.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>InfluxDB mit Grafana verbinden</h2>
<p>Wir loggen uns jetzt wieder in der Grafana WebGui auf dem Raspberry ein&nbsp;<strong>(IP-DEINES_RASPBERRYS:3000)</strong>.<br>Hier wählen wir auf der linken Seite das Zahnrad und „<strong>Data sources</strong>“ aus, dann klicken wir auf den Button „<strong>Add data source</strong>“ und sagen zum Schluss wir wollen eine&nbsp;<strong>InfluxDB&nbsp;</strong>hinzufügen:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_88f4515c8b37e4e0.png" alt="image 31"></figure>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_c6fcf1a7b5e5300d.png" alt="image 32"></figure>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_cbbc33380bd08951.png" alt="image 33"></figure>
<p>Jetzt müssen wir nur noch ein paar Angaben zu der Datenbank machen. Damit es einfacher zu handhaben ist, verzichte ich hier vollkommen auf Username / Passwörter. Bedeutet die Datenbank ist frei zugänglich. Da dies alles nur in unserem Netzwerk läuft, ist das kein Problem. Bedenke aber das man unter anderen Umständen immer User und Passwörter vergeben sollte.</p>
<p>Zurück zu unseren Einstellungen.<br>Unter&nbsp;<strong>Name&nbsp;</strong>kannst du einen Namen vergeben der dann später als Quelle in deinem Dashboard auswählbar ist.<br>Im Bereich&nbsp;<strong>HTTP</strong>&nbsp;und&nbsp;<strong>URL&nbsp;</strong>gibst du die&nbsp;<strong>IP deines Raspberrys</strong>&nbsp;ein auf dem die Datenbank läuft, gefolgt von dem&nbsp;<strong>Port 8086</strong><br>Die restlichen Einstellungen können so bleiben.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_994478788c5d893a.png" alt="image 34"></figure>
<p>Etwas weiter unten musst du noch den&nbsp;<strong>Datenbank Namen&nbsp;</strong>angeben aus dem die Daten gelesen werden sollen. Du erinnerst dich? Wir haben diesen weiter oben in die telegraf.conf eingetragen. In meinem Fall als „<strong>raspberry_live</strong>„.<br>Über den Button „<strong>Save &amp; test</strong>“ prüfen wir die Verbindung. Ein grüner Haken und&nbsp;<strong>„Data source is working</strong>„, zeigt uns an, das alles funktioniert hat:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_73e5e602e1634f7e.png" alt="image 35"></figure>
<h3>Dashboard für Grafana besorgen</h3>
<p>Was wäre ein Raspberry Pi Monitoring ohne ein Dashboard?<br>Damit wir bei Grafana ein solches sehen können, müssten wir uns selbst eins erstellen oder was ich hier bevorzuge ein fertiges Dashboard importieren.<br>Du kannst dir auf der&nbsp;<a href="https://grafana.com/grafana/">Grafana Labs Seite</a>&nbsp;alle verfügbaren Dashboards ansehen und entsprechend suchen. Wir wollen ja ein speziell für einen Raspberry Pi erstelltes nutzen, daher suchen wir auch nach „Raspberry“.<br>Ich denke du wirst dann bei deiner Suche direkt auf dieses hier treffen:&nbsp;<a href="https://grafana.com/grafana/dashboards/10578">Raspberry Pi Monitoring</a></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_674b29325fbfed7e.png" alt="Raspberry Pi Monitoring - Grafana Dashboard"></figure>
<p>Dieses nehmen wir auch direkt. Wie?! Ganz einfach: Kopiere dir die ID oben Rechts „<strong>10578</strong>„.<br>Dann öffnest du bei dir deine Grafana Umgebung (IP-DEINES_RASPBERRYS:3000) und gehst über den Menüpunkt „<strong>Dashboards</strong>“ auf „<strong>+ Import</strong>„:</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_602ea3a9161f69e7.png" alt="image 28"></figure>
<p>Hier trägst du die gerade kopierte oder gemerkte ID des Dashboards ein (<strong>10578</strong>) und betätigst den „<strong>Load</strong>“ Button.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_cef0de278724e1e6.png" alt="image 29"></figure>
<p>Jetzt könntest du den Namen des Dashboards ändern und musst auf jeden Fall die Verbindung zu den Daten also zu der influxDB angeben.<br>Diese hatten wir ja gerade eingerichtet und du solltest sie in dem Drop-Down-Feld auswählen können. In meinem Fall „<strong>Raspberry Pi Monitoring“</strong></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_efaf97c53f6a42c7.png" alt="image 36"></figure>
<p>Ist alles eingestellt, klicken wir auf den „<strong>Import“</strong>&nbsp;Button und sehen einige Sekunden später bereits unser Dashboard mit Daten.<br>Ab jetzt kannst du dich einfach mal in Ruhe durch alle Punkte klicken und dir das Dashboard anschauen. Je länger dein Raspberry läuft, je mehr Daten erscheinen. Oben Rechts kannst du die Aktualisierungsrate einstellen. Default ist 1 Minute.</p>
<p>Herzlichen Glückwunsch, dein Raspberry Pi Monitoring ist somit fertig und funktionsfähig. Viel Spaß damit!</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_81b8624523f575e7.png" alt="image 37"></figure>
<p><br><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h3>Grafana with influxdb 2.x</h3>
<p><a href="https://www.youtube.com/watch?v=gEIgg5zHuIU">https://www.youtube.com/watch?v=gEIgg5zHuIU</a></p>
<p>the influxdb data explorer, select a quer and cop from the script editor</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Install telegraf</h2>
<p><a href="https://darkwolfcave.de/raspberry-pi-monitoring-grafana-installieren/">https://darkwolfcave.de/raspberry-pi-monitoring-grafana-installieren/</a></p>
<p>Willkommen zurück! Na?! Kopf wieder etwas abgekühlt und aufnahmefähig? 🙂<br>Dann lass uns direkt weitermachen und die letzten paar Dinge erledigen.</p>
<p>Was jetzt kommt, wird wieder direkt auf dem Raspberry installiert. Also nicht als Container.<br>Dazu wie immer per SSH mit deinem pi verbinden.</p>
<p>Damit wir Zugriff auf die Quelle von influxDB haben, um uns Pakete herunterladen zu können, besorgen wir uns einen Key und speichern ihn auf dem Raspberry:</p>
<p>wget -q https://repos.influxdata.com/influxdata-archive_compat.key</p>
<p>cat influxdata-archive_compat.key <strong>|</strong> gpg --dearmor <strong>|</strong> sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg <strong>&gt;</strong> /dev/<strong>null</strong></p>
<p>echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' <strong>|</strong> sudo tee /etc/apt/sources.list.d/influxdata.list</p>
<p>sudo rm -f /etc/apt/trusted.gpg.d/influxdb.gpg</p>
<p>Dann aktualisieren wir unsere Quellen und installieren apt-transport-https, was wir für den weiteren Schritt benötigen.</p>
<p>sudo apt-get update <strong>&amp;&amp;</strong> sudo apt-get install apt-transport-https</p>
<p>Um später auch Updates erhalten zu können, fügen wir noch einen Eintrag in unserer Paketquelle hinzu:</p>
<p>sudo echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/debian stable main' <strong>|</strong> sudo tee /etc/apt/sources.list.d/influxdata.list</p>
<p>Final installieren wir endlich Telegraf:</p>
<p>sudo apt-get update <strong>&amp;&amp;</strong> sudo apt-get install telegraf</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_fd6e56b57f85084.png" alt="Raspberry Pi Monitoring - Telegraf installieren"></figure>
<p>Es sollte jetzt von repos.influxdata.com das Paket für telegraf heruntergeladen und installiert werden.<br>Für mehr Informationen, und weiterführende Konfigurationen, schaue dir die&nbsp;<a href="https://docs.influxdata.com/telegraf/v1.23/install/">Installationsanleitung von Telegraf</a>&nbsp;an.</p>
<p><br>&nbsp;</p>
<h3>telegraf konfigurieren</h3>
<p>Uns fehlen noch ein paar Konfigurationen, damit wir für unser Raspberry Pi Monitoring auch alle benötigten Informationen bekommen, und in unserer Datenbank speichern können.<br>Dafür öffnen wir eine config Datei von telegraf:</p>
<p>sudo nano /etc/telegraf/telegraf.conf</p>
<p>Viel Spaß beim scrollen…. ja diese Datei ist WIRKLICH gefühlt unendlich lang. Aber keine Sorge, wir machen da nicht sehr viel mit und müssen es auch für unsere Anforderungen nicht.</p>
<p>Suche mal nach „<strong>OUTPUT PLUGINS</strong>“ und dann nach&nbsp;<strong>[[output.influxdb]]</strong>. Unter diesem Punkt geben wir jetzt an, wo sich unsere influxdb-Datenbank befindet.<br>Bei dem letzten auskommentierten (#) urls Eintrag entfernen wir einfach die Raute(#) und können es im Prinzip so lassen. Die 127er IP ist der localhost. Da die influxdb ja direkt auf dem Raspberry läuft, kann diese so erreicht werden.<br>Falls du noch einen zweiten Raspberry hast, würdest du bei diesem hier die IP des Hosts eingeben, auf dem die influxdb-Datenbank läuft.</p>
<p>Ein wenig unter diesem Eintrag entfernen wir auch die Raute(#) vor dem „<strong>database =&nbsp;</strong>“ und geben unserer Datenbank einen Namen.<br>Diese wird dann später automatisch angelegt und wir brauchen uns da nicht selbst drum kümmern.<br>Ich habe meine hier „<strong>raspberry_live</strong>“ genannt, damit ich später weiß von welchem meiner raspberrys die Daten sind. Bei einem weiteren pi würde ich zum Beispiel „raspberry_test“ oder sowas nehmen.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_929274bda173b557.png" alt="Raspberry Pi Monitoring - Telegraf config"></figure>
<p>Ich greife jetzt einen Schritt vor, denn ich nutze für mein Raspberry Pi Monitoring bei Grafana ein fertiges Dashboard. Und der Entwickler gibt noch ein paar Parameter an, die man in die telegraf.conf eintragen sollte. Daher scrollen wir jetzt sehr weit nach unten bis du „<strong>INPUT PLUGINS</strong>“ sehen kannst. Direkt da drunter fügst du dann folgendes ein:</p>
<p>#In order to monitor both Network interfaces, eth0 and wlan0, uncomment, or add the next:</p>
<p><strong>[[</strong>inputs.net<strong>]]</strong></p>
<p><strong>[[</strong>inputs.netstat<strong>]]</strong></p>
<p><strong>[[</strong>inputs.file<strong>]]</strong></p>
<p>files = <strong>[</strong>"/sys/class/thermal/thermal_zone0/temp"<strong>]</strong></p>
<p>name_override = "cpu_temperature"</p>
<p>data_format = "value"</p>
<p>data_type = "integer"</p>
<p><strong>[[</strong>inputs.exec<strong>]]</strong></p>
<p>commands = <strong>[</strong>"/opt/vc/bin/vcgencmd measure_temp"<strong>]</strong></p>
<p>name_override = "gpu_temperature"</p>
<p>data_format = "grok"</p>
<p>grok_patterns = <strong>[</strong>"%{NUMBER:value:float}"<strong>]</strong></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_794dd4d02d310efd.png" alt="image 30"></figure>
<p>Jetzt speichere die Datei und verlasse sie. Denn hier sind wir erstmal mit fertig.<br>Damit wir auf dem Raspberry auch auf die Werte von GPU usw. zugreifen dürfen, müssen wir den telegraf User noch in eine Gruppe hinzufügen:</p>
<p>sudo usermod -G video telegraf</p>
<p>Noch haben unsere Änderungen keine Wirkung, daher starten wir den Service telegraf einmal neu:</p>
<p>sudo service telegraf restart</p>
<p>Ab jetzt sollten Daten gesammelt und in die Datenbank geschrieben werden.<br>Was weiterhin fehlt ist das Dashboard, damit wir auch etwas sehen, und die Konfiguration zur Datenbank, damit Grafana auch weiß woher die Daten kommen sollen!</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h3>Telegraf with influxdb 2.x</h3>
<p><a href="https://docs.influxdata.com/influxdb/v2.6/write-data/no-code/use-telegraf/manual-config/">https://docs.influxdata.com/influxdb/v2.6/write-data/no-code/use-telegraf/manual-config/</a></p>
<p><br>&nbsp;</p>
<p>create database/bucket in influxdb</p>
<p>then, edit telegraf.conf as described in section above but use bucket, token, etc.</p>
<p>need a section [[output.influxdb_v2]]</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>add csv data to influxdb / grafana</h1>
<p><a href="https://community.home-assistant.io/t/importing-csv-file-into-influxdb/323933">https://community.home-assistant.io/t/importing-csv-file-into-influxdb/323933</a></p>
<p><br>&nbsp;</p>
<p>manual entry:</p>
<p>Nutrition,measurement=Water,unit=grams value=2000 1645750800000000000</p>
<p>Consumption,measurement=Gas,unit=kWh value=2000 1645750800000000000</p>
<p>Consumption,measurement=Electricity,unit=kWh value=2000 1645750800000000000</p>
<p>Consumption,measurement=Electricity,unit=kWh value=3000 1687377128078000000</p>
<p><br>&nbsp;</p>
<p><a href="https://www.timestamp-converter.com/">https://www.timestamp-converter.com/</a></p>
<p>Timestamp 1687377128</p>
<p>Timestamp in milliseconds 1687377128078 + 000000</p>
<p>ISO 8601 2023-06-21T19:52:08.078Z</p>
<p>Date Time (UTC) 21. Juni 2023, 19:52:08</p>
<p>Date Time (your time zone) 21. Juni 2023, 21:52:08</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://stackoverflow.com/questions/58599352/how-to-convert-formatted-date-to-unix-epoch-in-libreoffice-calc">https://stackoverflow.com/questions/58599352/how-to-convert-formatted-date-to-unix-epoch-in-libreoffice-calc</a></p>
<p><br>&nbsp;</p>
<p>Operations performed on date data should be automatic provided that the cells are formatted as as a user defined DD.MM.YYYY HH:MM:SS in the 'Format' &gt; 'Cells' &gt; 'Numbers' tab.</p>
<p><br>&nbsp;</p>
<p>If you're using the standard settings, LibreOffice Calc uses 12/30/1899 as it's default date. So the first step is getting the number of days between 12/30/1899 and 1/1/1970:</p>
<p><br>&nbsp;</p>
<p>=(DATE(1970,1,1) - DATE(1899,12,30)) = 25569</p>
<p>Number of seconds in a day:</p>
<p><br>&nbsp;</p>
<p>=(60 * 60 * 24) = 86400</p>
<p>If, for example, in cell A2 you have the date 03.12.2013 14:01:49. I subtract the difference between Calc's default date and the Unix Epoch we just calculated, and multiply it by the number of seconds in a day:</p>
<p><br>&nbsp;</p>
<p>=(A2 - 25569) * 86400</p>
<p>The result is a value of 1363096909 which is the Epoch time in seconds. If you need it in milliseconds, multiply the equation by 1000.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>NOUS A1T with homeassistant</h1>
<p><a href="https://tasmota.github.io/docs/MQTT/#command-flow">https://tasmota.github.io/docs/MQTT/#command-flow</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://tasmota.github.io/docs/Home-Assistant/">https://tasmota.github.io/docs/Home-Assistant/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.synology-forum.de/threads/brauche-mal-hilfe-bei-home-assistant-und-tasmota-einbindung.116762/">https://www.synology-forum.de/threads/brauche-mal-hilfe-bei-home-assistant-und-tasmota-einbindung.116762/</a></p>
<p>integrate via MQTT → Zum Schluss über die Tasmota Console noch folgenden Befehl senden: SetOption19 1</p>
<p>integrate via Tasmota Integration → SetOption19 0</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="http://192.168.4.1/#p">http://192.168.4.1/</a></p>
<p>FRITZ!Box 7530 GD</p>
<p>78302839617779115068</p>
<p><br>&nbsp;</p>
<p><a href="http://192.168.178.50/">http://192.168.178.50/</a></p>
<p>tasmota-832BEA-3050 with IP address 192.168.178.50</p>
<p>tasmota-836841-2113 with IP address 192.168.178.49</p>
<p>tasmota-8386C8-1736 with IP address 192.168.178.47</p>
<p>tasmota-C68576-1398 with IP address 192.168.178.48</p>
<p>tasmota-833CA2-7330 with IP address 192.168.178.61</p>
<p>tasmota-836841-7745 with IP address 192.168.178.60</p>
<p>tasmota-83310D-4365 with IP address 192.168.178.62</p>
<p>tasmota-837743-5955 with IP address 192.168.178.63</p>
<p><br>&nbsp;</p>
<p>voltageset 220</p>
<p><br>&nbsp;</p>
<p>192.168.178.52</p>
<p>User: note4</p>
<p>Password: note4</p>
<p><br>&nbsp;</p>
<p>stat/tasmota_832BEA/RESULT</p>
<p>tele/tasmota_832BEA/STATE</p>
<p>tele/tasmota_832BEA/SENSOR</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://tasmota.github.io/docs/Peripherals/#update-interval">https://tasmota.github.io/docs/Peripherals/#update-interval</a></p>
<p>TelePeriod 10</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>how to keep smart plug powered off after unplugging and re-plugging?</p>
<p><a href="https://tasmota.github.io/docs/Commands/#commands-list">https://tasmota.github.io/docs/Commands/#commands-list</a></p>
<p>0 / OFF = keep power(s) OFF after power up → PowerOnState 0</p>
<p>1 / ON = turn power(s) ON after power up</p>
<p><br>&nbsp;</p>
<p>disable use of button</p>
<p>SetOption73 Detach buttons from relays and send multi-press and hold MQTT messages instead</p>
<p>0 = disable (default)</p>
<p>1 = enable → SetOption73 1</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>configure network storage (fritz.nas) in home assistant:</h1>
<p><br>&nbsp;</p>
<p><a href="https://www.home-assistant.io/common-tasks/os/#network-storage">https://www.home-assistant.io/common-tasks/os/#network-storage</a></p>
<p><br>&nbsp;</p>
<p>\\192.168.178.1\FRITZ.NAS\USB-SanDisk3-2Gen1-01</p>
<p>http://fritz.box/nas?sid=41098e807aea021b</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://smartebude.de/einrichtung-einer-nas-als-speicherort-fuer-home-assistant-backups-z-b-fritzbox-als-nas/">https://smartebude.de/einrichtung-einer-nas-als-speicherort-fuer-home-assistant-backups-z-b-fritzbox-als-nas/</a></p>
<p>user: homeassistant</p>
<p>password: bhasfonworf34534thb</p>
<p>fritz.nas/USB-SanDisk3-2Gen1-01/Data</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_2dcb84b3a68c1c0c.png"></figure>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_5aabcbff64f7c4de.png"></figure>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_389f84a162b43d24.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Zeitpläne nutzen, um mehrere Temperaturen in Home Assistant zu steuern</h1>
<p><a href="https://smartebude.de/zeitplaene-nutzen-um-mehrere-temperaturen-in-home-assistant-zu-steuern/">https://smartebude.de/zeitplaene-nutzen-um-mehrere-temperaturen-in-home-assistant-zu-steuern/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>use Raspberry Pi as WiFi repeater</h1>
<p><a href="https://pimylifeup.com/raspberry-pi-wifi-extender/">https://pimylifeup.com/raspberry-pi-wifi-extender/</a></p>
<p><a href="https://blog.balena.io/turn-a-raspberry-pi-into-a-wi-fi-access-point-or-repeater/">https://blog.balena.io/turn-a-raspberry-pi-into-a-wi-fi-access-point-or-repeater/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Timercard (Ein-Aus-Zeit) in HomeAssistant</h1>
<p><a href="https://smarthomeyourself.de/wiki/homeassistant/timercard-ein-aus-zeit-in-homeassistant/">https://smarthomeyourself.de/wiki/homeassistant/timercard-ein-aus-zeit-in-homeassistant/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Ähnlich wie beim&nbsp;<a href="https://smarthomeyourself.de/wiki/homeassistant/lichtwecker-in-homeassistant-erstellen/">Lichtwecker zum Aufstehen&nbsp;</a>erstellen wir eine Timercard mit On-Off-Time (ideal für die Gartenbewässerung oder ähnliches)</p>
<p>Als erstes benötigen wir wieder einige Helfer:</p>
<pre><code class="language-plaintext">#-</code></pre>
<p>&nbsp;</p>
<hr>
<p>Im Gegensatz zum Lichtwecker benötigen wir hier nun 2 Sensoren einen für die Startzeit und einen wo Beendet werden soll</p>
<pre><code class="language-plaintext">#######################################################</code></pre>
<p>&nbsp;</p>
<hr>
<p>Und zum Schluss wieder ein Paar Automatisierung, damit alles funktioniert.</p>
<pre><code class="language-plaintext">alias</code></pre>
<p>&nbsp;</p>
<hr>
<p>Zum Schluss alles ins Dashboard….</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_acb0022453d57fa7.png"></figure>
<pre><code class="language-plaintext">type</code></pre>
<p># https://smarthomeyourself.de/wiki/homeassistant/naechsten-ausfuehrungszeitpunkt-von-aktiven-zeitplaenen-der-scheduler-card-mit-einem-template-sensor-ermitteln/</p>
<p>- platform: template</p>
<p>sensors:</p>
<p>next_scheduler:</p>
<p>friendly_name: "Nächster Scheduler"</p>
<p>state: &gt;</p>
<p>{%- set x = states.switch | selectattr('entity_id', 'in', state_attr('group.schedulers', 'entity_id'))| selectattr('state','eq','on')|list -%}</p>
<p>{% if x | count &gt; 0 %}</p>
<p>{{ x[0].name }}</p>
<p>{% else %}</p>
<p>Kein Eintrag in der Liste</p>
<p>{%- endif -%}</p>
<p>attributes:</p>
<p>next_run: &gt;</p>
<p>{%- set x = states.switch | selectattr('entity_id', 'in', state_attr('group.schedulers', 'entity_id'))| selectattr('state','eq','on')|list -%}</p>
<p>{% if x | count &gt; 0 %}</p>
<p>{{ as_timestamp( x[0].attributes.next_trigger ) | timestamp_custom("%d.%m.%Y, %H:%M Uhr") }}</p>
<p>{% else %}</p>
<p>Kein Eintrag in der Liste</p>
<p>{%- endif -%}</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>ESP32-CAM PIR Motion Detector with Photo Capture</h1>
<p><a href="https://edistechlab.com/esp32-cam-2-projekte-mit-micro-sd-karte/?v=3a52f3c22ed6">https://edistechlab.com/esp32-cam-2-projekte-mit-micro-sd-karte/?v=3a52f3c22ed6</a></p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_f9a46a8b6be4893.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://randomnerdtutorials.com/esp32-cam-pir-motion-detector-photo-capture/">https://randomnerdtutorials.com/esp32-cam-pir-motion-detector-photo-capture/</a></p>
<p><br>&nbsp;</p>
<p>PIR is connected via a transistor!!</p>
<p><br>&nbsp;</p>
<p>For this project, youll need the following parts:</p>
<p><br>&nbsp;</p>
<p>ESP32-CAM with OV2640 read Best ESP32-CAM Dev Boards</p>
<p>MicroSD card</p>
<p>PIR motion sensor</p>
<p>2N3904 transistor</p>
<p>FTDI programmer</p>
<p>Female-to-female jumper wires</p>
<p>5V power supply for ESP32-CAM or power bank (optional)</p>
<p><br>&nbsp;</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_69b921e4cd60a802.png"></figure>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_569811fbb614e552.png"></figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><code>/*********</code></p>
<p>
</p>
<p><code>&nbsp; Rui Santos</code></p>
<p>
</p>
<p><code>&nbsp; Complete project details at https://RandomNerdTutorials.com/esp32-cam-pir-motion-detector-photo-capture/</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; IMPORTANT!!!</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;- Select Board "AI Thinker ESP32-CAM"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;- GPIO 0 must be connected to GND to upload a sketch</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;- After connecting GPIO 0 to GND, press the ESP32-CAM on-board RESET button to put your board in flashing mode</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Permission is hereby granted, free of charge, to any person obtaining a copy</code></p>
<p>
</p>
<p><code>&nbsp; of this software and associated documentation files.</code></p>
<p>
</p>
<p><code>&nbsp; The above copyright notice and this permission notice shall be included in all</code></p>
<p>
</p>
<p><code>&nbsp; copies or substantial portions of the Software.</code></p>
<p>
</p>
<p><code>*********/</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>#include "esp_camera.h"</code></p>
<p>
</p>
<p><code>#include "Arduino.h"</code></p>
<p>
</p>
<p><code>#include "FS.h" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// SD Card ESP32</code></p>
<p>
</p>
<p><code>#include "SD_MMC.h" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// SD Card ESP32</code></p>
<p>
</p>
<p><code>#include "soc/soc.h" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Disable brownour problems</code></p>
<p>
</p>
<p><code>#include "soc/rtc_cntl_reg.h" &nbsp;// Disable brownour problems</code></p>
<p>
</p>
<p><code>#include "driver/rtc_io.h"</code></p>
<p>
</p>
<p><code>#include &lt;EEPROM.h&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// read and write from flash memory</code></p>
<p>
</p>
<p><code>// define the number of bytes you want to access</code></p>
<p>
</p>
<p><code>#define EEPROM_SIZE 1</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>RTC_DATA_ATTR int bootCount = 0;</code></p>
<p>
</p>
<p><code>// Pin definition for CAMERA_MODEL_AI_THINKER</code></p>
<p>
</p>
<p><code>#define PWDN_GPIO_NUM &nbsp; &nbsp; 32</code></p>
<p>
</p>
<p><code>#define RESET_GPIO_NUM &nbsp; &nbsp;-1</code></p>
<p>
</p>
<p><code>#define XCLK_GPIO_NUM &nbsp; &nbsp; &nbsp;0</code></p>
<p>
</p>
<p><code>#define SIOD_GPIO_NUM &nbsp; &nbsp; 26</code></p>
<p>
</p>
<p><code>#define SIOC_GPIO_NUM &nbsp; &nbsp; 27</code></p>
<p>
</p>
<p><code>#define Y9_GPIO_NUM &nbsp; &nbsp; &nbsp; 35</code></p>
<p>
</p>
<p><code>#define Y8_GPIO_NUM &nbsp; &nbsp; &nbsp; 34</code></p>
<p>
</p>
<p><code>#define Y7_GPIO_NUM &nbsp; &nbsp; &nbsp; 39</code></p>
<p>
</p>
<p><code>#define Y6_GPIO_NUM &nbsp; &nbsp; &nbsp; 36</code></p>
<p>
</p>
<p><code>#define Y5_GPIO_NUM &nbsp; &nbsp; &nbsp; 21</code></p>
<p>
</p>
<p><code>#define Y4_GPIO_NUM &nbsp; &nbsp; &nbsp; 19</code></p>
<p>
</p>
<p><code>#define Y3_GPIO_NUM &nbsp; &nbsp; &nbsp; 18</code></p>
<p>
</p>
<p><code>#define Y2_GPIO_NUM &nbsp; &nbsp; &nbsp; &nbsp;5</code></p>
<p>
</p>
<p><code>#define VSYNC_GPIO_NUM &nbsp; &nbsp;25</code></p>
<p>
</p>
<p><code>#define HREF_GPIO_NUM &nbsp; &nbsp; 23</code></p>
<p>
</p>
<p><code>#define PCLK_GPIO_NUM &nbsp; &nbsp; 22</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>int pictureNumber = 0;</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>void setup() {</code></p>
<p>
</p>
<p><code>&nbsp; WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector</code></p>
<p>
</p>
<p><code>&nbsp; Serial.begin(115200);</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Serial.setDebugOutput(true);</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; camera_config_t config;</code></p>
<p>
</p>
<p><code>&nbsp; config.ledc_channel = LEDC_CHANNEL_0;</code></p>
<p>
</p>
<p><code>&nbsp; config.ledc_timer = LEDC_TIMER_0;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d0 = Y2_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d1 = Y3_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d2 = Y4_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d3 = Y5_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d4 = Y6_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d5 = Y7_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d6 = Y8_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d7 = Y9_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_xclk = XCLK_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_pclk = PCLK_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_vsync = VSYNC_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_href = HREF_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_sscb_sda = SIOD_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_sscb_scl = SIOC_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_pwdn = PWDN_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_reset = RESET_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.xclk_freq_hz = 20000000;</code></p>
<p>
</p>
<p><code>&nbsp; config.pixel_format = PIXFORMAT_JPEG;</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; pinMode(4, INPUT);</code></p>
<p>
</p>
<p><code>&nbsp; digitalWrite(4, LOW);</code></p>
<p>
</p>
<p><code>&nbsp; rtc_gpio_hold_dis(GPIO_NUM_4);</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; if(psramFound()){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.frame_size = FRAMESIZE_UXGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.jpeg_quality = 10;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.fb_count = 2;</code></p>
<p>
</p>
<p><code>&nbsp; } else {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.frame_size = FRAMESIZE_SVGA;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.jpeg_quality = 12;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.fb_count = 1;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; // Init Camera</code></p>
<p>
</p>
<p><code>&nbsp; esp_err_t err = esp_camera_init(&amp;config);</code></p>
<p>
</p>
<p><code>&nbsp; if (err != ESP_OK) {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.printf("Camera init failed with error 0x%x", err);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; return;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Serial.println("Starting SD Card");</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; delay(500);</code></p>
<p>
</p>
<p><code>&nbsp; if(!SD_MMC.begin()){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.println("SD Card Mount Failed");</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; //return;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; uint8_t cardType = SD_MMC.cardType();</code></p>
<p>
</p>
<p><code>&nbsp; if(cardType == CARD_NONE){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.println("No SD Card attached");</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; return;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; camera_fb_t * fb = NULL;</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; // Take Picture with Camera</code></p>
<p>
</p>
<p><code>&nbsp; fb = esp_camera_fb_get(); &nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; if(!fb) {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.println("Camera capture failed");</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; return;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; // initialize EEPROM with predefined size</code></p>
<p>
</p>
<p><code>&nbsp; EEPROM.begin(EEPROM_SIZE);</code></p>
<p>
</p>
<p><code>&nbsp; pictureNumber = EEPROM.read(0) + 1;</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; // Path where new picture will be saved in SD Card</code></p>
<p>
</p>
<p><code>&nbsp; String path = "/picture" + String(pictureNumber) +".jpg";</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; fs::FS &amp;fs = SD_MMC;</code></p>
<p>
</p>
<p><code>&nbsp; Serial.printf("Picture file name: %s\n", path.c_str());</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; File file = fs.open(path.c_str(), FILE_WRITE);</code></p>
<p>
</p>
<p><code>&nbsp; if(!file){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.println("Failed to open file in writing mode");</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; else {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; file.write(fb-&gt;buf, fb-&gt;len); // payload (image), payload length</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.printf("Saved file to path: %s\n", path.c_str());</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; EEPROM.write(0, pictureNumber);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; EEPROM.commit();</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; file.close();</code></p>
<p>
</p>
<p><code>&nbsp; esp_camera_fb_return(fb);</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; delay(1000);</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; // Turns off the ESP32-CAM white on-board LED (flash) connected to GPIO 4</code></p>
<p>
</p>
<p><code>&nbsp; pinMode(4, OUTPUT);</code></p>
<p>
</p>
<p><code>&nbsp; digitalWrite(4, LOW);</code></p>
<p>
</p>
<p><code>&nbsp; rtc_gpio_hold_en(GPIO_NUM_4);</code></p>
<p>
</p>
<p><code>&nbsp; esp_sleep_enable_ext0_wakeup(GPIO_NUM_13, 0);</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Serial.println("Going to sleep now");</code></p>
<p>
</p>
<p><code>&nbsp; delay(1000);</code></p>
<p>
</p>
<p><code>&nbsp; esp_deep_sleep_start();</code></p>
<p>
</p>
<p><code>&nbsp; Serial.println("This will never be printed");</code></p>
<p>
</p>
<p><code>}&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>void loop() {</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>}</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>ESP32-CAM Video Streaming Web Server (works with Home Assistant)</h1>
<p><a href="https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/">https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><code>/*********</code></p>
<p>
</p>
<p><code>&nbsp; Rui Santos</code></p>
<p>
</p>
<p><code>&nbsp; Complete project details at https://RandomNerdTutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; IMPORTANT!!!&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;- Select Board "AI Thinker ESP32-CAM"</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;- GPIO 0 must be connected to GND to upload a sketch</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp;- After connecting GPIO 0 to GND, press the ESP32-CAM on-board RESET button to put your board in flashing mode</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Permission is hereby granted, free of charge, to any person obtaining a copy</code></p>
<p>
</p>
<p><code>&nbsp; of this software and associated documentation files.</code></p>
<p>
</p>
<p><code>&nbsp; The above copyright notice and this permission notice shall be included in all</code></p>
<p>
</p>
<p><code>&nbsp; copies or substantial portions of the Software.</code></p>
<p>
</p>
<p><code>*********/</code></p>
<p>
</p>
<p><code>#include "esp_camera.h"</code></p>
<p>
</p>
<p><code>#include &lt;WiFi.h&gt;</code></p>
<p>
</p>
<p><code>#include "esp_timer.h"</code></p>
<p>
</p>
<p><code>#include "img_converters.h"</code></p>
<p>
</p>
<p><code>#include "Arduino.h"</code></p>
<p>
</p>
<p><code>#include "fb_gfx.h"</code></p>
<p>
</p>
<p><code>#include "soc/soc.h" //disable brownout problems</code></p>
<p>
</p>
<p><code>#include "soc/rtc_cntl_reg.h" &nbsp;//disable brownout problems</code></p>
<p>
</p>
<p><code>#include "esp_http_server.h"</code></p>
<p>
</p>
<p><code>//Replace with your network credentials</code></p>
<p>
</p>
<p><code>const char* ssid = "REPLACE_WITH_YOUR_SSID";</code></p>
<p>
</p>
<p><code>const char* password = "REPLACE_WITH_YOUR_PASSWORD";</code></p>
<p>
</p>
<p><code>#define PART_BOUNDARY "123456789000000000000987654321"</code></p>
<p>
</p>
<p><code>// This project was tested with the AI Thinker Model, M5STACK PSRAM Model and M5STACK WITHOUT PSRAM</code></p>
<p>
</p>
<p><code>#define CAMERA_MODEL_AI_THINKER</code></p>
<p>
</p>
<p><code>//#define CAMERA_MODEL_M5STACK_PSRAM</code></p>
<p>
</p>
<p><code>//#define CAMERA_MODEL_M5STACK_WITHOUT_PSRAM</code></p>
<p>
</p>
<p><code>// Not tested with this model</code></p>
<p>
</p>
<p><code>//#define CAMERA_MODEL_WROVER_KIT</code></p>
<p>
</p>
<p><code>#if defined(CAMERA_MODEL_WROVER_KIT)</code></p>
<p>
</p>
<p><code>&nbsp; #define PWDN_GPIO_NUM &nbsp; &nbsp;-1</code></p>
<p>
</p>
<p><code>&nbsp; #define RESET_GPIO_NUM &nbsp; -1</code></p>
<p>
</p>
<p><code>&nbsp; #define XCLK_GPIO_NUM &nbsp; &nbsp;21</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOD_GPIO_NUM &nbsp; &nbsp;26</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOC_GPIO_NUM &nbsp; &nbsp;27</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; #define Y9_GPIO_NUM &nbsp; &nbsp; &nbsp;35</code></p>
<p>
</p>
<p><code>&nbsp; #define Y8_GPIO_NUM &nbsp; &nbsp; &nbsp;34</code></p>
<p>
</p>
<p><code>&nbsp; #define Y7_GPIO_NUM &nbsp; &nbsp; &nbsp;39</code></p>
<p>
</p>
<p><code>&nbsp; #define Y6_GPIO_NUM &nbsp; &nbsp; &nbsp;36</code></p>
<p>
</p>
<p><code>&nbsp; #define Y5_GPIO_NUM &nbsp; &nbsp; &nbsp;19</code></p>
<p>
</p>
<p><code>&nbsp; #define Y4_GPIO_NUM &nbsp; &nbsp; &nbsp;18</code></p>
<p>
</p>
<p><code>&nbsp; #define Y3_GPIO_NUM &nbsp; &nbsp; &nbsp; 5</code></p>
<p>
</p>
<p><code>&nbsp; #define Y2_GPIO_NUM &nbsp; &nbsp; &nbsp; 4</code></p>
<p>
</p>
<p><code>&nbsp; #define VSYNC_GPIO_NUM &nbsp; 25</code></p>
<p>
</p>
<p><code>&nbsp; #define HREF_GPIO_NUM &nbsp; &nbsp;23</code></p>
<p>
</p>
<p><code>&nbsp; #define PCLK_GPIO_NUM &nbsp; &nbsp;22</code></p>
<p>
</p>
<p><code>#elif defined(CAMERA_MODEL_M5STACK_PSRAM)</code></p>
<p>
</p>
<p><code>&nbsp; #define PWDN_GPIO_NUM &nbsp; &nbsp; -1</code></p>
<p>
</p>
<p><code>&nbsp; #define RESET_GPIO_NUM &nbsp; &nbsp;15</code></p>
<p>
</p>
<p><code>&nbsp; #define XCLK_GPIO_NUM &nbsp; &nbsp; 27</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOD_GPIO_NUM &nbsp; &nbsp; 25</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOC_GPIO_NUM &nbsp; &nbsp; 23</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; #define Y9_GPIO_NUM &nbsp; &nbsp; &nbsp; 19</code></p>
<p>
</p>
<p><code>&nbsp; #define Y8_GPIO_NUM &nbsp; &nbsp; &nbsp; 36</code></p>
<p>
</p>
<p><code>&nbsp; #define Y7_GPIO_NUM &nbsp; &nbsp; &nbsp; 18</code></p>
<p>
</p>
<p><code>&nbsp; #define Y6_GPIO_NUM &nbsp; &nbsp; &nbsp; 39</code></p>
<p>
</p>
<p><code>&nbsp; #define Y5_GPIO_NUM &nbsp; &nbsp; &nbsp; &nbsp;5</code></p>
<p>
</p>
<p><code>&nbsp; #define Y4_GPIO_NUM &nbsp; &nbsp; &nbsp; 34</code></p>
<p>
</p>
<p><code>&nbsp; #define Y3_GPIO_NUM &nbsp; &nbsp; &nbsp; 35</code></p>
<p>
</p>
<p><code>&nbsp; #define Y2_GPIO_NUM &nbsp; &nbsp; &nbsp; 32</code></p>
<p>
</p>
<p><code>&nbsp; #define VSYNC_GPIO_NUM &nbsp; &nbsp;22</code></p>
<p>
</p>
<p><code>&nbsp; #define HREF_GPIO_NUM &nbsp; &nbsp; 26</code></p>
<p>
</p>
<p><code>&nbsp; #define PCLK_GPIO_NUM &nbsp; &nbsp; 21</code></p>
<p>
</p>
<p><code>#elif defined(CAMERA_MODEL_M5STACK_WITHOUT_PSRAM)</code></p>
<p>
</p>
<p><code>&nbsp; #define PWDN_GPIO_NUM &nbsp; &nbsp; -1</code></p>
<p>
</p>
<p><code>&nbsp; #define RESET_GPIO_NUM &nbsp; &nbsp;15</code></p>
<p>
</p>
<p><code>&nbsp; #define XCLK_GPIO_NUM &nbsp; &nbsp; 27</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOD_GPIO_NUM &nbsp; &nbsp; 25</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOC_GPIO_NUM &nbsp; &nbsp; 23</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; #define Y9_GPIO_NUM &nbsp; &nbsp; &nbsp; 19</code></p>
<p>
</p>
<p><code>&nbsp; #define Y8_GPIO_NUM &nbsp; &nbsp; &nbsp; 36</code></p>
<p>
</p>
<p><code>&nbsp; #define Y7_GPIO_NUM &nbsp; &nbsp; &nbsp; 18</code></p>
<p>
</p>
<p><code>&nbsp; #define Y6_GPIO_NUM &nbsp; &nbsp; &nbsp; 39</code></p>
<p>
</p>
<p><code>&nbsp; #define Y5_GPIO_NUM &nbsp; &nbsp; &nbsp; &nbsp;5</code></p>
<p>
</p>
<p><code>&nbsp; #define Y4_GPIO_NUM &nbsp; &nbsp; &nbsp; 34</code></p>
<p>
</p>
<p><code>&nbsp; #define Y3_GPIO_NUM &nbsp; &nbsp; &nbsp; 35</code></p>
<p>
</p>
<p><code>&nbsp; #define Y2_GPIO_NUM &nbsp; &nbsp; &nbsp; 17</code></p>
<p>
</p>
<p><code>&nbsp; #define VSYNC_GPIO_NUM &nbsp; &nbsp;22</code></p>
<p>
</p>
<p><code>&nbsp; #define HREF_GPIO_NUM &nbsp; &nbsp; 26</code></p>
<p>
</p>
<p><code>&nbsp; #define PCLK_GPIO_NUM &nbsp; &nbsp; 21</code></p>
<p>
</p>
<p><code>#elif defined(CAMERA_MODEL_AI_THINKER)</code></p>
<p>
</p>
<p><code>&nbsp; #define PWDN_GPIO_NUM &nbsp; &nbsp; 32</code></p>
<p>
</p>
<p><code>&nbsp; #define RESET_GPIO_NUM &nbsp; &nbsp;-1</code></p>
<p>
</p>
<p><code>&nbsp; #define XCLK_GPIO_NUM &nbsp; &nbsp; &nbsp;0</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOD_GPIO_NUM &nbsp; &nbsp; 26</code></p>
<p>
</p>
<p><code>&nbsp; #define SIOC_GPIO_NUM &nbsp; &nbsp; 27</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; #define Y9_GPIO_NUM &nbsp; &nbsp; &nbsp; 35</code></p>
<p>
</p>
<p><code>&nbsp; #define Y8_GPIO_NUM &nbsp; &nbsp; &nbsp; 34</code></p>
<p>
</p>
<p><code>&nbsp; #define Y7_GPIO_NUM &nbsp; &nbsp; &nbsp; 39</code></p>
<p>
</p>
<p><code>&nbsp; #define Y6_GPIO_NUM &nbsp; &nbsp; &nbsp; 36</code></p>
<p>
</p>
<p><code>&nbsp; #define Y5_GPIO_NUM &nbsp; &nbsp; &nbsp; 21</code></p>
<p>
</p>
<p><code>&nbsp; #define Y4_GPIO_NUM &nbsp; &nbsp; &nbsp; 19</code></p>
<p>
</p>
<p><code>&nbsp; #define Y3_GPIO_NUM &nbsp; &nbsp; &nbsp; 18</code></p>
<p>
</p>
<p><code>&nbsp; #define Y2_GPIO_NUM &nbsp; &nbsp; &nbsp; &nbsp;5</code></p>
<p>
</p>
<p><code>&nbsp; #define VSYNC_GPIO_NUM &nbsp; &nbsp;25</code></p>
<p>
</p>
<p><code>&nbsp; #define HREF_GPIO_NUM &nbsp; &nbsp; 23</code></p>
<p>
</p>
<p><code>&nbsp; #define PCLK_GPIO_NUM &nbsp; &nbsp; 22</code></p>
<p>
</p>
<p><code>#else</code></p>
<p>
</p>
<p><code>&nbsp; #error "Camera model not selected"</code></p>
<p>
</p>
<p><code>#endif</code></p>
<p>
</p>
<p><code>static const char* _STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY;</code></p>
<p>
</p>
<p><code>static const char* _STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";</code></p>
<p>
</p>
<p><code>static const char* _STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\n\r\n";</code></p>
<p>
</p>
<p><code>httpd_handle_t stream_httpd = NULL;</code></p>
<p>
</p>
<p><code>static esp_err_t stream_handler(httpd_req_t *req){</code></p>
<p>
</p>
<p><code>&nbsp; camera_fb_t * fb = NULL;</code></p>
<p>
</p>
<p><code>&nbsp; esp_err_t res = ESP_OK;</code></p>
<p>
</p>
<p><code>&nbsp; size_t _jpg_buf_len = 0;</code></p>
<p>
</p>
<p><code>&nbsp; uint8_t * _jpg_buf = NULL;</code></p>
<p>
</p>
<p><code>&nbsp; char * part_buf[64];</code></p>
<p>
</p>
<p><code>&nbsp; res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);</code></p>
<p>
</p>
<p><code>&nbsp; if(res != ESP_OK){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; return res;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; while(true){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; fb = esp_camera_fb_get();</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; if (!fb) {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; Serial.println("Camera capture failed");</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; res = ESP_FAIL;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; } else {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; if(fb-&gt;width &gt; 400){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; if(fb-&gt;format != PIXFORMAT_JPEG){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool jpeg_converted = frame2jpg(fb, 80, &amp;_jpg_buf, &amp;_jpg_buf_len);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; esp_camera_fb_return(fb);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fb = NULL;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!jpeg_converted){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Serial.println("JPEG compression failed");</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res = ESP_FAIL;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; } else {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _jpg_buf_len = fb-&gt;len;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _jpg_buf = fb-&gt;buf;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; if(res == ESP_OK){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; if(res == ESP_OK){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; if(res == ESP_OK){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; if(fb){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; esp_camera_fb_return(fb);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; fb = NULL;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; _jpg_buf = NULL;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; } else if(_jpg_buf){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; free(_jpg_buf);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; _jpg_buf = NULL;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; if(res != ESP_OK){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; &nbsp; break;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; //Serial.printf("MJPG: %uB\n",(uint32_t)(_jpg_buf_len));</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; return res;</code></p>
<p>
</p>
<p><code>}</code></p>
<p>
</p>
<p><code>void startCameraServer(){</code></p>
<p>
</p>
<p><code>&nbsp; httpd_config_t config = HTTPD_DEFAULT_CONFIG();</code></p>
<p>
</p>
<p><code>&nbsp; config.server_port = 80;</code></p>
<p>
</p>
<p><code>&nbsp; httpd_uri_t index_uri = {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; .uri &nbsp; &nbsp; &nbsp; = "/",</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; .method &nbsp; &nbsp;= HTTP_GET,</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; .handler &nbsp; = stream_handler,</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; .user_ctx &nbsp;= NULL</code></p>
<p>
</p>
<p><code>&nbsp; };</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; //Serial.printf("Starting web server on port: '%d'\n", config.server_port);</code></p>
<p>
</p>
<p><code>&nbsp; if (httpd_start(&amp;stream_httpd, &amp;config) == ESP_OK) {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; httpd_register_uri_handler(stream_httpd, &amp;index_uri);</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>}</code></p>
<p>
</p>
<p><code>void setup() {</code></p>
<p>
</p>
<p><code>&nbsp; WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector</code></p>
<p>
</p>
<p><code>&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Serial.begin(115200);</code></p>
<p>
</p>
<p><code>&nbsp; Serial.setDebugOutput(false);</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; camera_config_t config;</code></p>
<p>
</p>
<p><code>&nbsp; config.ledc_channel = LEDC_CHANNEL_0;</code></p>
<p>
</p>
<p><code>&nbsp; config.ledc_timer = LEDC_TIMER_0;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d0 = Y2_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d1 = Y3_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d2 = Y4_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d3 = Y5_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d4 = Y6_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d5 = Y7_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d6 = Y8_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_d7 = Y9_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_xclk = XCLK_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_pclk = PCLK_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_vsync = VSYNC_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_href = HREF_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_sscb_sda = SIOD_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_sscb_scl = SIOC_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_pwdn = PWDN_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.pin_reset = RESET_GPIO_NUM;</code></p>
<p>
</p>
<p><code>&nbsp; config.xclk_freq_hz = 20000000;</code></p>
<p>
</p>
<p><code>&nbsp; config.pixel_format = PIXFORMAT_JPEG;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; if(psramFound()){</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.frame_size = FRAMESIZE_UXGA;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.jpeg_quality = 10;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.fb_count = 2;</code></p>
<p>
</p>
<p><code>&nbsp; } else {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.frame_size = FRAMESIZE_SVGA;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.jpeg_quality = 12;</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; config.fb_count = 1;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; // Camera init</code></p>
<p>
</p>
<p><code>&nbsp; esp_err_t err = esp_camera_init(&amp;config);</code></p>
<p>
</p>
<p><code>&nbsp; if (err != ESP_OK) {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.printf("Camera init failed with error 0x%x", err);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; return;</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; // Wi-Fi connection</code></p>
<p>
</p>
<p><code>&nbsp; WiFi.begin(ssid, password);</code></p>
<p>
</p>
<p><code>&nbsp; while (WiFi.status() != WL_CONNECTED) {</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; delay(500);</code></p>
<p>
</p>
<p><code>&nbsp; &nbsp; Serial.print(".");</code></p>
<p>
</p>
<p><code>&nbsp; }</code></p>
<p>
</p>
<p><code>&nbsp; Serial.println("");</code></p>
<p>
</p>
<p><code>&nbsp; Serial.println("WiFi connected");</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; Serial.print("Camera Stream Ready! Go to: http://");</code></p>
<p>
</p>
<p><code>&nbsp; Serial.print(WiFi.localIP());</code></p>
<p>
</p>
<p><code>&nbsp;&nbsp;</code></p>
<p>
</p>
<p><code>&nbsp; // Start streaming web server</code></p>
<p>
</p>
<p><code>&nbsp; startCameraServer();</code></p>
<p>
</p>
<p><code>}</code></p>
<p>
</p>
<p><code>void loop() {</code></p>
<p>
</p>
<p><code>&nbsp; delay(1);</code></p>
<p>
</p>
<p><code>}</code></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>ESP32-CAM with Tasmota</h1>
<p><a href="https://cgomesu.com/blog/Esp32cam-tasmota-webcam-server/#required-packages-and-user-permissions">https://cgomesu.com/blog/Esp32cam-tasmota-webcam-server/#required-packages-and-user-permissions</a></p>
<p><br>&nbsp;</p>
<p><a href="https://tasmota.github.io/docs/ESP32/#flashing">https://tasmota.github.io/docs/ESP32/#flashing</a></p>
<p><a href="https://ota.tasmota.com/tasmota32/release/">https://ota.tasmota.com/tasmota32/release/</a></p>
<p>use webinstaller to flash webcam firmware</p>
<p><br>&nbsp;</p>
<p>connect to AP and open 192.168.4.1</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/esp32-cam-with-tasmota-and-rtsp/334281/6">https://community.home-assistant.io/t/esp32-cam-with-tasmota-and-rtsp/334281/6</a></p>
<p><br>&nbsp;</p>
<p>how can i activte the rtsp stream?</p>
<p>Enter on console:</p>
<p>wcrtsp 1</p>
<p>wcrtsp 0</p>
<p><br>&nbsp;</p>
<p>wcstream 0 stops the HTTP stream</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>==&gt; rtsp://IP_der_Kamera:8554/mjpeg/1</p>
<p>rtsp://192.168.178.76:8554/mjpeg/1</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://github.com/arendst/Tasmota/discussions/13788">https://github.com/arendst/Tasmota/discussions/13788</a></p>
<p>http://192.168.178.76:81/stream</p>
<p>http://192.168.178.76:81/cam.mjpeg</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/#4g">https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/#4g</a></p>
<p><strong>(4g) Tasmota&nbsp;Einstellungen - Sende- und Abrufintervall, Zeitzone und Home Assistant</strong></p>
<p>1. Configure other (Configuration -&gt; Configure Other):&nbsp;</p>
<p>MQTT = enabled</p>
<p>Device Name = MT175 (oder wählt einen anderen Namen)</p>
<p>2. Sende/Abruf Intervall einstellen (Configuration -&gt; Configure Logging)</p>
<p>Telemetry period<br>(Wie oft soll der Wert an HA geschickt werden&nbsp;z.B. 60s)</p>
<p>4. Main Menu -&gt; Console:</p>
<p>Wenn ihr die&nbsp;<a href="https://www.home-assistant.io/integrations/tasmota/"><strong>Tasmota Home Assistant Integration</strong></a>&nbsp;nutzen wollt müsst nicht nichts ändern, da SetOption19 bereits auf 0 eingestellt ist</p>
<p>Wenn ihr verhindern wollt, dass Tasmota rebootet wenn euer WLAN Router mal nicht verfügbar ist dann folgendes eintippen:&nbsp;WifiConfig 5<br>(wait until selected AP is available again without rebooting)</p>
<p>Falls ihr Probleme mit der Uhrzeit/Zeitumstellung habt, folgendes eingeben:</p>
<p>Backlog0 Timezone 99; TimeStd 0,0,10,1,3,60; TimeDst 0,0,3,1,2,120</p>
<p>Skript bezogene Einstellungen findet ihr direkt im Skript ganz oben erklärt (englisch)</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://loxwiki.atlassian.net/wiki/spaces/LOX/pages/1594589651/Befehle+f+r+die+Konsole+in+Tasmota">https://loxwiki.atlassian.net/wiki/spaces/LOX/pages/1594589651/Befehle+f+r+die+Konsole+in+Tasmota</a></p>
<p><br>&nbsp;</p>
<figure class="table">
<table>
<tbody>
<tr>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">SetOption19</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">1 / on</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">aktiviert die automatische Erkennung von Home-Assistant Komponenten (auch: Domoticz MQTT Discovery).<br><strong>Achtung</strong>: Setoption19 1 ändert die Reihenfolge der MQTT-Topics auf&nbsp;%topic%/%prefix%/&nbsp;(Standard:&nbsp;%prefix%/%topic%/). Dies lässt sich auch nicht durch einen entsprechenden Konsolenbefehl&nbsp;fulltopic %prefix%/%topic%/&nbsp;erzwingen.</td>
</tr>
</tbody>
</table>
</figure>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>SetOption19 0</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://tasmota.github.io/docs/Commands/#camera">https://tasmota.github.io/docs/Commands/#camera</a></p>
<p><br>&nbsp;</p>
<figure class="table">
<table>
<tbody>
<tr>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">WcStream</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;"><code>1</code>&nbsp;= start webcam stream at http://&lt;device_ip&gt;:81/stream or http://&lt;device_ip&gt;:81/cam.mjpeg<br><code>0</code>&nbsp;= stop stream</td>
</tr>
</tbody>
</table>
</figure>
<p><br>&nbsp;</p>
<p>WcStream 1</p>
<p><br>&nbsp;</p>
<figure class="table">
<table>
<tbody>
<tr>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">WcResolution</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">Set camera resolution.<br><code>0</code>&nbsp;= 96x96 (96x96)<br><code>1</code>&nbsp;= QQVGA2 (128x160)<br><code>2</code>&nbsp;= QCIF (176x144)<br><code>3</code>&nbsp;= HQVGA (240x176)<br><code>4</code>&nbsp;= QVGA (320x240)<br><code>5</code>&nbsp;= CIF (400x296)<br><code>6</code>&nbsp;= VGA (640x480)<br><code>7</code>&nbsp;= SVGA (800x600)<br><code>8</code>&nbsp;= XGA (1024x768)<br><code>9</code>&nbsp;= SXGA (1280x1024)<br><code>10</code>&nbsp;= UXGA (1600x1200)</td>
</tr>
</tbody>
</table>
</figure>
<p><br>&nbsp;</p>
<p>WcResolution 10 → XGA (1024x768)</p>
<p>WcResolution 12 → UXGA (1600x1200)</p>
<p><br>&nbsp;</p>
<p>WcClock 200</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://tasmota.github.io/docs/Commands/#rules">https://tasmota.github.io/docs/Commands/#rules</a></p>
<p><br>&nbsp;</p>
<p>ON &lt;trigger&gt; DO &lt;command&gt; [ENDON | BREAK]</p>
<p><br>&nbsp;</p>
<p><a href="https://tasmota.github.io/docs/Rules/#rule-trigger">https://tasmota.github.io/docs/Rules/#rule-trigger</a></p>
<p><br>&nbsp;</p>
<figure class="table">
<table>
<tbody>
<tr>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">Time#Minute</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">every minute</td>
</tr>
<tr>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">Time#Minute|5</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">every five minutes</td>
</tr>
<tr>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">Time#Minute=241</td>
<td style="border-bottom:none;border-left:none;border-right:none;border-top:none;padding:0in;">every day once at 04:01 (241 minutes after midnight)</td>
</tr>
</tbody>
</table>
</figure>
<p><br>&nbsp;</p>
<p><strong>Restart at specific time each da of the week:</strong></p>
<p>Timer1 {"Enable":1,"Mode":0,"Time":"04:0","Window":0,"Days":"1111111","Repeat":1,"Action":3}</p>
<p>Rule1 ON clock#Timer=1 DO Restart 1 ENDON</p>
<p>Rule1 1</p>
<p><br>&nbsp;</p>
<p><strong>Restart every 5 min:</strong></p>
<p>Rule1 ON Time#Minute|5 DO Restart 5 ENDON</p>
<p>Rule1 1</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Petoneer Smart Dot Add-on</h1>
<p><a href="https://community.home-assistant.io/t/petoneer-smart-dot-add-on/331391">https://community.home-assistant.io/t/petoneer-smart-dot-add-on/331391</a></p>
<p><a href="https://github.com/marcomow/hass-addon-petoneer-smartdot">https://github.com/marcomow/hass-addon-petoneer-smartdot</a></p>
<p>add repository: https://github.com/marcomow/hass-addons</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>modification for tasmota</p>
<p><a href="https://templates.blakadder.com/petoneer_TY011.html">https://templates.blakadder.com/petoneer_TY011.html</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Install Petkit devices</h1>
<p><br>&nbsp;</p>
<p>Account email:</p>
<p>account password:</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>perfboard design with fritzing</h1>
<p><a href="https://electronics.stackexchange.com/questions/1600/stripboard-veroboard-matrix-board-design-software">https://electronics.stackexchange.com/questions/1600/stripboard-veroboard-matrix-board-design-software</a></p>
<p><br>&nbsp;</p>
<p><a href="https://forum.fritzing.org/t/how-shall-i-get-a-perfboard-matrix-board-view/4118">https://forum.fritzing.org/t/how-shall-i-get-a-perfboard-matrix-board-view/4118</a></p>
<p>Select breadboard view (probably delete the breadboard to reduce clutter) then in the parts window on the right select core and move down to the category breadboard view near the bottom. There select the type of perfboard you want and drag it to the breadboard window. Once it is in the window the inspector window on the bottom right will let you change various things about it such as size and prefboard / stripboard.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Frigate</h1>
<p><a href="https://www.youtube.com/watch?v=xx9DyCIHK-8">https://www.youtube.com/watch?v=xx9DyCIHK-8</a></p>
<p><br>&nbsp;</p>
<p>attention to frame size configuration and ffmpeg declaration!</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>LINKS:</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Frigate repository: https://github.com/blakeblackshear/fr...</p>
<p><br>&nbsp;</p>
<p>Go2RTC repository: https://github.com/AlexxIT/hassio-addons</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Frigate configuration: https://docs.frigate.video/configurat...</p>
<p><br>&nbsp;</p>
<p>Go2RTC: https://github.com/AlexxIT/go2rtc</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Go2RTC.yaml: https://pastebin.com/Fagfm1sC</p>
<p><br>&nbsp;</p>
<p>Frigate.yml: <a href="https://pastebin.com/x974kFUp">https://pastebin.com/x974kFUp</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>stream Tapo C220 with Frigate</h2>
<p>&nbsp;</p>
<p>tapo:</p>
<p>ffmpeg:</p>
<p>inputs:</p>
<p># Für 1080P (1920*1080) stream: rtsp://username:password@IP Address:554/stream1</p>
<p># Für 360P (640*360) stream: rtsp://username:password@IP Address:554/stream2</p>
<p>- path: rtsp://tapocam:watchmyhome90@192.168.178.21:554/stream2?video&amp;audio=all</p>
<p>roles:</p>
<p>- detect</p>
<p>detect:</p>
<p>width: 640</p>
<p>height: 360</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>operating touch button with Arduino</h1>
<p><a href="https://electronics.stackexchange.com/questions/608515/i-want-to-trigger-buttons-on-a-touch-sensitive-control-panel-not-a-touchscreen">https://electronics.stackexchange.com/questions/608515/i-want-to-trigger-buttons-on-a-touch-sensitive-control-panel-not-a-touchscreen</a></p>
<p><br>&nbsp;</p>
<p><a href="https://arduino.stackexchange.com/questions/25662/triggering-capacitive-touch-on-a-touch-device">https://arduino.stackexchange.com/questions/25662/triggering-capacitive-touch-on-a-touch-device</a></p>
<p><br>&nbsp;</p>
<p><a href="https://electronics.stackexchange.com/questions/60385/how-to-use-a-capacitive-touch-screen-without-a-human-hand">https://electronics.stackexchange.com/questions/60385/how-to-use-a-capacitive-touch-screen-without-a-human-hand</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>control Duux Whisper Flex Ultimate</h1>
<p>Add Duux to Tuya Smart Life app</p>
<p>add Tuya integration to homeassistant, which should automatically identif device</p>
<p>create scene in app and reload integration</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>use ESP32 as BLE hub or repeater</h1>
<p><a href="https://smart-live.net/switchbot-esp32-mqtt-die-beste-home-assistant-integration/">https://smart-live.net/switchbot-esp32-mqtt-die-beste-home-assistant-integration/</a></p>
<p>Hier fügst du folgende URL hinzu: https://dl.espressif.com/dl/package_esp32_index.json</p>
<p><br>&nbsp;</p>
<p>Als nächstes müssen zusätzliche Bibliotheken installiert werden. Hier die Übersicht, welche das sind:</p>
<p><br>&nbsp;</p>
<p>NimBLEDevice</p>
<p>EspMQTTClient</p>
<p>ArduinoJson</p>
<p>CRC32 library (by Christopher Baker)</p>
<p>ArduinoQueue</p>
<p><br>&nbsp;</p>
<p>Sind Arduino Vorbereitungen erledigt kannst du den Projektcode vom Github herunter laden.</p>
<p><a href="https://github.com/devWaves/SwitchBot-MQTT-BLE-ESP32">https://github.com/devWaves/SwitchBot-MQTT-BLE-ESP32</a></p>
<p><br>&nbsp;</p>
<p>Die Zip Datei wird entpackt und die Datei&nbsp;<strong>SwitchBot-BLE2MQTT-ESP32.ino</strong>&nbsp;in Arduino geöffnet. Im Bereich&nbsp;<strong>„Configurations to change“</strong>&nbsp;müssen nun noch ein paar Einstellungen vorgenommen werden.</p>
<p>Zunächst werden im ersten Abschnitt deine WLAN Daten eingetragen</p>
<p>Danach folgen die Angaben zu deinem MQTT Broker</p>
<p>Als nächsten werden die BLE Adressen der&nbsp;<a href="https://amzn.to/39MJeTa"><u>Switchbot</u></a>&nbsp;Geräte hinterlegt und die Bereiche entsprechend einkommentiert.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_b50bb11cf20b1254.png" alt="Arduino Projektcode anpassen"></figure>
<p>Arduino Projektcode</p>
<p>Zum Schluss noch definieren ob dein Board eine LED hat oder nicht. Im Falle des von mir verwendeten ESP32 ist das folgende Einstellung</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_f5f44e841889b68c.png" alt="ESP32 LED on Board oder nicht."></figure>
<p>ESP32 LED</p>
<p>Nun kann der Sketch kompiliert und auf den&nbsp;<a href="https://amzn.to/3NiZ3i6"><u>ESP32</u></a>&nbsp;geflasht werden.</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_1386d908c9ebed2b.png" alt="ESP32 Switchbot Sketch kompilieren"></figure>
<p>ESP32 Sketch kompilieren</p>
<h2><strong>Switchbot Geräte per MQTT in Home Assistant</strong></h2>
<p>Nach einem Neustart des&nbsp;<a href="https://amzn.to/3NiZ3i6"><u>ESP32</u></a>&nbsp;sollten alle erreichbaren Switchbot Geräte per Auto-Discovery in der MQTT Karte in Home Assistant zu sehen sein.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Best thermostat to control tado</h1>
<p><br>&nbsp;</p>
<p>RU4251787008: wall thermostat</p>
<p>IB1670717952: internet bridge; connected to router</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Definition of entity_id: climate.tado_wohnzimmer:</p>
<p>tado integration</p>
<p><br>&nbsp;</p>
<p>correct tado temperature:</p>
<p>/config/sensor/templates.yaml</p>
<p><br>&nbsp;</p>
<p>calculate average temperature of thermostates:</p>
<p>/config/sensor/temp_indoors_average.yaml</p>
<p><br>&nbsp;</p>
<p>adjust temperature of tado with another sensor.sensor1:</p>
<p>/config/automations/automations.yaml</p>
<p>alias: Trigger if the state of either thermostat changes</p>
<p>standard is 0.5 °C delta</p>
<p><br>&nbsp;</p>
<p>adjust dynamics of temperature controller</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>turn off central heater or single thermostat based on presence:</p>
<p>/config/automations/home-away.yaml</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Fritz box: detect new devices in homeassistant</h1>
<p><a href="https://community.home-assistant.io/t/device-tracker-fritz-integration-detect-new-devices/392042">https://community.home-assistant.io/t/device-tracker-fritz-integration-detect-new-devices/392042</a></p>
<p>- platform: event</p>
<p>id: "state"</p>
<p>event_type: entity_registry_updated</p>
<p>event_data:</p>
<p>action: create</p>
<p><br>&nbsp;</p>
<p>trigger.event.data.entity_id</p>
<p><br>&nbsp;</p>
<p>- "{{trigger.event.data.entity_id.startswith('device_tracker')}}"</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>install Conbee III</h1>
<p><br>&nbsp;</p>
<p>/dev/serial/by-id/usb-dresden_elektronik_ConBee_III_DE03188934-if00-port0</p>
<p><br>&nbsp;</p>
<p>ls /dev/serial/by-id</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/conbee-setup/67301/19">https://community.home-assistant.io/t/conbee-setup/67301/19</a></p>
<p>List your devices…</p>
<pre><code class="language-plaintext">ls /dev &gt; ~/devices.txt</code></pre>
<p><br>NOW plug in ConBee II to USB Port (via USB extension cable)</p>
<p>Reboot.</p>
<p>Find the ConBee II device</p>
<pre><code class="language-plaintext">ls /dev &gt; ~/devices2.txt</code></pre>
<p>This will show the new device.<br>In my case it was&nbsp;<code>/dev/ttyACM0</code></p>
<p><br><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://phoscon.de/de/conbee3/install#hazha">https://phoscon.de/de/conbee3/install#hazha</a></p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/conbee-iii-conbee-3-from-dresden-elektronik-based-on-silicon-labs-efr32mg21-20dbm-radio-soc-mcu/649835">https://community.home-assistant.io/t/conbee-iii-conbee-3-from-dresden-elektronik-based-on-silicon-labs-efr32mg21-20dbm-radio-soc-mcu/649835</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/devices/#pair-with-install-code">https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/devices/#pair-with-install-code</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>firmware update</h2>
<p><a href="https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually">https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually</a></p>
<p>GCFFlasher -l</p>
<p>GCFFlasher -d COM29 -t 60 -f deCONZ_ConBeeIII_0x264f0900.bin.GCF</p>
<p><br>&nbsp;</p>
<p>in case of powershell:</p>
<p>.\GCFFlasher -l</p>
<p>.\GCFFlasher -d COM29 -t 60 -f deCONZ_ConBeeIII_0x264f0900.bin.GCF</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Connect Philips Hue bulb to Conbee</h2>
<p>It seems as if activation of both ZHA and deConz leads to interferences → ZHA alone seems to work</p>
<p>Delete bulb in the app</p>
<p>if lamp is not immediately recognized, searching for devices with ZHA or deConz will find device automatically</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Connect Philips Motion Sensor</h2>
<p>delete the sensor from the app</p>
<p>push the reset button for 10 s</p>
<p>once the orange LED blinks, the device is read for pairing</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Connect Bosch Smart radiatorThermostate to Conbee</h2>
<p>Thermostate 1:</p>
<p>18FC2600000615BD</p>
<p>FC32-9603-E07B</p>
<p>5182-1390-11E8</p>
<p>209B-5433-A9D3</p>
<p>service: zha.permit<br>data:<br>duration: 60<br>ieee: 00:21:2e:ff:ff:0e:1d:f6<br>source_ieee: 18:fc:26:00:00:06:15:bd<br>install_code: FC32-9603-E07B-5182-1390-11E8-209B-5433-A9D3</p>
<p><br>&nbsp;</p>
<p>Via HACS install ZHA toolkit</p>
<p>In configuration.yaml add a line zha_toolkit:</p>
<p>On the battery cap or on the radiator behind the batteries note the ZigBee EUI-64 code (Source IEEE) and the Install Code.</p>
<p>Go to Developer tools, services, service: Zigbee Home Automation: Permit</p>
<p>Enter the Source IEEE code and the install code in the UI. INSTALL</p>
<p>YAML looks like this:</p>
<p>service: zha.permit</p>
<p>data:</p>
<p>install_code: 379E-1234-ABCD-E529-1234-E6FE-ABCD-A70F-1234</p>
<p>source_ieee: 18:fc:26:00:00:dc:ba:ab</p>
<p>After INSTALL, go to Settings, Intergrations, Zigbee Home Automation. Your device should be listed now</p>
<p>Done.</p>
<p><br>&nbsp;</p>
<p><a href="https://community.home-assistant.io/t/bosch-thermostat-2/492845">https://community.home-assistant.io/t/bosch-thermostat-2/492845</a></p>
<p>Via HACS install ZHA toolkit</p>
<p>In configuration.yaml add a line&nbsp;<code>zha_toolkit:</code></p>
<p>On the battery cap or on the radiator behind the batteries note the ZigBee EUI-64 code (Source IEEE) and the Install Code.</p>
<p>Go to Developer tools, services, service:&nbsp;<code>Zigbee Home Automation: Permit</code></p>
<p>Enter the Source IEEE code and the install code in the UI. INSTALL</p>
<p>YAML looks like this:<br>service: zha.permit<br>data:<br>install_code:&nbsp;<code>379E-1234-ABCD-E529-1234-E6FE-ABCD-A70F-1234</code><br>source_ieee: 18:fc:26:00:00:dc:ba:ab</p>
<p>After INSTALL, go to Settings, Intergrations, Zigbee Home Automation. Your device should be listed now</p>
<p>Done.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.bosch-smarthome.com/de/de/service/hilfe/hilfe-zum-produkt/hilfe-zum-heizkoerper-thermostat-2/">https://www.bosch-smarthome.com/de/de/service/hilfe/hilfe-zum-produkt/hilfe-zum-heizkoerper-thermostat-2/</a></p>
<p>Wie setze ich das Bosch Smart Home Heizkörper-Thermostat II auf die Werkseinstellungen zurück (Zurücksetzen)?</p>
<p>Um das Bosch Smart Home Heizkörper-Thermostat II auf die Werkseinstellungen zurückzusetzen gehen Sie wie folgt vor:</p>
<p><br>&nbsp;</p>
<p>Entfernen Sie eine Batterie. Während Sie die Bedientaste ("o") gedrückt halten, setzen Sie die Batterie wieder ein. Halten Sie die Taste solange gedrückt bis die Status-LED orange blinkt und auf dem Display "RES" steht. Lassen Sie die Taste nun kurz los und drücken Sie die Taste erneut solange bis die Status-LED grün aufleuchtet. Das Bosch Smart Home Heizkörper-Thermostat II wird nun auf die Werkseinstellungen zurückgesetzt.</p>
<p>Bitte beachten Sie, dass hierbei nur die Daten auf dem Bosch Smart Home Heizkörper-Thermostat II selbst, aber nicht auf dem Bosch Smart Home Controller gelöscht werden. Um die Daten auf dem Bosch Smart Home Controller zu löschen, öffnen Sie die Geräteeinstellungen in der Bosch Smart Home App und löschen dort das entsprechende Gerät.</p>
<p><br>&nbsp;</p>
<p>Bitte beachten Sie hierzu auch unser Reset-Video in diesem Artikel. Sollte es Probleme bei der Darstellung des Videos geben, dann finden Sie unsere Installations- und Reset-Videos auch auf unserem Bosch Smart Home Youtube Channel unter folgendem Link.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://www.home-assistant.io/integrations/zha/#service-zhapermit">https://www.home-assistant.io/integrations/zha/#service-zhapermit</a></p>
<p>To add new devices to the network, call the&nbsp;<code>permit</code>&nbsp;service on the&nbsp;<code>zha</code>&nbsp;domain. Do this by clicking the Service icon in Developer tools and typing&nbsp;<code>zha.permit</code>&nbsp;in the&nbsp;<strong>Service</strong>&nbsp;dropdown box. Next, follow the device instructions for adding, scanning or factory reset.<br><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Use REST client</h2>
<p><a href="https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/#rest-api-client">https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/#rest-api-client</a></p>
<p><br>&nbsp;</p>
<p>Talend API Tester - Free Edition</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>install proxmox server</h1>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><a href="https://techbits.io/install-home-assistant-on-proxmox/">https://techbits.io/install-home-assistant-on-proxmox/</a></p>
<p><a href="https://tteck.github.io/Proxmox/">https://tteck.github.io/Proxmox/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Proxmox</p>
<p><a href="https://www.cyberithub.com/how-to-install-proxmox-ve-step-by-step-guide/#Step_4_Install_Proxmox_VE">https://www.cyberithub.com/how-to-install-proxmox-ve-step-by-step-guide/#Step_4_Install_Proxmox_VE</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Nextcloud</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Homeassistant</p>
<p>ttek</p>
<p><a href="https://smarthomescene.com/guides/moving-home-assistants-database-to-mariadb-on-proxmox/">https://smarthomescene.com/guides/moving-home-assistants-database-to-mariadb-on-proxmox/</a></p>
<p><a href="https://community.home-assistant.io/t/installing-home-assistant-os-using-proxmox-8/201835">https://community.home-assistant.io/t/installing-home-assistant-os-using-proxmox-8/201835</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>mqtt</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p>Mariadb</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>influx db</p>
<p>ttek</p>
<p><a href="https://smarthomescene.com/guides/how-to-keep-home-assistant-history-infinitely-with-influxdb-on-proxmox/">https://smarthomescene.com/guides/how-to-keep-home-assistant-history-infinitely-with-influxdb-on-proxmox/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>grafana</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>adguard</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Node-RED</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p>Visual Studio Code</p>
<p>tte</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>frigate</p>
<p><a href="https://www.homeautomationguy.io/blog/running-frigate-on-proxmox">https://www.homeautomationguy.io/blog/running-frigate-on-proxmox</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Vaultwarden</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p>Nginx Proxy Manager</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p>Syncthing</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>Wiki.js</p>
<p>ttek</p>
<p><a href="https://docs.requarks.io/install/windows">https://docs.requarks.io/install/windows</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>WireGuard</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>deCONZ</p>
<p>ttek</p>
<p><br>&nbsp;</p>
<p>grocy</p>
<p>ttek</p>
<p><a href="https://leonardosmarthomemakers.com/how-to-track-chores-in-home-assistant-with-grocy-and-nfc-tags/">https://leonardosmarthomemakers.com/how-to-track-chores-in-home-assistant-with-grocy-and-nfc-tags/</a></p>
<p><a href="https://www.reddit.com/r/homeassistant/comments/kptfbg/track_chores_in_home_assistant_with_grocy_nfc/">https://www.reddit.com/r/homeassistant/comments/kptfbg/track_chores_in_home_assistant_with_grocy_nfc/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Win tips</h1>
<h2>open disk manager as admin</h2>
<p>Open Run from the Start menu or Apps screen. Type diskmgmt.msc and press Enter.</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Formatting disk via command prompt → dangerous!!!</h2>
<p><a href="https://www.diskpart.com/de/articles/usb-stick-formatieren.html">https://www.diskpart.com/de/articles/usb-stick-formatieren.html</a></p>
<p>Die Windows-Eingabeaufforderung hat ähnliche Funktionen wie die Datenträgerverwaltung, erfordert jedoch hervorragende Fähigkeiten, insbesondere in den Befehlszeilen. Es kann einige USB-Probleme lösen, indem es mit verschiedenen Befehlen formatiert wird. Befolgen Sie die Schritte, um zu sehen, wie Sie dieses Tool zum Formatieren von USB-Sticks verwenden.</p>
<p>Schritt 1. Geben Sie „<strong>cmd</strong>“ in die Suchleiste ein, klicken Sie mit der rechten Maustaste auf die&nbsp;<strong>Eingabeaufforderung&nbsp;</strong>und wählen Sie „<strong>Als Administrator ausführen</strong>“.</p>
<p>Schritt 2. Geben Sie nacheinander die folgenden Befehlszeilen ein und drücken Sie jedes Mal „<strong>Enter</strong>“:</p>
<p><strong>diskpart</strong></p>
<p><strong>list disk</strong></p>
<p><strong>select disk n</strong>&nbsp;(n ist die Nummer des USB-Sticks)</p>
<p><strong>clean</strong></p>
<p><strong>create partition primary</strong></p>
<p><strong>format fs=fat32 quick</strong>&nbsp;(Sie können fat32 durch ntfs oder exfat ersetzen.)</p>
<figure class="image"><img src="file:///tmp/lu147722yex8.tmp/lu147722yez3_tmp_9b588e9199f4f42.png" alt="USB-Stick formatieren mit Eingabeaufforderung"></figure>
<p><br><br><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h1>Mycropython IDEs</h1>
<h2>Thonny</h2>
<p><a href="https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/">https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/</a></p>
<p><br>&nbsp;</p>
<p><a href="https://thonny.org/">https://thonny.org/</a></p>
<p><a href="https://github.com/thonny/thonny/wiki/Linux">https://github.com/thonny/thonny/wiki/Linux</a></p>
<p>sudo apt install python3-tk thonny</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>VSCode</h2>
<p><a href="https://randomnerdtutorials.com/micropython-esp32-esp8266-vs-code-pymakr/">https://randomnerdtutorials.com/micropython-esp32-esp8266-vs-code-pymakr/</a></p>
<p><a href="https://randomnerdtutorials.com/raspberry-pi-pico-vs-code-micropython/">https://randomnerdtutorials.com/raspberry-pi-pico-vs-code-micropython/</a></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p>https://www.bordergate.co.uk/configuring-an-esp32-in-ubuntu-22-04/</p>
<p>First plug the device in, and check its recognised by the operating system using the lsusb command. You should see an entry similar to the following:</p>
<p>&gt;&gt;lsusb</p>
<p>Bus 001 Device 006: ID 303a:4001 Espressif Systems Espressif Device</p>
<p><br>&nbsp;</p>
<p>Using the dmesg command, you should be able to see the device being allocated a TTY:</p>
<p>&gt;&gt; sudo dmesg</p>
<p>cdc_acm 1-4:1.0: ttyACM0: USB ACM device</p>
<p><br>&nbsp;</p>
<p>&gt;&gt;screen /dev/ttyACM0 115200</p>
<p><br>&nbsp;</p>
<p>You may need to add the user to the “dialout” and “tty” groups to access the TTY device:</p>
<p>&gt;&gt;sudo usermod -a -G dialout &lt;user&gt;</p>
<p>&gt;&gt;sudo usermod -a -G tty &lt;user&gt;</p>
<p><br>&nbsp;</p>
<p>Log out after making the usermod change. Next attempt to connect to the device using screen:</p>
<p>&gt;&gt;screen /dev/ttyACM0 115200</p>
<p><br>&nbsp;</p>
<p>If the device is working, you should get a blank screen. If you receive an error about screen terminating, something has went wrong…</p>
<p><br>&nbsp;</p>
<p><a href="https://askubuntu.com/questions/1219498/could-not-open-port-dev-ttyacm0-error-after-every-restart">https://askubuntu.com/questions/1219498/could-not-open-port-dev-ttyacm0-error-after-every-restart</a></p>
<p>ls -l /dev/ttyACM0</p>
<p><br>&nbsp;</p>
<p>sudo usermod -aG dialout $USER</p>
<p>sudo usermod -aG tty $USER</p>
<p><br>&nbsp;</p>
<p>sudo adduser $USER dialout</p>
<p>sudo chmod a+rw /dev/ttyACM0</p>
<p><br>&nbsp;</p>
<p><strong>==&gt; need to reboot for effects to take place!!</strong></p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<h2>Flashing Mycropython firmware</h2>
<p>See also esptool.txt document</p>
<p><a href="https://randomnerdtutorials.com/flashing-micropython-firmware-esptool-py-esp32-esp8266/">https://randomnerdtutorials.com/flashing-micropython-firmware-esptool-py-esp32-esp8266/</a></p>
<p>pip install esptool</p>
<p>pip install setuptools</p>
<p>python -m esptool</p>
<p><br>&nbsp;</p>
<p><strong>e.g., T-Display-S3:</strong></p>
<p>cd "/home/bora/Documents/Home Assistant/Micropython"</p>
<p>python -u -m esptool --chip esp32s3 --port /dev/ttyACM0 erase_flash</p>
<p>python -u -m esptool --chip esp32s3 --port /dev/ttyACM0 write_flash -z 0x0 firmware_t-display-s3_st7789s3_esp_lcd_v1.20.1.bin</p>
<p>==&gt; several trials with pushing the BOOT button might be required!</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>
<p><br>&nbsp;</p>