fhempy: miio (Xiaomi WiFi Devices)

Begonnen von dominik, 30 Oktober 2020, 21:26:31

Vorheriges Thema - Nächstes Thema

dominik

Hi,
sollte in 0.1.18 behoben sein.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Hallo Dominik,

seit ein paar Tagen gehe ich mit fhempy auf Entdeckungsreise, um zu erkunden, was für mich brauchbar sein könnte  :)
Erstmal DANKE, was du in kurzer Zeit aus dem Boden gestampft hast.

Da ich so einige XIAOMI Devices in Betrieb habe ist das natürlich ein interessanter Teilbereich hier.
Das Modul mit der Übersicht aller Tokens ist natülich sehr praktisch und wird mir in der Zukunft die Suche nach "wie ging das gleich wieder" ersparen  8)

Das Modul Yeelight hat gegenüber der alten Implementierung den Vorteil, dass es auch "funktioniert", wenn eine Lampe durch den normalen Lichtschalter gerade keinen Strom hat. In der alten Implementierung steht in diesem Fall im set immer ein ekelhafter Syntax Error. Allerdings erschließen sich mir die mit fhempy angebotenen Set-Methoden noch nicht so richtig, da die meisten weitere Argumente erfordern. Mit "toggle" kan ich zwar ein- und ausschalten, bei on und off brauche ich aber schon Argumente und rgb verstehe ich gar nicht.

Hier ist mal ein jsonlist2 von einem LED Strip:


