fhempy: Tuya Cloud

Begonnen von dominik, 30 Juli 2021, 21:36:48

Vorheriges Thema - Nächstes Thema

dominik

Lösch das bestehende Device aus FHEM raus und dann bitte wirklich Schritt für Schritt der Anleitung folgen:
https://github.com/dominikkarall/fhempy/blob/master/FHEM/bindings/python/fhempy/lib/tuya_cloud/README.md
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

thburkhart

#241
Zitat von: dominik am 09 Oktober 2021, 21:01:40
Lösch das bestehende Device aus FHEM raus und dann bitte wirklich Schritt für Schritt der Anleitung folgen:
https://github.com/dominikkarall/fhempy/blob/master/FHEM/bindings/python/fhempy/lib/tuya_cloud/README.md

ok ,, Link Tuya App Account fehlte

nun habe ich:

Fernseher_Schlafzimmer_10438000d8f15ba4ccd3 (Fernseher Schlafzimmer)
off
PythonModule
Gartengrill_12280017d8f15bdedda5 (Gartengrill)
off
PythonModule
Haustuere_60381718500291bade80 (Haustüre)
ready
PythonModule
Kleiderschrank_1_30180616dc4f22fc97ae (Kleiderschrank 1)
off
PythonModule
Petra_oben_bf3d3c043a37716331bhfb (Petra oben)
off
PythonModule
Rolltor_34602852ecfabc47cbe1 (Rolltor)
closed
PythonModule
SP2_Kuehlschrank_HWR_045074212cf432ca0721 (SP2 Kühlschrank HWR)
on
PythonModule
Schreibtisch_Petra_22230808bcddc2135132 (Schreibtisch Petra)
off
PythonModule
USB_Lader_1_Thomas_3367036770039f60ce2b (USB Lader 1 Thomas)
on
PythonModule
USB_Lader_2_Thomas_3367036770039f613620 (USB Lader 2 Thomas)
on
PythonModule
USB_Lader_3_Thomas_33670367c4dd573813d8 (USB Lader 3 Thomas)
on
PythonModule
Wasserpumpe_03132278b4e62d74b293 (Wasserpumpe)
ready
PythonModule


und meine Powerweerte bei Gosund  :)

active_time
1573220542
2021-10-09 21:06:43
add_ele
0.001
2021-10-09 21:06:43
biz_type
18
2021-10-09 21:06:43
category
cz
2021-10-09 21:06:43
countdown_1
0.0
2021-10-09 21:06:43
create_time
1573220542
2021-10-09 21:06:43
cur_current
847.0
2021-10-09 21:06:43
cur_power
131.4
2021-10-09 21:06:43
cur_voltage
236.0
2021-10-09 21:06:43


und nun sind alle 94 da :-)

