Diese Seite ist nicht auf Deutsch verfügbar.

This is a chatbot written in python. Currently it only supports XMPP/Jabber, but Matrix can surely be made working again and other protocols added.

Source code will be provided here — maybe soon, or maybe when someone asks for it…

1. Features

  • The bot knows its users, who can configure their language (currently german and bad english) and some details.

  • Fine grained permission system for every user controls which extensions are available, which data can be seen (with or without history) and which data can be written to.

  • Users can create and use macros.

  • Depending on the configuration, users may just use the bot, maybe with enforced mutual presence subscription, or need to be invited by the bot’s admin.

  • A MUC (multi user chat) can be a user, too.

  • It includes kind of a time series database. Data is fed into this database from mqtt or from the bot itself. For every value included you can configure how many datapoints should be kept in a circular buffer, and how to compress older datapoints. Data can be queried/downloaded/plotted. There also is a http server which can provide access to the data (currently used with some javascript code (unreleased) to provide a web interface to my home automation).

  • Core functionality can easily be extended by the admin, even by using the chat interface. A single file provides a script (question or command from a users point of view) including its help and meta information. The same holds for rules, which can execute code because of a time condition or when (certain) values are changed.

  • Integrated help. All those help texts can be read here, too.

  • Some precautions have been taken to prevent users from overloading the bot’s server (per user config by using the permission system).

  • A dialog system can be used to provide functionality without having to know syntax (and is used in some extensions)

2. Use case examples

  • read data from the internet, distribute alerts

  • implement an enhanced wetterbot or jabrss

  • Monitor a system’s log files and usage data (CPU, RAM, disks)

  • Connect to a home automation (or other) system (or even be its central controller) by reading from and writing to a mqtt broker. Useful to test new sensors, notify about important events, configure the system. No need to access/open up your network from the outside (by using a VPN or something).

  • Make your data available to others: the initial use case for my public bot was to help someone living nearby by notifying him when outside dew point was low/high so he knew when to open/close the windows to his moist basement.

  • Monitor changes in the family’s CalDav calendar and notify about changes (in use but unpublished)

  • Without any extension or connections to other services, it can be used to test XMPP things:

    • echo test

    • periodically send messages including timestamp and message counter to test notifications or general receive behaviour

    • notify about presence changes

3. Try it out, chat about it

A publicly available instance is running at bex@jotwewe.de (you need to make sure mutual presence subscription exists, otherwise it won’t talk to you. You can turn it off again once it has accepted you as a user).

There are two MUCs where you can discuss it and also try it out (because it is a member there): english support and test chatroom and german support and test chatroom.

This bot does only use code which is available in the base package. In addition to base features it receives some data via mqtt which you can view, monitor (using included rules), download, and plot. The data currently available to everyone is enviromental data from Karlsruhe, Germany.

From outside of my home:

K3Lueft_T_0     Temperature, °C
K3Lueft_T_TP_0  Dew point, °C. Value is too high usually
K3Lueft_RH_0    Relative humidity, percent. Value is too high usually
K3Lueft_u12_3   Rain sensor. <1950 means it is wet
Logger_P_PV     Current power of solar electric cells
Mome1_T_LUBW           Temperature
Mome1_T_LUBW_TP        Dew point
Mome1_RH_LUBW          Relative humidity
Mome1_RegenSum_LUBW    Rain

4. Todo list

The list of ideas is long and growing. Some of the next or important steps:

  • opt for a license, publish code

  • iron out presence subscription stuff

  • internal clean up

  • publish android app for alarm notifications (works on top of conversations and surely other apps)

  • values should have a unit of measure

  • adapt mqtt structure to https://www.home-assistant.io/ ? It can already be adapted on a small scale by changing one file, but…


Letzte Änderung: 17.09.2021 20:16
Jens W. Wulf

Impressum
Datenschutzerklärung