DS18B20 an ESP01S und Tasmota

Die alternative Firmware für ESP8266 based devices

Moderatoren: seppy, udo1toni

Antworten
superpedro
Beiträge: 9
Registriert: 22. Jun 2020 21:15

DS18B20 an ESP01S und Tasmota

Beitrag von superpedro »

Hallo ich verzweifle gerade ein wenig,

ich habe einen einen DS18B20 an einen ESP01S via Tasmota zum Laufen bekommen.

Auf der Tasmota Page bekomme ich die Temperatur richtig angezeigt.

Wie bekomme ich das jetzt hin, dass die Temperatur auch im Panel angezeigt bekomme?

Bin für jeden Tipp dankbar

Benutzeravatar
udo1toni
Beiträge: 13854
Registriert: 11. Apr 2018 18:05
Answers: 222
Wohnort: Darmstadt

Re: DS18B20 an ESP01S und Tasmota

Beitrag von udo1toni »

Du musst in openHAB das mqtt Addon einrichten (V2 ist die zukunftssichere Variante)
Weiterhin brauchst Du einen MQTT Broker. Mosquitto ist das Programm der Wahl. Du kannst auch den embedded Broker Moquette installieren, allerdings wird der nicht mehr weiterentwickelt. NICHT beide Broker installieren!
Dann musst Du im mqtt Addon eine Bridge zum Broker anlegen (das ist NICHT der System Broker!)
Unterhalb des Brokers musst Du mindestens ein generic mqtt Thing anlegen, und unterhalb dieses generic Thing Channel für alle Eigenschaften, die Du anzeigen willst. Diese Channel musst Du mit Items verlinken, die Du dann ganz normal im HABpanel nutzen kannst.
openHAB4.1.2 stable in einem Debian-Container (bookworm) (Proxmox 8.1.5, LXC), mit openHABian eingerichtet

Benutzeravatar
Cyrelian
Beiträge: 601
Registriert: 24. Sep 2015 17:55
Answers: 4

Re: DS18B20 an ESP01S und Tasmota

Beitrag von Cyrelian »

Hi,

ich hab den DS18B20 so eingebunden:

THINGS:

Code: Alles auswählen