Bad_2_07412404cc50e3746c29 (Bad 2)
off
PythonModule
Balkon_Stern_bf16f1788a2fd6edd6pr1d (Balkon Stern)
off
PythonModule
Camera_4_bfbeab33da30f5635ffj0r (Camera 4)
ready
PythonModule
Camera_5_Terrasse_bfd99c63a8b65928a56hdb (Camera 5 Terrasse)
ready
PythonModule
Camera_Buero_bf9e9fea71f3692d15gzrq (Camera Büro)
ready
PythonModule
Camera_Garage_bfffc31d13d14bca5dayj6 (Camera Garage)
ready
PythonModule
Camera_Garten_bf6b1900c331a78a2fkecw (Camera Garten)
ready
PythonModule
Camera_Hauseingang_bf3761a5af5f8d6361rmhh (Camera Hauseingang)
ready
PythonModule
Dimmer_2_21410806cc50e37bdb15 (Dimmer 2)
on
PythonModule
Dunstabzug_104380002462ab2f8ac0 (Dunstabzug)
on
PythonModule
Esstisch_074124042cf4326df127 (Esstisch)
on
PythonModule
Fernseher_Petra_620661512462ab30ddbd (Fernseher Petra)
off
PythonModule
Fernseher_Schlafzimmer_10438000d8f15ba4ccd3 (Fernseher Schlafzimmer)
off
PythonModule
Fernseher_Thomas_63667231dc4f22f32f01 (Fernseher Thomas)
on
PythonModule
Fernseher_Wohnzimmer_22230808bcddc2135068 (Fernseher Wohnzimmer)
on
PythonModule
Garagentor_47104178dc4f2236e437 (Garagentor)
on
PythonModule
Gartengrill_12280017d8f15bdedda5 (Gartengrill)
off
PythonModule
Globus_00715387f4cfa209ab1e (Globus)
off
PythonModule
Haustuere_60381718500291bade80 (Haustüre)
ready
PythonModule
Heizdecke_1_4530056170039f4a87e5 (Heizdecke 1)
off
PythonModule
Heizdecke_2_5062137624a1600b6d62 (Heizdecke 2)
off
PythonModule
Heizdecke_3_104380002462ab30258d (Heizdecke 3)
off
PythonModule
Heizkissen_1_50621376c4dd57131135 (Heizkissen 1)
off
PythonModule
Heizkissen_2_453005615002911dfe06 (Heizkissen 2)
off
PythonModule
JL04_BKT3_22230808807d3a23186b (JL04 BKT3)
on
PythonModule
JL07_BKT2_22230808bcddc2135137 (JL07 BKT2)
off
PythonModule
JL15_Kaffeemaschine_2223080884f3eb466414 (JL15 Kaffeemaschine)
on
PythonModule
Kleiderschrank_1_30180616dc4f22fc97ae (Kleiderschrank 1)
off
PythonModule
Kleiderschrank_2_8513738324a1601779dd (Kleiderschrank 2)
off
PythonModule
Kueche_Herd_30180616dc4f22fc9a71 (Küche Herd)
off
PythonModule
Kueche_oben_074124042cf4326f08c2 (Küche oben)
off
PythonModule
Leselampe_1_03132278b4e62d74ab52 (Leselampe 1)
off
PythonModule
Leselampe_2_03132278b4e62d74ab8f (Leselampe 2)
off
PythonModule
Leselampe_4_4530056170039f4a808b (Leselampe 4)
off
PythonModule
Leselampe_5_50621376c4dd57125717 (Leselampe 5)
off
PythonModule
PC_Schreibtisch_NAS_22230808807d3a231039 (PC Schreibtisch NAS)
off
PythonModule
PETRA_Nacht_1_00715387f4cfa2092c01 (PETRA Nacht 1)
off
PythonModule
PIR_Sensor_1_853556472cf4326e60da (PIR Sensor 1)
nomotion
PythonModule
PIR_Sensor_2_627425735002915f502b (PIR Sensor 2)
nomotion
PythonModule
PIR_Sensor_3_743066432cf43267661d (PIR Sensor 3)
nomotion
PythonModule
PS2___ESSEN_63667231dc4f22f329f1 (PS2 - ESSEN)
on
PythonModule
PS3___Wohnen_1_04086463840d8e50124b (PS3 - Wohnen 1)
off
PythonModule
PS4___Wohnen_2_63667231840d8e501cab (PS4 - Wohnen 2)
on
PythonModule
PS5___Garage_44277377840d8e5e47c8 (PS5 - Garage)
on
PythonModule
PS6___Schreibtisch_P_50050126dc4f22e5e4ee (PS6 - Schreibtisch P)
on
PythonModule
PS7___Balkon_50134218c4dd571b3390 (PS7 - Balkon)
on
PythonModule
Petra_oben_bf3d3c043a37716331bhfb (Petra oben)
off
PythonModule
Rolltor_34602852ecfabc47cbe1 (Rolltor)
closed
PythonModule
Router_EAP225_104380002462ab301b83 (Router EAP225)
on
PythonModule
SP11_THOMAS_Ost_62066151d8f15bb08810 (SP11 THOMAS Ost)
on
PythonModule
SP12_THOMAS_Sued1_00673231e09806cb13b0 (SP12 THOMAS Süd1)
on
PythonModule
SP13_THOMAS_Sued2_Schreibtisch_52470320e09806c9a53f (SP13 THOMAS Süd2 Schreibtisch)
on
PythonModule
SP14_PETRA_SuedOst_00673231e09806cb6fa5 (SP14 PETRA SüdOst)
on
PythonModule
SP15_PETRA_Bett_00673231e09806cb188e (SP15 PETRA Bett)
on
PythonModule
SP16_THOMAS_West_00673231e09806cbeaa2 (SP16 THOMAS West)
on
PythonModule
SP1_C_Smart_Socket_16A_045074212462ab24e988 (SP1-C Smart Socket-16A)
on
PythonModule
SP1_Waschmaschine_260064612cf432ca55d8 (SP1-Waschmaschine)
on
PythonModule
SP2_Kuehlschrank_HWR_045074212cf432ca0721 (SP2 Kühlschrank HWR)
on
PythonModule
SP3_Kuehlschrank_Kueche_260064612462ab24f164 (SP3 Kühlschrank Küche)
on
PythonModule
SP5_EX17_EX18_60020372840d8e6f937a (SP5 EX17 EX18)
off
PythonModule
SP6_EX20_WD125_41888155dc4f229d95af (SP6 EX20 WD125)
off
PythonModule
SP7_Garagenkeller_62066151d8f15bdec539 (SP7 Garagenkeller)
on
PythonModule
SP8_Wohnzimmer_00673231e09806cb0add (SP8 Wohnzimmer)
off
PythonModule
Schalter_Doppel_SW101E_2_0120018760019453b4b1 (Schalter Doppel SW101E-2)
off
PythonModule
Schlafzimmer_oben_30510063d8bfc00b396b (Schlafzimmer oben)
off
PythonModule
Schnellkocher_5062137624a1600b9479 (Schnellkocher)
on
PythonModule
Schreibtisch_Petra_22230808bcddc2135132 (Schreibtisch Petra)
off
PythonModule
Schreibtisch_Thomas_22230808bcddc213f838 (Schreibtisch Thomas)
on
PythonModule
Sirene_1_Temp_07847240dc4f225fdda0 (Sirene 1 Temp)
not support this device
PythonModule
Sirene_2_Temp_07847240bcddc29b03e9 (Sirene 2 Temp)
not support this device
PythonModule
Sirene_3_06515140cc50e3d62490 (Sirene 3)
ready
PythonModule
SmartBulb_LW_2_bfefd42e199ea92ee3jbwh (SmartBulb LW 2)
on
PythonModule
Springbrunnen_30180616dc4f22fc986a (Springbrunnen)
off
PythonModule
Steckdose_3_720570712462ab280270 (Steckdose 3)
off
PythonModule
Steckdose_4_720570712462ab27e625 (Steckdose 4)
off
PythonModule
Steckdose_Garage_1_3367036770039f60c576 (Steckdose Garage 1)
on
PythonModule
Steckdose_PETRA_1_17710212600194dbaba8 (Steckdose PETRA 1)
off
PythonModule
Steckdose_THOMAS_Tuere_17710212600194dba99d (Steckdose THOMAS Türe)
off
PythonModule
Thomas_oben_bf369b75b893e0b115nzuk (Thomas oben)
off
PythonModule
Toilette_067327848cce4ec3fe13 (Toilette)
on
PythonModule
TuerSensor_4_67242256f4cfa2ce1662 (TürSensor 4)
closed
PythonModule
Tuersensor_2_60381718807d3a04bbb4 (Türsensor 2)
ready
PythonModule
Tuersensor_3_60381718807d3a01eb63 (Türsensor 3)
ready
PythonModule
USB_Lader_1_Thomas_3367036770039f60ce2b (USB Lader 1 Thomas)
on
PythonModule
USB_Lader_2_Thomas_3367036770039f613620 (USB Lader 2 Thomas)
on
PythonModule
USB_Lader_3_Thomas_33670367c4dd573813d8 (USB Lader 3 Thomas)
on
PythonModule
USB_Lader_5_Bett_453005615002911e00b4 (USB Lader 5 Bett)
on
PythonModule
Wassermelder_180025363c6105dcdcaf (Wassermelder)
normal
PythonModule
Wasserpumpe_03132278b4e62d74b293 (Wasserpumpe)
off
PythonModule
Wassersensor_1_Kueche_50880180cc50e30cbe91 (Wassersensor 1 Küche)
2
PythonModule
Wassersensor_2_Heizraum_50880180840d8e87664b (Wassersensor 2 Heizraum)
2
PythonModule
Wassersensor_3_Waschmaschine_50880180cc50e30c4c90 (Wassersensor 3 Waschmaschine)
2
PythonModule
Wohnzimmer_4_887800042cf4325f15ef (Wohnzimmer 4)
off
PythonModule
ZOO_JL12_03132278a4cf12a5e7b0 (ZOO JL12)
1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

