How to add Firmata binding?

Firmata is a great communication protocol to turn a cheap ($5) Arduino NANO clone into a useful tool for home automation with 1 minute work.
Start Arduino IDE > load StandardFirmata example > click upload > FINISH, and you have:

  • 12 port digital I/O,
  • an I2C bus,
  • 1-Wire bus,
  • Analog I/Os
  • connecting easily with a Plug&Play USB or an Ethernet port!

    I haven’t found ANY other protocol so popular and with so many client libraries.

My question is:

  • is it possible to install somehow the Firmata.js (Javascript) library directly to OpenHAB 2.5.2 as a Binding?
  • or the JAVA version?
    (I’m a Pascal+SQL programmer, so sadly I don’t know anything about JAVA.)

The short answer is no. You cannot “install [a] library directly to OpenHAB 2.5.2 as a Binding”

You could probably use the java library to help you write a binding but you will still need to write a significant amount of new code to get a working binding.

That’s what I was afraid of … :frowning:
Is there ANY other recommended library + Binding I can simply:

  • upload to an Arduino NANO board
  • and can use GPIOs + attached I2C extensions with OpenHAB?

An Arduino WiFi board.

Or you could use an ESP8266 development board and flash ESP Easy or Tasmota firmware and communicate with OH via mqtt.

Thank you very much for the tip!
But I do not want to use any Wireless device for home automation.
Only USB + maybe some wired Ethernet.

(Funny that theoretically there should be more possibilities for that, since wired things exists longer than cheap Wifi boards…)

  • Or do I misunderstand something, and your recommendation is to use those Wifi boards via USB?
  • How can an Arduino Wifi module be more compatible than a wired one?
  • What binging should be used for those?

I use several ESP8266 devices in my home and they have lasted for over 2 years. :crossed_fingers: If one goes bad I will just reflash a new one and be back up and running quick. Also, if your good with a soldering iron you can buy the esp chip and solder it to a dev board yourself. Doing it this way the cost is approx $3 US per device.

If you prefer wired it’s your setup but I find wireless easy and less clutter.

Use the mqtt binding but install mosquitto broker not the embedded one on OH as it’s no longer supported. Mosquitto can be installed using openhabian-config tool. If you do not have openhabian-config it can be added to any Linux based system. Here is a link for adding it:

The tool is very helpful and I recommend installing it regardless of what route/binding you decided on.

Another post in the forum you may find a good read.

Looking at this… page, the task isn’t impossible, only very complicated.
Basically: having an MQTT broker that is converting USB-Serial to MQTT.

1 Like

Nice link, I’ve bookmarked it. :+1: Complicated is relative to each person. :grin:

Looks to be the case.