//=================================================================================================================================================
    
    Thing topic tasmota_XXXXX "Poolsensor" {
        Channels:
            Type number : TempSensor     "Temperatursensor" [stateTopic="tasmota/tasmota_XXXXX/tele/SENSOR", transformationPattern="JSONPATH:$.DS18B20.Temperature"]
            Type switch : PowerSwitch    "Power Switch"     [stateTopic="tasmota/tasmota_XXXXX/stat/POWER", commandTopic="tasmota/tasmota_XXXXX/cmnd/POWER", on="ON",  off="OFF"] 
            Type switch : state          "Switch State"     [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF"]
            Type string : devicestate    "Device State"     [stateTopic="tasmota/tasmota_XXXXX/tele/LWT"]
            Type string : uptime         "Uptime"           [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Uptime"]
            Type string : wifi-rssi      "Wifi RSSI"        [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
            Type string : wifi-channel   "Wifi Channel"     [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.Channel"]
            Type string : wifi-ssid      "Wifi SSID"        [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.SSId"]
            Type string : wifi-ap        "Wifi AP"          [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.AP"]
            Type string : time           "Time"             [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Time"]
            Type string : hostname       "hostname"         [stateTopic="tasmota/tasmota_XXXXX/stat/STATUS5",  transformationPattern="JSONPATH:$.StatusNET.Hostname"]
            Type string : ip             "IP"               [stateTopic="tasmota/tasmota_XXXXX/stat/STATUS5",  transformationPattern="JSONPATH:$.StatusNET.IPAddress"]
            Type string : version        "Version"          [stateTopic="tasmota/tasmota_XXXXX/stat/STATUS2",  transformationPattern="JSONPATH:$.StatusFWR.Version"]
            } // end of thing
ITEMS:

Code: Alles auswählen

Group	gPoolSensor							"Poolsensor"												(gTerrasse)
Number	PoolSensor_Temp						"Wassertemperatur (Pool) [%.1f °C]"			<temperature> 	(gPoolSensor,gChart)														{channel="mqtt:topic:mosquitto:tasmota_XXXXX:TempSensor"}
Switch	PoolSensor							"PoolSensor"								<poweroutlet>	(gPoolSensor,gInitializeOff)								["Lighting"]	{channel="mqtt:topic:mosquitto:tasmota_XXXXX:PowerSwitch"}
String	PoolSensor_WifiAp					"PoolSensor Wifi AP  [%s]"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-ap"}
String	PoolSensor_WifiSsid					"PoolSensor Wifi SSID  [%s]"								(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-ssid"}
String	PoolSensor_WifiChannel				"PoolSensor Wifi Channel [%s]"								(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-channel"}
String	PoolSensor_WifiRssi					"PoolSensor Wifi RSSI  [%s]"				<network>		(gPoolSensor,gSysRSSI)														{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-rssi"}
String	PoolSensor_Uptime					"PoolSensor Uptime"											(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:uptime"}
String	PoolSensor_Time						"PoolSensor Time"											(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:time"}
String	PoolSensor_Hostname					"PoolSensor Hostname  [%s]"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:hostname"}
String	PoolSensor_IP						"PoolSensor IP  [%s]"										(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:ip"}
String	PoolSensor_DeviceState				"PoolSensor Device State"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:devicestate"}
Switch	PoolSensor_Unreach					"PoolSensor unreachable"					<siren>			(gPoolSensor,gSysUnreach)													{channel="mqtt:topic:mosquitto:tasmota_XXXXX:state"}
String	PoolSensor_FW						"PoolSensor Firmware [%s]"					<sonoff_th10>	(gPoolSensor,gSysSonoff_Maintenance)										{channel="mqtt:topic:mosquitto:tasmota_XXXXX:version"}
CU
Cyrelian

SchneckenBlitzer
Beiträge: 9
Registriert: 5. Nov 2020 18:14

Re: DS18B20 an ESP01S und Tasmota

Beitrag von SchneckenBlitzer »

superpedro hat geschrieben: 3. Sep 2020 23:07 Hallo ich verzweifle gerade ein wenig,

ich habe einen einen DS18B20 an einen ESP01S via Tasmota zum Laufen bekommen.

Auf der Tasmota Page bekomme ich die Temperatur richtig angezeigt.

Wie bekomme ich das jetzt hin, dass die Temperatur auch im Panel angezeigt bekomme?

Bin für jeden Tipp dankbar
Hi,

Hast du bereits MQTT in openHAB eingerichtet?
Wenn das der Fall ist, kannst du ganz einfach ein Thing anlegen, mit dem du dann den passenden Channel verknüpfst, in dem du dann dein Topic angibst, auf dem der Wert geliefert wird. Hier musst du aber dann noch den richtigen Wert aus dem JSON herausfiltern.
Ist das der Ansatz, den du benötigst oder soll ich es noch weiter erläutern?
Ich hoffe, dass ich dir damit bei deinem Problem weiterhelfen konnte.

Viele Grüße
Jan

Wenn du noch weiter Anleitungen zum Thema openHAB und Smart Home suchst, findest du diese auch unter https://bloggingwelt.de/smart-home/ ;-).

Benutzeravatar
udo1toni
Beiträge: 13854
Registriert: 11. Apr 2018 18:05
Answers: 222
Wohnort: Darmstadt

Re: DS18B20 an ESP01S und Tasmota

Beitrag von udo1toni »

Du hast aber schon gesehen, dass der Beitrag vom September ist?
openHAB4.1.2 stable in einem Debian-Container (bookworm) (Proxmox 8.1.5, LXC), mit openHABian eingerichtet

SchneckenBlitzer
Beiträge: 9
Registriert: 5. Nov 2020 18:14

Re: DS18B20 an ESP01S und Tasmota

Beitrag von SchneckenBlitzer »

udo1toni hat geschrieben: 6. Nov 2020 13:07 Du hast aber schon gesehen, dass der Beitrag vom September ist?
Ja, das habe ich gesehen, da er aber nicht mehr geantwortet hatte, wusste ich nicht genau, ob das Problem schon gelöst ist 😉
Ich hoffe, dass ich dir damit bei deinem Problem weiterhelfen konnte.

Viele Grüße
Jan

Wenn du noch weiter Anleitungen zum Thema openHAB und Smart Home suchst, findest du diese auch unter https://bloggingwelt.de/smart-home/ ;-).

superpedro
Beiträge: 9
Registriert: 22. Jun 2020 21:15

Re: DS18B20 an ESP01S und Tasmota

Beitrag von superpedro »

Cyrelian hat geschrieben: 6. Sep 2020 12:42 Hi,

ich hab den DS18B20 so eingebunden:

THINGS:

Code: Alles auswählen

//=================================================================================================================================================
    
    Thing topic tasmota_XXXXX "Poolsensor" {
        Channels:
            Type number : TempSensor     "Temperatursensor" [stateTopic="tasmota/tasmota_XXXXX/tele/SENSOR", transformationPattern="JSONPATH:$.DS18B20.Temperature"]
            Type switch : PowerSwitch    "Power Switch"     [stateTopic="tasmota/tasmota_XXXXX/stat/POWER", commandTopic="tasmota/tasmota_XXXXX/cmnd/POWER", on="ON",  off="OFF"] 
            Type switch : state          "Switch State"     [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF"]
            Type string : devicestate    "Device State"     [stateTopic="tasmota/tasmota_XXXXX/tele/LWT"]
            Type string : uptime         "Uptime"           [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Uptime"]
            Type string : wifi-rssi      "Wifi RSSI"        [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
            Type string : wifi-channel   "Wifi Channel"     [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.Channel"]
            Type string : wifi-ssid      "Wifi SSID"        [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.SSId"]
            Type string : wifi-ap        "Wifi AP"          [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Wifi.AP"]
            Type string : time           "Time"             [stateTopic="tasmota/tasmota_XXXXX/tele/STATE", transformationPattern="JSONPATH:$.Time"]
            Type string : hostname       "hostname"         [stateTopic="tasmota/tasmota_XXXXX/stat/STATUS5",  transformationPattern="JSONPATH:$.StatusNET.Hostname"]
            Type string : ip             "IP"               [stateTopic="tasmota/tasmota_XXXXX/stat/STATUS5",  transformationPattern="JSONPATH:$.StatusNET.IPAddress"]
            Type string : version        "Version"          [stateTopic="tasmota/tasmota_XXXXX/stat/STATUS2",  transformationPattern="JSONPATH:$.StatusFWR.Version"]
            } // end of thing
ITEMS:

Code: Alles auswählen

Group	gPoolSensor							"Poolsensor"												(gTerrasse)
Number	PoolSensor_Temp						"Wassertemperatur (Pool) [%.1f °C]"			<temperature> 	(gPoolSensor,gChart)														{channel="mqtt:topic:mosquitto:tasmota_XXXXX:TempSensor"}
Switch	PoolSensor							"PoolSensor"								<poweroutlet>	(gPoolSensor,gInitializeOff)								["Lighting"]	{channel="mqtt:topic:mosquitto:tasmota_XXXXX:PowerSwitch"}
String	PoolSensor_WifiAp					"PoolSensor Wifi AP  [%s]"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-ap"}
String	PoolSensor_WifiSsid					"PoolSensor Wifi SSID  [%s]"								(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-ssid"}
String	PoolSensor_WifiChannel				"PoolSensor Wifi Channel [%s]"								(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-channel"}
String	PoolSensor_WifiRssi					"PoolSensor Wifi RSSI  [%s]"				<network>		(gPoolSensor,gSysRSSI)														{channel="mqtt:topic:mosquitto:tasmota_XXXXX:wifi-rssi"}
String	PoolSensor_Uptime					"PoolSensor Uptime"											(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:uptime"}
String	PoolSensor_Time						"PoolSensor Time"											(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:time"}
String	PoolSensor_Hostname					"PoolSensor Hostname  [%s]"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:hostname"}
String	PoolSensor_IP						"PoolSensor IP  [%s]"										(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:ip"}
String	PoolSensor_DeviceState				"PoolSensor Device State"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:tasmota_XXXXX:devicestate"}
Switch	PoolSensor_Unreach					"PoolSensor unreachable"					<siren>			(gPoolSensor,gSysUnreach)													{channel="mqtt:topic:mosquitto:tasmota_XXXXX:state"}
String	PoolSensor_FW						"PoolSensor Firmware [%s]"					<sonoff_th10>	(gPoolSensor,gSysSonoff_Maintenance)										{channel="mqtt:topic:mosquitto:tasmota_XXXXX:version"}
CU
Cyrelian
Hallo,

vielen Dank für deine Antwort und sorry habe es jetzt erst gesehen.

Irgendwie stehe ich auf dem Schlauch.
Hier habe ich mal die Infobox von meinem Tasmota Sensor angehängt.
Wäre super wenn Du mir die Codezeilen an diesen adaptieren könntest, denn irgendwie fehlen mir hier grundlegende Dinge. Ich hoffe, wenn ich den Code sehe erschließt sich das für mich.

MIt Tasmota mit 4 Relais habe ich das irgendwie hinbekommen.

Vielen Dank
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.

Benutzeravatar
Cyrelian
Beiträge: 601
Registriert: 24. Sep 2015 17:55
Answers: 4

Re: DS18B20 an ESP01S und Tasmota

Beitrag von Cyrelian »

Hi,

so sollte es passen. Ist aber nicht getestet.

Code: Alles auswählen

//=================================================================================================================================================
    
    Thing topic swPorchLight "PorchLight" {
        Channels:
            Type number : TempSensor     "Temperatursensor" [stateTopic="cmnd/swPorchLight/tele/SENSOR", transformationPattern="JSONPATH:$.DS18B20.Temperature"]
            Type switch : PowerSwitch    "Power Switch"     [stateTopic="cmnd/swPorchLight/stat/POWER", commandTopic="cmnd/swPorchLight/cmnd/POWER", on="ON",  off="OFF"] 
            Type switch : state          "Switch State"     [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF"]
            Type string : devicestate    "Device State"     [stateTopic="cmnd/swPorchLight/tele/LWT"]
            Type string : uptime         "Uptime"           [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.Uptime"]
            Type string : wifi-rssi      "Wifi RSSI"        [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
            Type string : wifi-channel   "Wifi Channel"     [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.Wifi.Channel"]
            Type string : wifi-ssid      "Wifi SSID"        [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.Wifi.SSId"]
            Type string : wifi-ap        "Wifi AP"          [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.Wifi.AP"]
            Type string : time           "Time"             [stateTopic="cmnd/swPorchLight/tele/STATE", transformationPattern="JSONPATH:$.Time"]
            Type string : hostname       "hostname"         [stateTopic="cmnd/swPorchLight/stat/STATUS5",  transformationPattern="JSONPATH:$.StatusNET.Hostname"]
            Type string : ip             "IP"               [stateTopic="cmnd/swPorchLight/stat/STATUS5",  transformationPattern="JSONPATH:$.StatusNET.IPAddress"]
            Type string : version        "Version"          [stateTopic="cmnd/swPorchLight/stat/STATUS2",  transformationPattern="JSONPATH:$.StatusFWR.Version"]
            } // end of thing

Code: Alles auswählen

			Group	gPoolSensor							"Poolsensor"												(gTerrasse)
			Number	PoolSensor_Temp						"Wassertemperatur (Pool) [%.1f °C]"			<temperature> 	(gPoolSensor,gChart)														{channel="mqtt:topic:mosquitto:swPorchLight:TempSensor"}
			Switch	PoolSensor							"PoolSensor"								<poweroutlet>	(gPoolSensor,gInitializeOff)								["Lighting"]	{channel="mqtt:topic:mosquitto:swPorchLight:PowerSwitch"}
			String	PoolSensor_WifiAp					"PoolSensor Wifi AP  [%s]"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:wifi-ap"}
			String	PoolSensor_WifiSsid					"PoolSensor Wifi SSID  [%s]"								(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:wifi-ssid"}
			String	PoolSensor_WifiChannel				"PoolSensor Wifi Channel [%s]"								(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:wifi-channel"}
			String	PoolSensor_WifiRssi					"PoolSensor Wifi RSSI  [%s]"				<network>		(gPoolSensor,gSysRSSI)														{channel="mqtt:topic:mosquitto:swPorchLight:wifi-rssi"}
			String	PoolSensor_Uptime					"PoolSensor Uptime"											(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:uptime"}
			String	PoolSensor_Time						"PoolSensor Time"											(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:time"}
			String	PoolSensor_Hostname					"PoolSensor Hostname  [%s]"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:hostname"}
			String	PoolSensor_IP						"PoolSensor IP  [%s]"										(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:ip"}
			String	PoolSensor_DeviceState				"PoolSensor Device State"									(gPoolSensor)																{channel="mqtt:topic:mosquitto:swPorchLight:devicestate"}
			Switch	PoolSensor_Unreach					"PoolSensor unreachable"					<siren>			(gPoolSensor,gSysUnreach)													{channel="mqtt:topic:mosquitto:swPorchLight:state"}
			String	PoolSensor_FW						"PoolSensor Firmware [%s]"					<sonoff_th10>	(gPoolSensor,gSysSonoff_Maintenance)										{channel="mqtt:topic:mosquitto:swPorchLight:version"}
CU
Cyrelian

Antworten