dominik

Gehen wir mal ein Device nach dem anderen durch...
Was für Readings hast du bei einem simplen on/off Switch, wie vermutlich Fernseher_Schlafzimmer_10438000d8f15ba4ccd3?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

thburkhart

Zitat von: dominik am 09 Oktober 2021, 21:14:02
Gehen wir mal ein Device nach dem anderen durch...
Was für Readings hast du bei einem simplen on/off Switch, wie vermutlich Fernseher_Schlafzimmer_10438000d8f15ba4ccd3?

das ist perfekt:

Readings
active_time
1561743877
2021-10-09 21:16:31
biz_type
18
2021-10-09 21:16:31
category
cz
2021-10-09 21:16:31
countdown_1
0.0
2021-10-09 21:31:22
create_time
1549400992
2021-10-09 21:16:31
cur_current
408.0
2021-10-09 21:31:22
cur_power
84.0
2021-10-09 21:31:22
cur_voltage
229.7
2021-10-09 21:31:22
icon
https://images.tuyaeu.com/smart/icon/1553147031mcc9hg5e3g_0.png
2021-10-09 21:16:31
id
22230808bcddc2135068
2021-10-09 21:16:31
ip
46.5.23.119
2021-10-09 21:16:31
lat
48.5584483
2021-10-09 21:16:31
local_key
c0aa3a00c215aa39
2021-10-09 21:16:31
lon
9.2025591
2021-10-09 21:16:31
model
HYS-01-039
2021-10-09 21:16:31
name
Fernseher Wohnzimmer
2021-10-09 21:16:31
online
on
2021-10-09 21:16:31
owner_id
3389434
2021-10-09 21:16:31
product_id
1hxNMF9lRQL2xpEA
2021-10-09 21:16:31
product_name
SMART SOCKET
2021-10-09 21:16:31
state
on
2021-10-09 21:31:22
sub
off
2021-10-09 21:16:31
time_zone
+01:00
2021-10-09 21:16:31
uid
eu1548823829280mLHX1
2021-10-09 21:16:31
update_time
1633780790
2021-10-09 21:16:31
uuid
22230808bcddc2135068
2021-10-09 21:16:31


