Pilight mit 433Mhz (Pollin) Steckdosen / Integration HomeAssistant

idurz

New member
Hallo,
mein erstes Projekt auf dem Raspi war vor mehr als 10 Jahren eine 433 Mhz Steckdose mit einem Raspberry 1 über das Smartphone ein- und aus zu schalten.
Bei der großen Menge der zur Zeit populären Zeitschaltuhren erinnerte ich mich an das Projekt. Es ist doch doof, diverse Schaltuhren zu verteilen und die auch noch weitgehende zu syncronisieren.

In der "Raspi"-Kiste fand sich noch der olle Raspberry mit dem aufgelöteten 433Mhz Sender.
Die Welt hat sich weitergedreht und nun gibt es das Projekt "PiLight", welches eine vordergründig leichte HA-Integration anbietet.
Die Installation war schnell erledigt und nach ein paar Klippen kann ich nun meine Pollin-/Elro Steckdosen per SSH an- und ausschalten:

"pilight-send -p pollin --systemcode=16 --unitcode=16 --on" schaltet die Lampe an.

Nun gibt es für den HomeAssistant eine Erweiterung über die configuration.yaml
Die Instanz "pilight" kann ich eintragen, ohne das jemand meckert.

YAML:
pilight:
  host: 192.168.1.149
  port: 5001
  send_delay: 0.4
# ab hier wird gemeckert
switch:
- platform: pilight
  switches:
   Lampe 1:
    on_code:
     protocol: pollin
     systemcode: 16
     unitcode: 16
     'on': 1
    off_code:
     protocol: pollin
     systemcode: 16
     unitcode: 16
     'off': 1

Geht es an die "switch" wird gemeckert:

Konfiguration fehlerhaft!

YAML:
Integration error:      protocol - Integration '     protocol' not found.
Integration error:    Lampe - Integration '   Lampe' not found.
Integration error:      unitcode - Integration '     unitcode' not found.
Integration error:      'on' - Integration '     'on'' not found.
Invalid config for [switch.pilight]: required key not provided @ data['switches']. Got None. (See ?, line ?).
Integration error:   switches - Integration '  switches' not found.
Integration error:     off_code - Integration '    off_code' not found.
Integration error:      systemcode - Integration '     systemcode' not found.
Integration error:      'off' - Integration '     'off'' not found.
Integration error:     on_code - Integration '    on_code' not found.

Offenbar sind die Parameter abhängig vom Protokoll - hier Pollin (Elro geht auch)

Hat jemand Erfahrung?
Grüße
Rudolf
 
Zuletzt bearbeitet von einem Moderator:
Besten Dank für die Tipps.
Das mit dem Leerzeichen war es nicht.
Ich habe aber dann die Konfiguration aus dem Link benutz und für meine Zwecke angepasst.
So wurde die Konfiguration nicht mehr angemeckert und konnte neu starten.

Nach dem Neustart kommt es noch dicker (Log):
Code:
Unable to prepare setup for platform pilight.switch: Unable to set up component.
                             19:08:15 –                              (FEHLER)                              setup.py
Logger: homeassistant.setup
           Source: setup.py:339                       
           first occurred:                  19:08:15                  (1 occurrences)
           Unable to prepare setup for platform pilight.switch: Unable to set up component.

                                                                                                                                                    
Error during setup of component pilight
                             19:08:15 –                              (FEHLER)                              components/pilight/__init__.py
Logger: homeassistant.setup
           Source: components/pilight/__init__.py:78                       
                             First occurred:                  19:08:15                  (1 occurrences)
                           Last logged:            19:08:15
Error during setup of component pilight Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/pilight/__init__.py", line 78, in setup
    pilight_client = pilight.Client(host=host, port=port)
  File "/usr/local/lib/python3.10/site-packages/pilight/pilight.py", line 93, in __init__
    answer_1 = json.loads(self.receive_socket.recv(1024).decode())
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Das heisst für mich, Pilight startet nicht auf dem Homeassistant.
Fehlt da noch was? Muss Pilight extra installiert werden.

HA soll doch nur Kommandos per http an den Pilight Raspi senden, was ausserhalb von HA funktioniert...
Die Eingabe in der URL-Zeile eines Browser im Netz von:
"http://192.168.1.149:5001/send?protocol=pollin&on=1&systemcode=16&unitcode=16"
schaltet meine Steckdosen an...
 
Zuletzt bearbeitet von einem Moderator:
Pilight und HomeAssistant gehen offenbar nicht zusammen...?
Ich habe es jetzt mit Cron-Jobs auf dem Raspberry gelöst, auf dem Pilight läuft.
Geht soweit, aber eigentlich wollte ich ja mit HomeAssistant von den Insel-Lösungen weg ...
Grüße
Rudolf
 

Zurzeit aktive Besucher

Keine Mitglieder online.

Letzte Anleitungen

Statistik des Forums

Themen
4.492
Beiträge
46.161
Mitglieder
4.120
Neuestes Mitglied
Energyfreak
Zurück
Oben