{
  "Arg":"da_LEDStrip",
  "Results": [
  {
    "Name":"da_LEDStrip",
    "PossibleSets":"raw_command info:noArg status:noArg on off set_brightness set_color_temp set_rgb set_developer_mode:on,off set_save_state_on_change:on,off set_name toggle:noArg set_default:noArg",
    "PossibleAttrs":"alias comment:textField-long eventMap:textField-long group room suppressReading userReadings:textField-long verbose:0,1,2,3,4,5 update_functions IODev event-aggregator event-min-interval event-on-change-reading event-on-update-reading oldreadings stateFormat:textField-long timestamp-on-change-reading DMX_B DMX_G DMX_R andFHEM_alias assistantName:textField cmdIcon devStateIcon devStateIcon:textField-long devStateStyle fp_Dach fp_Eingang fp_Erdgeschoss fp_ErsterStock fp_Garten fp_Keller gassistantName:textField genericDeviceType:ac_unit,aircondition,airfreshener,airpurifier,awning,bathtub,bed,blender,blinds,boiler,camera,carbon_monoxide_detector,charger,closet,coffee_maker,coffeemaker,cooktop,curtain,dehumidifier,dehydrator,dishwasher,door,drawer,dryer,fan,faucet,fireplace,fryer,garage,gate,grill,heater,hood,humidifier,kettle,light,lock,remotecontrol,mop,mower,microwave,multicooker,network,outlet,oven,pergola,petfeeder,pressurecooker,radiator,refrigerator,router,scene,securitysystem,settop,sensor,shutter,shower,smoke_detector,sousvide,sprinkler,standmixer,switch,tv,thermostat,vacuum,valve,washer,waterheater,waterpurifier,watersoftener,window,yogurtmaker,aircooler,audio_video_receiver,freezer,speaker,streaming_box,streaming_stick,streaming_soundbar,soundbar homebridgeMapping:textField-long icon lightSceneParamsToSave msgContactAudio msgContactLight msgContactMail msgContactPush msgContactScreen msgParams msgPriority msgRecipient msgRecipientAudio msgRecipientLight msgRecipientMail msgRecipientPush msgRecipientScreen msgRecipientText msgTitle msgTitleShrt msgType:text,push,mail,screen,light,audio,queue realRoom:textField realtimePicker room_map sortby webCmd webCmdLabel:textField-long widgetOverride userattr",
    "Internals": {
      "DEF": "miio yeelight 192.168.178.104 9a98aafb28a19466986a19fd052be27c",
      "FUUID": "5ff056e6-f33f-cc40-1c99-7bb21411a45c8360",
      "FVERSION": "10_PythonModule.pm:0.182830/2019-01-16",
      "IODev": "local_pybinding",
      "NAME": "da_LEDStrip",
      "NR": "1261",
      "PYTHONTYPE": "miio",
      "STATE": "active",
      "TYPE": "PythonModule"
    },
    "Readings": {
      "accesspoint_bssid": { "Value":"44:4E:6D:5B:9E:D0", "Time":"2021-01-02 12:20:23" },
      "accesspoint_rssi": { "Value":"-60", "Time":"2021-01-08 12:39:44" },
      "accesspoint_ssid": { "Value":"BUWO", "Time":"2021-01-02 12:20:23" },
      "brightness": { "Value":"14", "Time":"2021-01-02 12:20:22" },
      "color_mode": { "Value":"YeelightMode.ColorTemperature", "Time":"2021-01-02 17:23:16" },
      "color_temp": { "Value":"4540", "Time":"2021-01-02 17:23:16" },
      "developer_mode": { "Value":"1", "Time":"2021-01-02 12:20:22" },
      "firmware_version": { "Value":"1.4.2_0050", "Time":"2021-01-02 12:20:23" },
      "hardware_version": { "Value":"MW300", "Time":"2021-01-02 12:20:23" },
      "is_on": { "Value":"0", "Time":"2021-01-08 11:01:29" },
      "mac_address": { "Value":"78:11:DC:A2:15:CE", "Time":"2021-01-02 12:20:23" },
      "model": { "Value":"yeelink.light.strip1", "Time":"2021-01-02 12:20:23" },
      "network_interface_gw": { "Value":"192.168.178.1", "Time":"2021-01-02 12:20:23" },
      "network_interface_gw_mac": { "Value":"44:4E:6D:5B:9E:CD", "Time":"2021-01-02 12:20:23" },
      "network_interface_localIp": { "Value":"192.168.178.104", "Time":"2021-01-02 12:20:23" },
      "network_interface_mask": { "Value":"255.255.255.0", "Time":"2021-01-02 12:20:23" },
      "presence": { "Value":"online", "Time":"2021-01-02 12:20:23" },
      "rgb": { "Value":"", "Time":"2021-01-02 17:23:16" },
      "save_state_on_change": { "Value":"0", "Time":"2021-01-02 12:20:22" },
      "state": { "Value":"active", "Time":"2021-01-02 12:20:22" }
    },
    "Attributes": {
      "IODev": "local_pybinding",
      "room": "Dach,YeeLight",
      "verbose": "5"
    }
  }  ],
  "totalResultsReturned":1
}


Wirst du hier noch verfeinern oder ist das alles ein eher generischer Ansatz?

Ich habe auch noch zu den Peers und Bluetooth einige Unklarheiten, die in diesem Thread eigentlich OT sind. Ich weiß nur nicht wohin damit:
- einen Peer konnte ich auf einem weitern Raspi anlegen und er wurde in FHEM auch erkannt und erzeugt, bei Update bekomme ich aber folgende Meldung im FHEM Log (obwohl er laut Reading auf dem aktuellen Versionsstand ist):

2021.01.08 11:54:50 1: ws:192.168.178.77:15733 disconnected, waiting to reappear (fhempy_peer_192_168_178_77)
2021.01.08 11:54:50 1: BindingsIo: ERROR fhempy_peer_192_168_178_77 - error while connecting: 192.168.178.77: Verbindungsaufbau abgelehnt (111)

- Benötige ich für jede Instanz (fhem,peers) je ein define für mein Handy, wenn ich es mit Bluetooth Presence Checker lokalisieren möchte?
- BLE Presence: Ich kann mit "sudo find /opt/fhem -name bluepy-helper" nichts finden (mit dem adequaten Kommando auf meinem Peer übrigens auch nicht). Wie kann ich den Helper installieren?
- Was müsste eigentlich mit dem Modul discover_ble erkennbar sein? Ich habe es angelegt, sehe aber nichts, außer das es "active" ist. Sollte es BLE Devices von selbst finden? Ist aber wahrscheinlich eine Folge des fehlenden Helpers, oder?

Da ich im Binding Log eine paarFehler sehe, hänge ich es hier mal mit rein:

2021-01-08 07:48:57,634 - ERROR    - upnp: Error in handle_msg
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/discover_upnp/discover_upnp.py", line 126, in handle_msg
    del listenerFilter["found_devices"][usn]
KeyError: 'uuid:3DCC7100-F76C-11DD-87AF-305890619AC8::urn:schemas-upnp-org:device:MediaRenderer:1'
2021-01-08 07:48:57,739 - ERROR    - upnp: Error in handle_msg
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/discover_upnp/discover_upnp.py", line 126, in handle_msg
    del listenerFilter["found_devices"][usn]
KeyError: 'uuid:3DCC7100-F76C-11DD-87AF-305890619AC8::urn:schemas-upnp-org:device:MediaRenderer:1'
2021-01-08 07:48:57,763 - ERROR    - upnp: Error in handle_msg
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/discover_upnp/discover_upnp.py", line 126, in handle_msg
    del listenerFilter["found_devices"][usn]
KeyError: 'uuid:3DCC7100-F76C-11DD-87AF-305890619AC8::urn:schemas-upnp-org:device:MediaRenderer:1'
2021-01-08 08:01:31,036 - ERROR    - asyncio: Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0xb08dc8f0>
2021-01-08 10:15:30,734 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2021-01-08 10:17:00,072 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-01-08 10:17:00,091 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-01-08 10:18:39,195 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-01-08 10:18:39,214 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-01-08 10:18:49,502 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-01-08 10:18:53,832 - ERROR    - da_LEDStrip: Annotation is not class: typing.Tuple[int, int, int]
/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/miio/miio.py:73: UserWarning: Please consider using python-yeelight for more complete support.
  self._device = self._miio_device_class(ip=self._miio_ip, token=self._miio_token)
2021-01-08 10:19:01,445 - ERROR    - MEDIONRadio_MediaRenderer: Device exists already, do not create a new one
2021-01-08 10:19:04,538 - ERROR    - fhempy.lib.fhem: Timeout - NO RESPONSE for command: foreach my $fhem_dev (sort keys %main::defs) {  return 1 if(defined($main::defs{$fhem_dev}{TYPE}) && $main::defs{$fhem_dev}{TYPE} eq 'BindingsIo' && $main::defs{$fhem_dev}{IP} eq '192.168.178.77');;}return 0;;
2021-01-08 11:07:41,427 - ERROR    - wz_Lampe: Annotation is not class: typing.Tuple[int, int, int]
2021-01-08 11:07:46,436 - ERROR    - wz_Lampe: Failed to send_command: info
2021-01-08 11:07:46,436 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:08:51,461 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:09:56,479 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:11:01,505 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:12:06,518 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:13:11,531 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:14:16,552 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:15:21,571 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:16:26,592 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:17:31,612 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:17:51,458 - ERROR    - wz_Lampe: Failed to send_command: info
2021-01-08 11:18:36,632 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:19:41,883 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:20:46,902 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:21:51,924 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:22:56,944 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:24:01,958 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:25:06,982 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:26:12,000 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:27:17,018 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:27:56,485 - ERROR    - wz_Lampe: Failed to send_command: info
2021-01-08 11:28:22,038 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:29:27,053 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:30:32,065 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:31:37,084 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:32:42,105 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:33:47,125 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:34:52,141 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:35:57,157 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:37:02,178 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:38:01,505 - ERROR    - wz_Lampe: Failed to send_command: info
2021-01-08 11:38:07,195 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:39:12,216 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:40:17,236 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:41:23,932 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:42:28,945 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:43:33,961 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:44:38,978 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:45:44,000 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:46:49,017 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:46:51,971 - ERROR    - fhempy.lib.fhem: Timeout - NO RESPONSE for command: readingsBulkUpdateIfChanged($defs{'da_LEDStrip'},'is_on','0');;
2021-01-08 11:46:52,117 - ERROR    - fhempy.lib.fhem: Timeout - NO RESPONSE for command: readingsBulkUpdateIfChanged($defs{'MEDIONRadio_MediaRenderer'},'media_duration','');;
2021-01-08 11:47:54,041 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:48:06,521 - ERROR    - wz_Lampe: Failed to send_command: info
2021-01-08 11:48:59,058 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:50:04,075 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:51:09,092 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:52:14,110 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:53:19,123 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:54:24,141 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:55:29,155 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:56:34,178 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:57:39,195 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:58:11,535 - ERROR    - wz_Lampe: Failed to send_command: info
2021-01-08 11:58:44,214 - ERROR    - wz_Lampe: Failed to send_command: status
2021-01-08 11:59:07,072 - INFO     - fhempy.lib.pkg_installer: Attempting install of fhempy
2021-01-08 11:59:15,462 - ERROR    - asyncio: Task exception was never retrieved
future: <Task finished coro=<PyBinding.onMessage() done, defined at /opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py:123> exception=SystemExit(1)>
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 125, in onMessage
    await self._onMessage(payload)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 377, in _onMessage
    raise se
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 158, in _onMessage
    sys.exit(1)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
    self._run_once()
  File "/usr/lib/python3.7/asyncio/base_events.py", line 1775, in _run_once
    handle._run()
  File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 127, in onMessage
    sys.exit(1)
SystemExit: 1
2021-01-08 11:59:16,532 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2021-01-08 11:59:16,551 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2021-01-08 11:59:26,016 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1
2021-01-08 11:59:27,195 - ERROR    - da_LEDStrip: Annotation is not class: typing.Tuple[int, int, int]
/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/miio/miio.py:73: UserWarning: Please consider using python-yeelight for more complete support.
  self._device = self._miio_device_class(ip=self._miio_ip, token=self._miio_token)
2021-01-08 11:59:27,213 - ERROR    - wz_Lampe: Annotation is not class: typing.Tuple[int, int, int]

Anmerkungen:
- wz_Lampe ist die Yeelight Lampe ohne Strom
- FHEM-Update war heute um 10:15 Uhr

Danke schon mal  :)
Keiner der Punkte ist eilig.

Viele Grüße
Dieter
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Hi,

hier die Antworten:
- miio: Du kannst on, off auch ohne Parameter nutzen. Die Erklärung der Parameter sollte jeweils nach Auswahl im set erscheinen. Beispiel on: transition mode
Nun ist klar, dass transation und mode noch nicht viel aussagen, die Implementierung ist aber so generisch, dass jegliche Weiterentwicklungen in miio automatisch auch in FHEM funktionieren. Wenn man genauer wissen will was es ist, kann man noch im Source Code von miio nachschauen, Beispiel: https://github.com/rytilahti/python-miio/blob/master/miio/yeelight.py#L162
- fhempy Update: Das ist normal, bei einem Update wird die Verbindung kurz getrennt, da der Remote Peer neu gestartet wird.

Bitte erstell für die Bluetooth Fragen einen eigenen Thread (fhempy: Bluetooth Fragen), da das hier sonst zu OT wird. Schick mir gerne eine PN mit dem Link auf den Thread, dann antworte ich dir dort.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Danke für die Antworten  :)