ein update erfolgt ca. alle 2 sec

1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

dominik

Ok, das Update erfolgt nur, wenn sich Werte ändern, sonst sollte sich nix tun. Wenn du ein und aus schaltest (egal ob an der Hardware oder via SmartLife), muss das sofort auch in FHEM erscheinen.

Funktionieren allen einfachen on/off Switches? Wenn ja, dann bitte mal ein Device posten wo du Probleme hast.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

thburkhart

Zitat von: dominik am 09 Oktober 2021, 21:36:52
Ok, das Update erfolgt nur, wenn sich Werte ändern, sonst sollte sich nix tun. Wenn du ein und aus schaltest (egal ob an der Hardware oder via SmartLife), muss das sofort auch in FHEM erscheinen.

Funktionieren allen einfachen on/off Switches? Wenn ja, dann bitte mal ein Device posten wo du Probleme hast.

schalten funktioniert mit quasi sofortiger Wirkung :-)

was nicht rüber kommt sind die "electric"-Verbrauchswerte, die ich in der App je Monat sehe

BTW: sind das für diesen Fernseher 9,8 kWh monatlich also ca. 3€

diese Verbrauchsdaten wären für mich wichtig, am wichtigsten .. die Werte müssen ja in der Cloud liegen
und aus diesem Grund habe ich mir die zig Gosund beschafft, um die Stromkosten je Gerät monitoren zu können

