<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>shelly &#8211; SmartHomeNG | smarthome knx homematic mqtt hue 1wire home automation</title>
	<atom:link href="https://www.smarthomeng.de/tag/shelly/feed" rel="self" type="application/rss+xml" />
	<link>https://www.smarthomeng.de</link>
	<description>Die Device Integrations-Plattform für Dein Smart Home</description>
	<lastBuildDate>Sat, 02 Nov 2024 12:48:25 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.5</generator>

<image>
	<url>https://www.smarthomeng.de/wp-content/uploads/global/logo_small_152x152-150x150.png</url>
	<title>shelly &#8211; SmartHomeNG | smarthome knx homematic mqtt hue 1wire home automation</title>
	<link>https://www.smarthomeng.de</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>wie ich meinen ersten Shelly über das Plugin mit MQTT eingebunden habe</title>
		<link>https://www.smarthomeng.de/wie-ich-meinen-ersten-shelly-ueber-das-plugin-mit-mqtt-eingebunden-habe</link>
					<comments>https://www.smarthomeng.de/wie-ich-meinen-ersten-shelly-ueber-das-plugin-mit-mqtt-eingebunden-habe#comments</comments>
		
		<dc:creator><![CDATA[Wil Heynen]]></dc:creator>
		<pubDate>Fri, 08 May 2020 19:28:05 +0000</pubDate>
				<category><![CDATA[Beispiel-Implementierungen]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[shelly]]></category>
		<guid isPermaLink="false">https://www.smarthomeng.de/?p=2521</guid>

					<description><![CDATA[Da ich mit der Implementierung mehrere Stunden gekämpft habe, möchte ich meine Erfahrungen niederschreiben und eine kleine Anleitung erstellen, wie man am einfachsten vorgeht und welche Fehler man dabei machen kann. Zur Vorgeschichte: Meinen ersten Shelly nutze ich dazu, mein Garagentor über SmartVISU zu öffnen; es gibt zwar eine eigene<a class="moretag" href="https://www.smarthomeng.de/wie-ich-meinen-ersten-shelly-ueber-das-plugin-mit-mqtt-eingebunden-habe"> Weiterlesen&#8230;</a>]]></description>
										<content:encoded><![CDATA[<p>Da ich mit der Implementierung mehrere Stunden gekämpft habe, möchte ich meine Erfahrungen niederschreiben und eine kleine Anleitung erstellen, wie man am einfachsten vorgeht und welche Fehler man dabei machen kann.</p>
<p><strong>Zur Vorgeschichte:</strong><br />
Meinen ersten Shelly nutze ich dazu, mein Garagentor über SmartVISU zu öffnen; es gibt zwar eine eigene App, wie zu allen Smart Home Devices, aber wozu sollte ich für jedes Device eine andere App benutzen. <span id="more-2521"></span></p>
<p>Zunächst musste ich natürlich den Shelly elektrisch anschließen; hierzu gibt es auch schon reichlich Diskussionen in diversen Foren. Ich habe mich für folgende einfache Lösung entschieden und meinen Shelly, wie den Tastschalter oder den Schlüsselschalter angeschlossen.</p>
<p>Da Shelly keine spezielle Taster Funktion kennt, habe ich den Schalter über die App wie ein Treppenlicht konfiguriert; Nach der Betätigung des Schalters wird nach einer Sekunde wieder ausgeschaltet. Das funktioniert dann zunächst schon mal über die App ganz prima.</p>
<p><img decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/Config1-300x124.png" alt="" class="alignnone size-medium wp-image-2523" width="300" height="124" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/Config1-300x124.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/Config1-768x316.png 768w, https://www.smarthomeng.de/wp-content/uploads/2020/05/Config1.png 881w" sizes="(max-width: 300px) 100vw, 300px" /> <img decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/Config2-300x115.png" alt="" class="alignnone size-medium wp-image-2524" width="300" height="115" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/Config2-300x115.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/Config2-768x295.png 768w, https://www.smarthomeng.de/wp-content/uploads/2020/05/Config2.png 874w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>In SmarthomeNG habe ich dann mein Item wie folgt konfiguriert:</p>
<p style="padding-left: 30px">Tor:<br />
name: Tor<br />
enforce_updates: true<br />
type: bool<br />
visu: &#8218;yes&#8216;<br />
sv_widget: &#8222;{{ basic.stateswitch(&#8218;item&#8216;, &#8218;item&#8216;, &#8218;midi&#8216;, 1, &#8220;, &#8220;, &#8220;, &#8218;blink&#8216;) }}&#8220;</p>
<p>Ohne MQTT habe ich dann einfach eine Logik implementiert, die bei jedem Klick getriggert wird:</p>
<p>/etc/logic.yaml</p>
<p style="padding-left: 30px">Garagentor:<br />
filename: Garage.py<br />
watch_item: Aussen.Garage.Tor</p>
<p>/logics/Garage.py</p>
<p style="padding-left: 30px"># Shelly1<br />
# Garagentor</p>
<p style="padding-left: 30px">import urllib.request</p>
<p style="padding-left: 30px">myurl = &#8222;http://192.168.178.28/relay/0?turn=on&#8220;</p>
<p style="padding-left: 30px">req = urllib.request.urlopen(myurl)<br />
logger.info(&#8222;Garagentor&#8220;)</p>
<p>Damit funktioniert das ganze &#8222;zu Fuß&#8220; und ohne MQTT und Shelly Plugin in SmarthomeNG 1.5</p>
<p><strong>Vorbereitungen in SmarthomeNG 1.7</strong></p>
<p>Zunächst mal muss MQTT aufgesetzt werden; dies habe ich natürlich, dank &#8222;Onkelandy&#8220; über das <strong>setup_all</strong> script gemacht.</p>
<p>Wer nicht das Image benutz muss dann anhand der Komplettanleitung den mosquitto Broker installieren und konfigurieren.</p>
<p>Danach muss MQTT als Modul aktiviert werden; mit 1.7 ist MQTT in den Core gewandert und wird wie folgt aktiviert:</p>
<p>/etc/module.yaml</p>
<p style="padding-left: 30px">mqtt:<br />
module_name: mqtt<br />
broker_monitoring: true</p>
<p>Als einzigen Parameter habe ich das Monitoring eingeschaltet, damit man über das Web GUI die Aktivitäten verfolgen kann.</p>
<p>Dann wir das Shelly Plugin aktiviert:</p>
<p>/etc/plugin.yaml</p>
<p style="padding-left: 30px">Shelly:<br />
plugin_name: shelly</p>
<p>Hier gibt es keinerlei Parameter.</p>
<p>Das Shelly Plugin wird über Item-Parameter getriggert, deshalb habe ich Folgendes in meinem Garagentor Item ergänzt:</p>
<p style="padding-left: 30px">Tor:<br />
name: Tor<br />
<strong><span style="color: #3366ff">shelly_id: 8CAAB505559E</span></strong><br />
<strong><span style="color: #3366ff">shelly_type: shelly1</span></strong><br />
<strong><span style="color: #3366ff">shelly_attr: relay</span></strong><br />
<strong><span style="color: #3366ff">shelly_relay: 0</span></strong><br />
enforce_updates: true<br />
type: bool<br />
sv_widget: &#8222;{{ basic.stateswitch(&#8218;item&#8216;, &#8218;item&#8216;, &#8218;midi&#8216;, 1, &#8220;, &#8220;, &#8220;, &#8218;blink&#8216;) }}&#8220;</p>
<p>(Hier hatte ich den Fehler gemacht und shelly_<strong><span style="color: #ff0000">ID</span></strong> definiert, was mich zwei Stunden gekostet hat)</p>
<p>Danach erscheint dann (fast) alles im Web-GUI.</p>
<p>Zunächst die Definitionen im Item:</p>
<p><img fetchpriority="high" decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug1-1024x311.png" alt="" class="alignnone wp-image-2530 size-large" width="750" height="228" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug1-1024x311.png 1024w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug1-300x91.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug1-768x233.png 768w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug1.png 1046w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>Ob der Broker läuft findet Ihr dann unter dem Tab: Broker Information:</p>
<p><img loading="lazy" decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug2-1024x383.png" alt="" class="alignnone size-large wp-image-2531" width="750" height="281" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug2-1024x383.png 1024w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug2-300x112.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug2-768x287.png 768w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug2.png 1032w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>wenn nicht, schaut bitte in Eure Konfiguration, ob MQTT enabled ist:</p>
<p><img loading="lazy" decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/mqtt1-1024x411.png" alt="" class="alignnone size-large wp-image-2533" width="750" height="301" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/mqtt1-1024x411.png 1024w, https://www.smarthomeng.de/wp-content/uploads/2020/05/mqtt1-300x120.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/mqtt1-768x308.png 768w, https://www.smarthomeng.de/wp-content/uploads/2020/05/mqtt1.png 1054w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>In der GUI des Shelly Plugin findet Ihr aber zunächst nichts, oder nur den <strong>Namen</strong> des Devices.</p>
<p>Jetzt geht&#8217;s wieder zur Shelly App um die Broker Verbindung zu konfigurieren. In der SmarthomeNG Konfiguration seht Ihr im letzten Screenshot, dass der MQTT Broker auf dem SmarthomeNG Rechner läuft und auf den Port 1883 hört. Das müsst Ihr jetzt noch dem Shelly Device beibringen. (In der Shelly App):</p>
<p><img loading="lazy" decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/Config3.png" alt="" class="alignnone size-full wp-image-2529" width="880" height="824" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/Config3.png 880w, https://www.smarthomeng.de/wp-content/uploads/2020/05/Config3-300x281.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/Config3-768x719.png 768w" sizes="(max-width: 880px) 100vw, 880px" /></p>
<p>Zunächst müsst Ihr den haken bei &#8222;Enable action execution via MQTT&#8220; und dann noch unter Server: wo und wie er zu erreichen ist. (IP-Adresse des Raspi und Port 1883).</p>
<p>Selbstverständlich kann ich weiterhin mein Garagentor über die HTTP Logik im 1.5er System öffnen und auch über die Shelly App (hier aber nicht mehr über die Cloud, wie Ihr es in der WARNING findet)</p>
<p>Danach ist dann Eure Konfiguration komplett und das Shelly Device auch im Shelly Plugin zu finden:</p>
<p><img loading="lazy" decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug3-1024x326.png" alt="" class="alignnone size-large wp-image-2532" width="750" height="239" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug3-1024x326.png 1024w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug3-300x96.png 300w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug3-768x245.png 768w, https://www.smarthomeng.de/wp-content/uploads/2020/05/shellyPlug3.png 1048w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>Diese ganzen Zusammenhänge müssen erst mal verstanden werden, ehe man eine solche Konfiguration aufsetzen kann. Deshalb habe ich das hier mal zusammengestellt, weil das so nicht aus der Dokumentation hervor geht.</p>
<p>Viel Spaß mit Euren Shelly Devices. Wie Ihr andere Devices mit mehr Funktionen konfiguriert und wie ich sie über SmartVISU administriere, beschreibe ich (vielleicht) in weiteren Blogs.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.smarthomeng.de/wie-ich-meinen-ersten-shelly-ueber-das-plugin-mit-mqtt-eingebunden-habe/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Neuerungen bei MQTT in SmartHomeNG v1.7</title>
		<link>https://www.smarthomeng.de/neuerungen-bei-mqtt-in-smarthomeng-v1-7</link>
					<comments>https://www.smarthomeng.de/neuerungen-bei-mqtt-in-smarthomeng-v1-7#respond</comments>
		
		<dc:creator><![CDATA[Martin Sinn]]></dc:creator>
		<pubDate>Sun, 05 Apr 2020 23:02:30 +0000</pubDate>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[MQTT]]></category>
		<category><![CDATA[shelly]]></category>
		<category><![CDATA[tasmota]]></category>
		<guid isPermaLink="false">https://www.smarthomeng.de/?p=2441</guid>

					<description><![CDATA[MQTT in SmartHomeNG ab v1.7 Bisher war in SmartHomeNG das eigentliche MQTT Protokoll im mqtt Plugin implementiert. In SmartHomeNG v1.7 wurde die Unterstützung des eigentlichen MQTT Protokolls in den Core verlagert. Die Implementierung erfolgte als ein ladbares Modul. Es gibt nun ein neues mqtt Plugin, welches die Protokoll Unterstützung des<a class="moretag" href="https://www.smarthomeng.de/neuerungen-bei-mqtt-in-smarthomeng-v1-7"> Weiterlesen&#8230;</a>]]></description>
										<content:encoded><![CDATA[<h2>MQTT in SmartHomeNG ab v1.7</h2>
<p>Bisher war in SmartHomeNG das eigentliche MQTT Protokoll im mqtt Plugin implementiert.</p>
<p>In SmartHomeNG v1.7 wurde die Unterstützung des eigentlichen MQTT Protokolls in den Core verlagert. Die Implementierung erfolgte als ein ladbares Modul. Es gibt nun ein neues mqtt Plugin, welches die Protokoll Unterstützung des Core nutzt.</p>
<p>Diese Änderung bringt neue Funktionalitäten mit sich:</p>
<ul>
<li>Logiken können das MQTT Protokoll nutzen. Wie das genau geht, ist in der <a href="https://www.smarthomeng.de/user/logiken/mqtt_nutzung.html">Anwender Dokumentation</a> zu SmartHomeNG beschrieben.</li>
<li>Weitere Plugins können das MQTT Protokoll nutzen und darauf aufbauend Payload-Protokolle zu verschiedenen Devices implementieren, ohne das eigentliche MQTT Protokoll selbst implementieren zu müssen. Ein Beispiel hierfür ist das <strong>shelly Plugin,</strong> welches mit SmartHomeNG v1.7 hinzugekommen ist und die einfache Ansteuerung verschiedener Shelly Devices über MQTT ermöglicht. Details zu diesem Plugin sind in der <a href="https://www.smarthomeng.de/user/plugins/shelly/user_doc.html">Anwender Dokumentation</a> zu SmartHomeNG beschrieben.</li>
</ul>
<h3>Konfiguration des MQTT Moduls</h3>
<p>Durch die Verlagerung in den Core, ist auch die Konfiguration des MQTT Protokolls an eine andere Stelle gewandert. Die Konfiguration kann über die graphische Oberfläche oder direkt in der entsprechenden Konfigurationsdatei erfolgen:</p>
<p>In der GUI finden sich die Einstellungen unter System/Konfiguration im Tab <strong>MQTT Modul</strong>:</p>
<p><img loading="lazy" decoding="async" src="https://www.smarthomeng.de/wp-content/uploads/2020/03/Capto_Capture-2020-03-29_04-26-55_PM-300x219.jpg" alt="MQTT Konfiguration" width="675" height="493" class=" wp-image-2452" srcset="https://www.smarthomeng.de/wp-content/uploads/2020/03/Capto_Capture-2020-03-29_04-26-55_PM-300x219.jpg 300w, https://www.smarthomeng.de/wp-content/uploads/2020/03/Capto_Capture-2020-03-29_04-26-55_PM-768x560.jpg 768w, https://www.smarthomeng.de/wp-content/uploads/2020/03/Capto_Capture-2020-03-29_04-26-55_PM-1024x746.jpg 1024w, https://www.smarthomeng.de/wp-content/uploads/2020/03/Capto_Capture-2020-03-29_04-26-55_PM.jpg 1260w" sizes="(max-width: 675px) 100vw, 675px" /></p>
<p>&nbsp;</p>
<p>Damit die Konfiguration wirksam wird und das MQTT Modul beim Restart von SmartHomeNG geladen wird, muss der Parameter <strong>enabled</strong> auf <strong>true</strong> gesetzt werden.</p>
<p>Alternativ kann die Konfiguration direkt in der Datei <strong>../etc/module.yaml</strong> erfolgen. In der Datei muss ein Abschnitt <strong>mqtt:</strong> angelegt werden, der einen Eintrag <strong>module_name: mqtt</strong> enthält. In diesem Abschnitt können dann die Parameter konfiguriert werden.</p>
<p>Beispiel:</p>
<pre><code class="language-yaml">
mqtt:
    module_name: mqtt
    # broker_host: smarthomeng.local
    broker_monitoring: true
    # qos: 1
    # acl: ''
    last_will_topic: devices/shng-module/$online
    last_will_payload: 'False'
    birth_topic: devices/shng-module/$online
    birth_payload: 'True'
    # bool_values: ['Falsch', 'Wahr']
    # user: user
    # password: geheim
</code></pre>
<p>&nbsp;</p>
<h3>Konfiguration des MQTT Plugins</h3>
<p>Die Funktionalität, die das MQTT Plugin zur Verfügung stellte, gibt es weiterhin. Das MQTT Plugin ist entsprechend angepasst worden und nutzt zur Kommunikation jetzt die MQTT Unterstützung des Core. Das Plugin hat jedoch keine Parameter mehr, die konfiguriert werden müssten. Die Item Attribute (mqtt_topic, mqtt_topic_in, mqtt_topic_out, etc.) sind unverändert erhalten geblieben.</p>
<p>Eine Konfiguration des mqtt Plugins in der Plugin Konfigurationsdatei <strong>../etc/plugin.yaml</strong> sieht folgendermaßen aus:</p>
<pre><code class="language-yaml">
mqtt:
    plugin_name: mqtt

</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.smarthomeng.de/neuerungen-bei-mqtt-in-smarthomeng-v1-7/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
