CANBus / Spline / Innoxel interface with HA

Hallo Tinu
Ich schaue aktuell auch gerade wie ich mein Innoxel in HomeAssistant einbinden kann. Hast du mir allenfalls ein paar Tipps für den Start? Funktioniert der Controller (Industrial ESP32 IoT Programmable Controller | RS485, CAN, Ethernet - DFRobot) wie gewünscht und spielt es eine Rolle welchen Innoxel Master im Einsatz ist? Ich habe noch den Master 2. Danke für deine Rückmeldung.

Hi mmeister-119,
Did you read this article ? Use case: Freeing a fully locked home-automation system | Domedia
There are few useful informations to begin inoxel control.
We can help if need.
The DFRobot is a very robust gateway, it have been tested.

Hallo mmeister-119. Ja der DFRobot Edge 101 funktioniert wie gewünscht und liess sich gut mit ESPHome in HA integrieren. Es hat etwas gedauert bis ich rausgefunden habe wie die LAN-Schnittstelle aktiviert wird, da dies nirgends richtig dokumentiert war. WLAN ging von Anfang an.

ethernet:
  type: IP101
  mdc_pin: GPIO4
  mdio_pin: GPIO13
  clk:
    pin: GPIO0
    mode: CLK_EXT_IN
  phy_addr: 1
  power_pin: GPIO2

Ich habe den Noxmaster-1024 (ist das der Noxmaster 2 oder noch eine Generation früher, bin nicht sicher). Aber theoretisch sollte das keine Rolle spielen, weil man ja die Module direkt anspricht, d.h. so wie ich verstanden habe, könnte man den Controller dann sogar entfernen, wenn man alles über HA umsetzen will inkl. der Reaktion auf Tastendrücke von physischen Elektronik-Tastern usw.)

Was bei mir gemäss der Beschreibung von domedia.net nicht funktioniert hat, war eben diese Ansteuerung eines NoxSwitch “Control of ON/OFF circuits” über ASCII-Kommandos (zB. S6 / C6). Das konnte ich wie oben bereits beschrieben mit einem solchen Kommando lösen, was einem Tastendruck entspricht:

Beispiel:

  - id: o12_k7_toggle   # Lampe klein vorne
    then:
      - canbus.send: { can_id: 0x53C, data: [0x00, 0x0B] }
      - delay: 5ms
      - canbus.send: { can_id: 0x53C, data: [0x00, 0x0F] }

Ich habe eine Wetterstation in meinem Innoxel-System und auch einen RTI-Controller XP6s über einen Seriell-CAN-Gateway von Innoxel. Das verursacht sehr viel Traffic auf dem Bus, ein Sniffen aller Ereignisse war daher so nicht möglich, damit ist der Edge101 offenbar überlastet. Ich hatte auch keine Lust alles zu entfernen. Darum habe ich mir zuerst damit ausgeholfen direkt mit der ArduinoIDE ein paar spezifische Sketchs auf den Edge101 zu laden um damit zuerst alle Busadressen zu ermitteln und dann mit einem Sketch zB. auf einer Bus-Adresse eines NoxSwitch zu sniffen und alles was drumherum zb. +/- 100ms nach einer Auslösung eines Ausgangs passiert aufzuzeichnen. Damit konnte ich dann eine Tabelle erstellen, welche Kommandos ich wohin schicken muss.

Das hier wäre zb. dieser NoxSwitch 0x21D, welcher bei mir als 014 bezeichnet ist:

Relais-Modul Innoxel Kanal CAN Status 1 CAN Schalten 1 Delay 2
O14 0 0x21D b0 = 0x03, b1 & 0x01 0x550 00 0E 5ms 00 0F
O14 1 0x21D b0 = 0x03, b1 & 0x02 0x552 00 0E 5ms 00 0F
O14 2 0x21D b0 = 0x03, b1 & 0x04 0x552 00 0D 5ms 00 0F
O14 3 0x21D b0 = 0x03, b1 & 0x08 0x552 00 0B 5ms 00 0F
O14 4 0x21D b0 = 0x03, b1 & 0x10 0x552 00 07 5ms 00 0F
O14 5 0x21D b0 = 0x03, b1 & 0x20 0x554 00 07 5ms 00 0F
O14 6 0x21D b0 = 0x03, b1 & 0x40 0x554 00 0E 5ms 00 0F
O14 7 0x21D b0 = 0x03, b1 & 0x80 0x53E 00 0E 5ms 00 0F

Den Status erhalte ich dann so:

      # Status-Frames O14 (0x21D)
      - can_id: 0x21D
        can_id_mask: 0x7FF
        then:
          - lambda: |-
              if (x.size() < 2) return;
              const uint8_t b0 = x[0];
              const uint8_t b1 = x[1];
              if (b0 != 0x03) return;
              id(o14_k0).publish_state(b1 & 0x01);
              id(o14_k1).publish_state(b1 & 0x02);
              id(o14_k2).publish_state(b1 & 0x04);
              id(o14_k3).publish_state(b1 & 0x08);
              id(o14_k4).publish_state(b1 & 0x10);
              id(o14_k5).publish_state(b1 & 0x20);
              id(o14_k6).publish_state(b1 & 0x40);
              id(o14_k7).publish_state(b1 & 0x80);

Die Dimmer wiederum konnte ich mit ASCII-Kommandos ansteuern wie im Artikel beschrieben.
Bei den Storen (NoxMotor) sende ich ebenfalls die HEX-Commands wie bei den NoxSwitchs, da wiederum brauchte ich noch eine lambda Funktion um den Stop richtig verwenden zu können.

Das alles funktioniert. Die Rückmeldung soweit auch, nur bei den Dimmern habe ich das noch nicht.

Also ich bin bestimmt auch noch nicht fertig, ich verwende es auch noch nicht “produktiv”. Ich möchte zB. auch die Schaltuhr setzen können. Von Wetterstation-Daten gar nicht zu reden. (Die habe ich aktuell über den RTI XP6s-Controller - MQTTDriver in HA. Vermutlich ist das alles von mir auch zu kompliziert gelöst, leider habe ich wirklich noch nicht herausgefunden wie es so wie im Artikel beschrieben funktionieren soll.
Es wäre interessant zu wissen ob und wie es bei dir funktioniert, wenn du auch ein reines Innoxel-System hast. Ich kann dir gerne mein YAML für den Edge zur Verfügung stellen wenn es dir etwas hilft.
Ich wäre auch sehr interessiert daran von dir zu erfahren, wie du es gelöst hast und ob du bei dir so wie im Artikel beschrieben einen Ausgang schalten kannst.

Die Experten sind hier sicher Clément und Vincèn, wenn man es professionell machen will ist man bei Ihnen am besten bedient denke ich. Für mich reicht es im Moment so.

Hi Clément, yes I have read the article, but I must admit that I haven’t quite understood everything yet, as I am just getting started and have no experience with ESPHome so far. I am also still very new to HA. However, I set up the Innoxel myself without any problems and have expanded it several times since then.
I am currently struggling to find the Edge101 via the Ethernet interface in my network. I use HA on my NAS as a Docker container.

Furthermore, I don’t quite understand how the mapping of the CAN bus addressing works or how it can be derived. For example, I have 5 switch actuators with the addresses 0 (0.0 - 0.7), 1 (1.0-1.7), etc. Shouldn’t it be possible to derive a general mapping, or am I wrong?
Best regards Marcel

Hallo Tinu, Danke für die Ausführliche Rückmeldung. Wie im anderen Post erwähnt, ich stehe noch ganz am Anfang werde aber gerne meine Ergebinsse teilen sobald ich welche habe :wink: Deine YAML wäre natürlich sicher hilfreich und ich bin dankbarer Empfänger.

Marcel

@mmeister-119,
Here is the base config for Edge 101. You could start with it easily.

esphome:
  name: can-gateway-1
  friendly_name: "CAN Gateway 1"
  area: "Technical Room"
  
esp32:
  board: esp32dev
  framework:
    type: esp-idf

logger:

api:
  reboot_timeout: 120min

ota:
  - platform: esphome

ethernet:
  type: IP101
  mdc_pin: GPIO4
  mdio_pin: GPIO13
  clk:
    pin: GPIO0
    mode: CLK_EXT_IN
  power_pin: GPIO2
  phy_addr: 1

web_server:

uart:
  tx_pin: GPIO17
  rx_pin: GPIO36
  baud_rate: 9600

sensor:
  - platform: uptime
    name: Uptime
    filters:
      - lambda: return x / 60.0 /60.0 /24;
    unit_of_measurement: d

canbus:
    - platform: esp32_can
      tx_pin: GPIO32
      rx_pin: GPIO33
      can_id: 4
      bit_rate: 100kbps
      use_extended_id: false

The best way to find your can bus adress is to decode it adding this in canbus section :


      on_frame:   
      - can_id: 0x000
        can_id_mask: 0x000
        then:
        - lambda: |-
            std::string b(x.begin(), x.end());
            ESP_LOGD("can id 0x000 ", "%s", &b[0] );

You will see the canbus message in the logs. You will be able to see your can bus adress when you trigger something.

In other way, you can try the list i will send you with the maching inoxel number-> can adresses. I’m not sure, it will works in your system.
Do you have the config file of your inoxel system ?
Sometime it can help finding the adresses.

I have now tried another NoxSwitch-0806 module, which was retrofitted. This accepts the S and C commands and switches the output. However, there is no status feedback or update, e.g., on my RTI app or the touch panel. For me, this means that I will stick with my version, as it also provides me with the corresponding feedback. Of course, this means that my version only works with an RTI master.

Bei mir sind es diese Adressen:

O0 0x201
O1 0x203
O2 0x205
O3 0x207
O4 0x209
O5 0x20B
O6 0x20D
O7 0x20F
O8 0x211
O9 0x213
O10 0x215
O11 0x217
O12 0x219
O13 0x21B
O14 0x21D
O15 0x21F
D0 0x60C
D1 0x60E

Hallo zusammen danke für die Rückmeldungen und Tipps. Ich werde das sobald ich Zeit finde testen. @Tinu1 wie können wir die YAML austauschen? Sehe hier gerade keine Möglichkeit um DM auszutauschen.