kann man das bei Tuya noch bekommen ?

1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

thburkhart

#246
das soll keineswegs deine super Arbeit und deinen excellenten Support schmälern!!

ich bin begeistert !!


1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

dominik

Die Verbrauchswerte bekommst du aktuell nur in cur_power. Du kannst die mal in Log schreiben und dann als Grafik darstellen oder wahrscheinlich auch mit irgendeinem anderen Moduls summieren.

Laut Tuya Beschreibung sollte man die Verbrauchswerte auch von der Cloud bekommen können. Ich habe das noch nicht ausprobiert, werde ich aber noch testen, da mich die Werte auch interessieren :)
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Hast du eigentlich alle 96 Devices angelegt bekommen?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

thburkhart

Zitat von: dominik am 09 Oktober 2021, 21:51:58
Die Verbrauchswerte bekommst du aktuell nur in cur_power. Du kannst die mal in Log schreiben und dann als Grafik darstellen oder wahrscheinlich auch mit irgendeinem anderen Moduls summieren.

Laut Tuya Beschreibung sollte man die Verbrauchswerte auch von der Cloud bekommen können. Ich habe das noch nicht ausprobiert, werde ich aber noch testen, da mich die Werte auch interessieren :)

yepp das wäre mich auch sehr wichtig

übrigens: kann es sein, dass FHEm recht langsam wird, wenn es jede kleinste Änderung in power, voltage updaten muss?
1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

dominik

Das kommt drauf an :) Bei mir bleibt z.B. der cur_voltage Wert teilweise 5min gleich. Schau mal wie oft sich die Readings ändern, wenn das zu oft passiert, kannst ja mit event-* Attributen spielen um die Events zu reduzieren.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

thburkhart

Zitat von: dominik am 09 Oktober 2021, 22:07:14
Das kommt drauf an :) Bei mir bleibt z.B. der cur_voltage Wert teilweise 5min gleich. Schau mal wie oft sich die Readings ändern, wenn das zu oft passiert, kannst ja mit event-* Attributen spielen um die Events zu reduzieren.


bei diesen Werten kann ich zuschauen, wie sich alle 5-10 sec ändern:

cur_current
22.0
2021-10-09 22:12:47
cur_power
51.0
2021-10-09 22:12:47
cur_voltage
2308.0
2021-10-09 22:12:47


1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

dominik

Falls FHEM damit zu stark belastet wird, mach einfach event-on* Attribute rein.

Btw, cur_voltage 2308.0, da stimmt was nicht, sollte 230.8 sein. Ist das bei allen Devices der Fall?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

thburkhart

Zitat von: dominik am 09 Oktober 2021, 22:07:14
Das kommt drauf an :) Bei mir bleibt z.B. der cur_voltage Wert teilweise 5min gleich. Schau mal wie oft sich die Readings ändern, wenn das zu oft passiert, kannst ja mit event-* Attributen spielen um die Events zu reduzieren.

bewirken die nicht nur, dass die readings nur eingeschränkt ist Log geschrieben werden?
das Python-Module wir sie doch dennoch im sec-Takt pollen
1 RASPI4B, 1 RASPI3B, 2 CUL, 2 Jeelink, 60 Tuya-Devices (Schalter, Dimmer, Sensoren, Cameras), 30 HUE-Lampen, 5 MAX! WTs, 16 MAX! HTs, 12 MAX! FKs, 1 Bresser 5in1, 1 OilFox, 8 ALEXA Echos und Dots, FHEM, 5 Tasmota-Devices, SonOff -Bridge, PowerFox, Buderus KM200

dominik

Da pollt nix ;) Das ist ja das gute am tuya_cloud Modul, da wird einfach eine MQTT Verbindung zur tuya Cloud hergestellt und die schickt eine MQTT Message wenn sich was tut.

FHEM wird nur durch die Reading Updates belastet, wenn z.B. notifys/doifs/... darauf warten, dann werden diese immer geprüft.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik