Hauptmenü

Neueste Beiträge

#91
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von TomLee - 24 Januar 2026, 15:19:39
Dann wird es wohl was mit der verwendeten Perl-Version zu tun haben?
pi@raspi3b:/opt/fhem/FHEM $ perl -v
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_CTYPE = (unset),
        LC_NUMERIC = "de_DE.UTF-8",
        LC_COLLATE = (unset),
        LC_TIME = "de_DE.UTF-8",
        LC_MESSAGES = (unset),
        LC_MONETARY = "de_DE.UTF-8",
        LC_ADDRESS = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_MEASUREMENT = "de_DE.UTF-8",
        LC_PAPER = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").

This is perl 5, version 40, subversion 1 (v5.40.1) built for aarch64-linux-gnu-thread-multi
(with 48 registered patches, see perl -V for more detail)

Copyright 1987-2025, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

pi@fhempi:/opt/fhem/FHEM $ perl -v

This is perl 5, version 36, subversion 0 (v5.36.0) built for aarch64-linux-gnu-thread-multi
(with 53 registered patches, see perl -V for more detail)

Copyright 1987-2022, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.
#92
Sonstige Systeme / Aw: fhempy: tuya (lokal)
Letzter Beitrag von Prof. Dr. Peter Henning - 24 Januar 2026, 15:18:34
So, ich habe zwar noch kein richtiges Erfolgserlebnis, aber immerhin so eine Art "na ja, wenigstens etwas ...".

Hier steht seit ein paar Tagen ein Katzenklo mit Internet-Verbindung zur Tuya-Cloud. Nach dem Hinweis von Gisbert auf den tuya-Konnektor in fhempy habe ich das Zeug installiert. Anleitung in Github: geht so, etwas besser als die der Chinesen. Das Device wird auch erzeugt:
Internals:
   DEF        tuya xx xx 192.168.0.50 3.3 xx
   DEVICEID   xx
   FHEMPYTYPE tuya
   FUUID      6974c5eb-f33f-8771-ebe9-3da36e05351ece92
   IODev      fhempy_local
   NAME       tuya_local_bf984ab5d1501b6f13xecf
   NR         319
   PYTHONTYPE tuya
   STATE      ready
   TYPE       fhempy
   eventCount 12
   READINGS:
     2026-01-24 14:24:41   active_time     1768993958
     2026-01-24 14:24:41   biz_type        18
     2026-01-24 14:24:41   category        msp
     2026-01-24 14:24:41   create_time     1768993958
     2026-01-24 14:24:41   icon            smart/icon/bay1627386467137Cb6K/08bca26e14c7f1ebd8e5ea27ed656783.png
     2026-01-24 14:24:41   id              xx
     2026-01-24 14:24:41   ip              109.250.28.239
     2026-01-24 14:24:41   lat             49.0664
     2026-01-24 14:24:41   local_key       xxx
     2026-01-24 14:24:41   lon             8.5154
     2026-01-24 14:24:41   name            Smart Cat Litter Box
     2026-01-24 14:35:04   online          1
     2026-01-24 14:24:41   owner_id        xx
     2026-01-24 14:24:41   product_id      xx
     2026-01-24 14:24:41   product_name    Smart Cat Litter Box
     2026-01-24 14:35:04   state           ready
     2026-01-24 14:24:41   sub             0
     2026-01-24 14:24:41   time_zone       +01:00
     2026-01-24 14:24:41   uid             xx
     2026-01-24 14:24:41   update_time     1769256876
     2026-01-24 14:24:41   uuid            e45f2dfe61e4c30b
   args:
     tuya_local_xxx
     fhempy
     tuya
     xx
     3.3
     xx
   argsh:
Attributes:
   alias      KatzenKlo
   dp_06      cat_weight
   dp_07      excretion_times_day
   dp_08      excretion_time_day
   dp_17      deodorization
   dp_22      fault
   group      tuya
   localkey   xx
   room       fhempy
   tuya_spec_functions [{'code': 'deodorization', 'dp_id': 17, 'type': 'Boolean', 'values': {}, 'desc': 'deodorization'}]
   tuya_spec_status [{'code': 'dp1', 'dp_id': 1, 'type': 'Integer', 'values': {'unit': 'x', 'min': 0, 'max': 10000, 'scale': 0, 'step': 1}},{'code': 'dp2', 'dp_id': 2, 'type': 'Integer', 'values': {'unit': 'x', 'min': 0, 'max': 10000, 'scale': 0, 'step': 1}},{'code': 'dp3', 'dp_id': 3, 'type': 'Integer', 'values': {'unit': 'x', 'min': 0, 'max': 10000, 'scale': 0, 'step': 1}},{'code': 'dp4', 'dp_id': 4, 'type': 'Integer', 'values': {'unit': 'x', 'min': 0, 'max': 10000, 'scale': 0, 'step': 1}},{'code': dp5', 'dp_id': 5, 'type': 'Integer', 'values': {'unit': 'x', 'min': 0, 'max': 10000, 'scale': 0, 'step': 1}},{'code': 'cat_weight', 'dp_id': 6, 'type': 'Integer', 'values': {'unit': 'g', 'min': 600, 'max': 10000, 'scale': 0, 'step': 1}}, {'code': 'excretion_times_day', 'dp_id': 7, 'type': 'Integer', 'values': {'unit': 'times', 'min': 0, 'max': 60, 'scale': 0, 'step': 1}}, {'code': 'excretion_time_day', 'dp_id': 8, 'type': 'Integer', 'values': {'unit': 's', 'min': 0, 'max': 1800, 'scale': 0, 'step': 1}}, {'code': 'deodorization', 'dp_id': 17, 'type': 'Boolean', 'values': {}}, {'code': 'fault', 'dp_id': 22, 'type': 'Bitmap', 'values': {'label': ['motor_fault', 'program_fault', 'g_sensor_fault']}}]


Jetzt zum ABER.

Bei der automatischen Erzeugung wird nur ein set-Befehl für die Geruchsbeseitigung erzeugt (dp 17). Alle anderen "setzbaren" Dinge und Kommandos fehlen, so z.B. der manuelle Start eines Reinigungszyklus. Und auch eine ganze Menge an Statusangaben aus der App sind hier nicht vorhanden

==> Frage 1: Wie kann man herausfinden, welche Datenpunkte vorhanden sind - sowohl spec_functions, als auch spec_status sind bisher unvollständig? Wie man oben sieht, habe ich unter spec_status einfach mal auf gut Glück Datenpunkte hinzugefügt. Nutzt aber nichts
 
==> Frage 2: Wie kann man die Kiste dazu bringen, ein Statusupdate zu senden?

LG

pah
#93
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von TomLee - 24 Januar 2026, 15:14:10
Wenn ich in der Kommandozeile folgendes ausführe:

{use B qw(svref_2object);;
my $cv = svref_2object(\&hostname);;
print "Hostname kommt aus: " . $cv->FILE . "\n";;}

steht im Log:
Hostname kommt aus: /usr/share/perl/5.36/Net/Domain.pm
#94
Bastelecke / Aw: Entwicklung SIGNALDuino Em...
Letzter Beitrag von hajo23 - 24 Januar 2026, 15:11:22
Zitat von: DerD am 24 Januar 2026, 09:01:18
Zitat von: Ralf9 am 23 Januar 2026, 22:33:09da es z.Zt. recht schwierig ist einen Maple Mini zu bekommen, habe ich angefangen den Raspi Pico in die V 4.2.3 einzubauen.
Wäre denn die Bluepill nicht als 1:1 Ersatz verwendbar? Die ist ja gut verfügbar.

Du hast recht, es ist nicht so einfach sich zu orientieren. Unter den Bluepills gibt es auch noch unterschiedliche Varianten und man kann nicht irgendeinen nehmen. Bei mir laufen zwei "Bluepill-Plus", allerdings nicht "1:1", sondern auf einem Adapter für die Maple-Mini Platine, weil das Bluepill-Plus Board ein anderes Pinout hat. Ich hatte kurz darüber nachgedacht die Maple-Mini Platine anzupassen. Weil ich aber inzwischen ausreichend SignalDuinos habe, besteht da für mich kein Bedarf mehr. Zudem ist allgemein die Skepsis gegenüber den Bluepills groß, was vermutlich an den fehlerhaften Boards früherer Jahre liegt.

VG Hajo
#95
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von TomLee - 24 Januar 2026, 14:52:01
pi@fhempi:/opt/fhem/FHEM $ sudo -u fhem grep -nri 'Sys::Hostname' /opt/fhem
/opt/fhem/configDB.pm:196:use Sys::Hostname;
/opt/fhem/contrib/ble2mqttd:53:use Sys::Hostname;
/opt/fhem/FHEM/70_STV.pm:19:use Sys::Hostname;
/opt/fhem/FHEM/37_fakeRoku.pm:8:use Sys::Hostname;
/opt/fhem/FHEM/37_plex.pm:12:use Sys::Hostname;
/opt/fhem/FHEM/70_SamsungAV.pm:21:use Sys::Hostname;
/opt/fhem/FHEM/Meta.pm:528:  Sys::Hostname

Ich hab aber keines der Module im Einsatz.
#96
Anfängerfragen / Aw: Katzenklo mit Internetansc...
Letzter Beitrag von Prof. Dr. Peter Henning - 24 Januar 2026, 14:51:13
Zitat von: betateilchen am 24 Januar 2026, 08:57:17Elektronik rausschmeissen und die Steuerung mit ESP nachbauen?
Gewichtssensoren, Zeitsteuerung der Bewegung => sehr hoher Aufwand...

Ich mache den Thread jetzt hier dicht, habe das Ganze mit diesem tuya-fhempy so halb zum Laufen bekommen.

LG

pah
#97
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von TomLee - 24 Januar 2026, 14:49:08
ZitatDas dürfte auf deinem neuen System auch funktionieren:

{use Sys::Hostname;; hostname;;}

Ja, hätte ich zuvor einfach auch mal ausprobieren, das es aus dem Modul kommen könnte hab ich schon gelesen gehabt.
Wenn ich ein use Sys::Hostname; in der 99_myUtils.pm des Testsystem ergänze gibts die Funktion.
Dann kommt aber auch hier was zurück:
pi@raspi3b:/opt/fhem/FHEM $ grep -nHi "use Sys" 99*
99_myUtils.pm:11:use Sys::Hostname;

was beim Hauptsystem nicht der Fall ist.
#98
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von passibe - 24 Januar 2026, 14:45:05
Dann musst du ggfs. den Suchradius erweitern, vielleicht hast du ja mehr Dateien als nur die 99er angepasst.
Vielleicht mal:sudo -u fhem grep -nri 'Sys::Hostname' /opt/fhem
Bei mir gibt das:
/opt/fhem/configDB.pm:196:use Sys::Hostname;
/opt/fhem/FHEM/70_STV.pm:19:use Sys::Hostname;
/opt/fhem/FHEM/Meta.pm:528:  Sys::Hostname
/opt/fhem/FHEM/37_plex.pm:12:use Sys::Hostname;
/opt/fhem/FHEM/37_fakeRoku.pm:8:use Sys::Hostname;
/opt/fhem/FHEM/70_SamsungAV.pm:21:use Sys::Hostname;

Wenn ich das jetzt aber sehe: Ich vermute mal, dass du eines dieser Module auf dem Hauptsystem im Einsatz hast (configDB?). Sys::Hostname wird dann ja automatisch geladen und steht zur Verfügung. Im frischen Testsystem ist keines der o.g. Module geladen, weil es ja frisch ist, deshalb auch kein {hostname}.
#99
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von TomLee - 24 Januar 2026, 14:35:39
pi@fhempi:/opt/fhem/FHEM $ grep -nH "Hostname" 99*
pi@fhempi:/opt/fhem/FHEM $ grep -nHi "hostname" 99*
99_myUtils.pm:151:      my $fhemip = (split(/\s+/,qx(hostname -I)))[0];

Mehr ist nicht.
#100
Perl für FHEM-User / Aw: Funktion hostname in FHEM?
Letzter Beitrag von TomLee - 24 Januar 2026, 14:33:03
Hi,

Auf beiden System hab ich nichts an der sudoers geändert, in beiden steht das gleiche:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# This fixes CVE-2005-4890 and possibly breaks some versions of kdesu
# (#1011624, https://bugs.kde.org/show_bug.cgi?id=452532)
Defaults        use_pty

# This preserves proxy settings from user environments of root
# equivalent users (group sudo)
#Defaults:%sudo env_keep += "http_proxy https_proxy ftp_proxy all_proxy no_proxy"

# This allows running arbitrary commands, but so does ALL, and it means
# different sudoers have their choice of editor respected.
#Defaults:%sudo env_keep += "EDITOR"

# Completely harmless preservation of a user preference.
#Defaults:%sudo env_keep += "GREP_COLOR"

# While you shouldn't normally run git as root, you need to with etckeeper
#Defaults:%sudo env_keep += "GIT_AUTHOR_* GIT_COMMITTER_*"

# Per-user preferences; root won't have sensible values for them.
#Defaults:%sudo env_keep += "EMAIL DEBEMAIL DEBFULLNAME"

# "sudo scp" or "sudo rsync" should be able to use your SSH agent.
#Defaults:%sudo env_keep += "SSH_AGENT_PID SSH_AUTH_SOCK"

# Ditto for GPG agent
#Defaults:%sudo env_keep += "GPG_AGENT_INFO"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "@include" directives:

@includedir /etc/sudoers.d