From a69618555b0ead49212a701aa8cb2921ddce51e9 Mon Sep 17 00:00:00 2001 From: Torsten Stauder Date: Mon, 13 Apr 2020 23:11:14 +0200 Subject: [PATCH] openHAB-configfiles added --- README.md | 6 ++++- openHAB/README.md | 17 ++++++++++++ openHAB/items/Home.items | 21 +++++++++++++++ openHAB/sitemaps/Home.sitemap | 36 ++++++++++++++++++++++++++ openHAB/things/mqttConntections.things | 18 +++++++++++++ openHAB/transform/playmodes.map | 11 ++++++++ 6 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 openHAB/README.md create mode 100644 openHAB/items/Home.items create mode 100644 openHAB/sitemaps/Home.sitemap create mode 100644 openHAB/things/mqttConntections.things create mode 100755 openHAB/transform/playmodes.map diff --git a/README.md b/README.md index b9f0921..fc6c5af 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,11 @@ This mode is different from the other ones because the last playposition is save * playlist is over (playposition is set back to the first track and file-position 0) ### Webinterface-configuration -Todo; currently under development. Will make it possible to assign actions/files/folders to RFID-tags and configure some things. +After having Tonuino running on your ESP32 in your local WiFi, the webinterface-configuration is accessable. Using this GUI you can configure: +* Link between RFID-tag and corresponding action +* MQTT-configuration (broker's IP) +* FTP-configuration (username and password) +* General-configuration (volume, neopixel-brightness, sleep after inactivity) ### FTP (optional) In order to avoid exposing uSD-card or disassembling the Tonuino all the time for adding new music, it's possible to transfer music onto the uSD-card using FTP. Please make sure to set the max. number of parallel connections to ONE in your FTP-client. My recommendation is [Filezilla](https://filezilla-project.org/). But don't expect fast transfer, it's only around 145 kB/s and decreases dramatically, if music is played in parallel. Better stop playback then doing a FTP-transfer. Default-user and password are set via `ftpUser` and `ftpPassword`. diff --git a/openHAB/README.md b/openHAB/README.md new file mode 100644 index 0000000..dd1cda8 --- /dev/null +++ b/openHAB/README.md @@ -0,0 +1,17 @@ +# OpenHAB-integration for Tonuino + +## Disclaimer +[OpenHAB](https://www.openhab.org/) is a pretty complex software for home automation. I Just extracted that parts of my local config, that's necessary for Tonuino. Hopefully I didn't forget anything :-) Said this I want to rule out that this document's aim isn't to provide a fully-featured howto. For further informations please have a look at the project's [documentation](https://www.openhab.org/docs/). + +## What's necessary +In order to make use of my config-files you need to have a running openHAB-installation. Mine is running on the Raspberry Pi. In general there are two ways to achieve this: +* [Raspbian with manual openHAB-installation](https://www.openhab.org/docs/installation/rasppi.html) +* [openHABian](https://www.openhab.org/docs/installation/openhabian.html) +After completing the installation, [PaperUI](http://:8080/paperui/index.html) should be browsable. In order to get Tonuino running you need at least the MQTT-binding (Add-ons -> Bindings) and the Map-transformation (Add-ons -> transformations). +Beside of openHAB you need a MQTT-broker. You can use a public one but if there's already a Raspberry Pi running with openHAB, it probably makes sense to install [Mosquitto](https://mosquitto.org/) as MQTT-broker in parallel. + +## MQTT +After MQTT-broker is set up have look at mqttConnections.things in order to configure the MQTTT-connection between openHAB and the broker. In doubt restart openHAB as changes sometimes don't get recognized immediately without restart. If nothing happens have a look at the logfiles /var/log/openhab2/openhab.log or /var/log/openhab2/events.log. In general, to debug MQTT-stuff, [MQTT fx](https://mqttfx.jensd.de/) is a good tool to refer. + +## Important +In openHAB it's your choice to make use of configuration via Paper UI or textfiles. Sounds basically good but in fact it's not, because mixing up both can be really crappy and painstaking to debug. Make sure to only use one way. \ No newline at end of file diff --git a/openHAB/items/Home.items b/openHAB/items/Home.items new file mode 100644 index 0000000..35484a2 --- /dev/null +++ b/openHAB/items/Home.items @@ -0,0 +1,21 @@ +// Gruppen +Group Daheim + +// OG +Group Obergeschoss "Obergeschoss" (Daheim) +Group ZimmerTim "Kinderzimmer Tim" (Obergeschoss) + +// Zimmer Kind +Switch Tonuino_Sleep { channel="mqtt:topic:MQTT:tonuino:tonuino_sleep_mqtt", autoupdate="true" } +String Tonuino_Track { channel="mqtt:topic:MQTT:tonuino:tonuino_track_mqtt", autoupdate="true" } +Number Tonuino_Loudness "Lautstärke [%d]" { channel="mqtt:topic:MQTT:tonuino:tonuino_loudness_mqtt", autoupdate="true" } +String Tonuino_SleepTimer { channel="mqtt:topic:MQTT:tonuino:tonuino_sleeptimer_mqtt", autoupdate="true" } +String Tonuino_Status { channel="mqtt:topic:MQTT:tonuino:tonuino_status_mqtt", autoupdate="true", expire="2m, command=Offline" } +String Tonuino_CurrentTrack "Aktueller Track" { channel="mqtt:topic:MQTT:tonuino:tonuino_current_track_mqtt", autoupdate="true" } +String Tonuino_TrackControl "Track-Control" { channel="mqtt:topic:MQTT:tonuino:tonuino_track_control_mqtt", autoupdate="false" } +String Tonuino_IPv4 "IPv4-Adresse" { channel="mqtt:topic:MQTT:tonuino:tonuino_ipv4_mqtt", autoupdate="true" } +Switch Tonuino_LockControls "Bedienung sperren" { channel="mqtt:topic:MQTT:tonuino:tonuino_lock_controls_mqtt", autoupdate="true" } +Number Tonuino_Playmode "Aktueller Playmode [MAP(playmodes.map):%d]" { channel="mqtt:topic:MQTT:tonuino:tonuino_playmode_mqtt", autoupdate="true" } +Number Tonuino_LedBrightness "Helligkeit LEDs" { channel="mqtt:topic:MQTT:tonuino:tonuino_led_brightness_mqtt", autoupdate="true" } +DateTime Tonuino_LastUpdate "Letztes Update [%1$ta %1$tR]"