Meine Bluetooth-Fragen sind nun in einem neuen Thread (https://forum.fhem.de/index.php/topic,117689.0.html)

Bzgl. Yeelight und den settern on und off habe ich festgestellt, dass bei mir gar nichts passiert. Auch wenn ich 0 oder 1 als Transition Mode setze passiert hier nichts. Nur mit toggle kann ich den Yeelight Strip ein und ausschalten. Die Readings sehen gut aus und "is_on" wird beim Toggle korrekt aktualisiert.


Viele Grüße
Dieter
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Verstehe ich richtig, dass ein normales "on" ohne weitere Argumente nicht geht? Bekommst du im PythonBinding Log eventuell einen Fehler dazu?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Ja, alles richtig verstanden. Leider keinen einzigen Eintrag im Log. Verbose ist auf 5.
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Aah: on 0 0 funktioniert und off 0 auch
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Sehr gut, dann weiß ich schon ungefähr woran es liegt. Parameter die nicht angegeben werden, muss ich beim Aufruf der Funktion weglassen und das Risiko eingehen, dass diese Optional sind. Vielleicht kann ich das so umbauen.

Übrigens, was steht bei dir im Hilfetext unter dem set ... on? Steht da "Arguments: transition mode" oder "Arguments: transition=0 mode=0"?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

bei on steht "Arguments: transition mode" - das hatte/hätte ich als einen Begriff interpretiert
bei off steht nur "Arguments: transition" - aha, deshalb reicht hier eine Null
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Ok, das kann ich vielleicht anpassen, dass dort auch der Default Wert steht.
Ich baue das mal morgen ein, dann sollte es auch ohne Argumente gehen.

on 10 1 oder so müsste eigentlich auch gehen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

RockFan

Guten Morgen Dominik,
ja on 10 1 geht z.B. auch
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

RockFan

Hallo Dominik,

jetzt bin ich erfolgrauch auf Version 0.1.25 und habe es nochmal mit set für on und off ausprobiert.
Sollte es schon ohne Argumente gehen? Ich muss immer noch die Argumente mit angeben.
Einziger Unterschied:
Nun steht "Arguments: transition=0 mode=0" bei on, "Arguments: transition=0" bei off und auch bei anderen set Kommandos noch etwas mehr brauchbare Info.

Viele Grüße
Dieter
Raspbian (Buster) auf Raspberry Pi 4 /  CUL + RFXTRX + TCM / FS20, FHT 80B, S300TH, Intertechno, DMX, Milight, EnOcean, Homematic, AMAD, Home Connect, MiSmartHome, Yeelight, ...

dominik

Ok, dann muss ich mir das nochmals anschauen, sollte nämlich gehen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Madstar2409

Hallo Dominik,

vielen Dank erstmal für deinen Support. Ich habe mir nun die 10 Seiten mal durchgelesen.
Dann habe ich angefangen das Modul in meinen FHEM anzulegen. Es hat meines Erachtens auch alles soweit geklappt.
Dann habe versucht meinen Dreame D9 (Saugroboter aus demXiaomi Ökosystem) und konnte ihn auch einbinden mit dem entsprechenden Token aus "xiaomi_tokens"(Hier empfehlt es sich statt der E-Mail Adresse den Usernamen aus der Xiaomi Home APP zu nehmen statt der E-Mail. Ist eine lange Zahl). das hat auch geklappt aber es kommen nur ein paar readings rein.


defmod miio_vacuum_382944668 PythonModule miio vacuum 192.168.178.189 6*************
attr miio_vacuum_382944668 IODev local_pybinding
attr miio_vacuum_382944668 room Saugroboter

setstate miio_vacuum_382944668 active
setstate miio_vacuum_382944668 2021-03-02 11:14:58 accesspoint_bssid ********
setstate miio_vacuum_382944668 2021-03-02 13:25:46 accesspoint_rssi -57
setstate miio_vacuum_382944668 2021-03-02 11:14:58 accesspoint_ssid *********
setstate miio_vacuum_382944668 2021-03-02 11:14:58 firmware_version 3.5.8_1072
setstate miio_vacuum_382944668 2021-03-02 11:14:58 hardware_version Linux
setstate miio_vacuum_382944668 2021-03-02 11:14:58 mac_address ************
setstate miio_vacuum_382944668 2021-03-02 11:14:58 model dreame.vacuum.p2009
setstate miio_vacuum_382944668 2021-03-02 11:14:58 network_interface_gw 192.168.178.1
setstate miio_vacuum_382944668 2021-03-02 11:14:58 network_interface_localIp 192.168.178.189
setstate miio_vacuum_382944668 2021-03-02 11:14:58 network_interface_mask 255.255.255.0
setstate miio_vacuum_382944668 2021-03-02 11:15:19 presence offline
setstate miio_vacuum_382944668 2021-03-02 13:34:51 state active


mit "journalctl -u fhempy.service -f" bekomme ich nur folgenden output:


Mär 02 13:47:17 raspberrypi fhempy[1262]: 2021-03-02 13:47:17,426 - ERROR    - miio_vacuum_382944668: Failed to send_command: status
Mär 02 13:47:25 raspberrypi fhempy[1262]: 2021-03-02 13:47:25,840 - INFO     - asyncio: poll 59999.213 ms took 8385.619 ms: 1 events
Mär 02 13:47:29 raspberrypi fhempy[1262]: 2021-03-02 13:47:29,475 - INFO     - asyncio: poll 51604.024 ms took 3625.210 ms: 1 events
Mär 02 13:48:17 raspberrypi fhempy[1262]: 2021-03-02 13:48:17,502 - INFO     - asyncio: poll 47936.592 ms took 47985.100 ms: timeout
Mär 02 13:48:37 raspberrypi fhempy[1262]: 2021-03-02 13:48:37,705 - ERROR    - miio.miioprotocol: Got error when receiving: timed out
Mär 02 13:48:37 raspberrypi fhempy[1262]: 2021-03-02 13:48:37,707 - INFO     - asyncio: poll 446199.593 ms took 20194.595 ms: 1 events
Mär 02 13:48:37 raspberrypi fhempy[1262]: 2021-03-02 13:48:37,711 - ERROR    - miio_vacuum_382944668: Failed to send_command: status
Mär 02 13:49:37 raspberrypi fhempy[1262]: 2021-03-02 13:49:37,801 - INFO     - asyncio: poll 59998.946 ms took 60059.185 ms: timeout
Mär 02 13:49:57 raspberrypi fhempy[1262]: 2021-03-02 13:49:57,986 - ERROR    - miio.miioprotocol: Got error when receiving: timed out
Mär 02 13:49:57 raspberrypi fhempy[1262]: 2021-03-02 13:49:57,987 - INFO     - asyncio: poll 365901.344 ms took 20176.564 ms: 1 events
Mär 02 13:49:57 raspberrypi fhempy[1262]: 2021-03-02 13:49:57,989 - ERROR    - miio_vacuum_382944668: Failed to send_command: status
Mär 02 13:50:58 raspberrypi fhempy[1262]: 2021-03-02 13:50:58,084 - INFO     - asyncio: poll 59998.944 ms took 60059.175 ms: timeout
Mär 02 13:51:18 raspberrypi fhempy[1262]: 2021-03-02 13:51:18,280 - ERROR    - miio.miioprotocol: Got error when receiving: timed out
Mär 02 13:51:18 raspberrypi fhempy[1262]: 2021-03-02 13:51:18,282 - INFO     - asyncio: poll 285617.916 ms took 20187.843 ms: 1 events
Mär 02 13:51:18 raspberrypi fhempy[1262]: 2021-03-02 13:51:18,286 - ERROR    - miio_vacuum_382944668: Failed to send_command: status


Kannst du mir weiter helfen?

VG
Madstar2409