Add wifi to an older roomba

It should be quite easy also to make a translator for playing arduino-like melodies

oh boy :confounded:

I have left this sensor in the config

      - name: "${friendly_name} distance"
        unit_of_measurement: "mm"
        icon: mdi:map-marker-distance
        accuracy_decimals: 0

let me test it :smiley:

I saw that you removed the / 1000.0 from the amper and volt measure
What is supposed to e the unit after this change? mA or A?

This way sensors expose raw data, mA, mAh, mV, in order to be enriched/filtered with something like


I’ve updated the relevant example at ESPHomeRoombaComponent/roomba.yaml at 874c74b7da662f183eef946dd9431ace963e5a6a · davidecavestro/ESPHomeRoombaComponent · GitHub

Please note the '“multiply: 0.001” in the example above, which translates from mX to X

Lovely, I’m sharing back the UI, if someone would like to re-use it

type: vertical-stack
cards:
  - type: vertical-stack
    title: roomba-control
    cards:
      - type: horizontal-stack
        cards:
          - show_name: true
            show_icon: true
            type: button
            tap_action:
              action: call-service
              service: esphome.roomba_control_command
              data:
                command: start
              target: {}
            icon: mdi:arrow-right-drop-circle
          - show_name: true
            show_icon: true
            type: button
            tap_action:
              action: call-service
              service: esphome.roomba_control_command
              data:
                command: stop
              target: {}
            icon: mdi:stop-circle
      - type: horizontal-stack
        cards:
          - show_name: true
            show_icon: true
            type: button
            tap_action:
              action: call-service
              service: esphome.roomba_control_command
              data:
                command: spot
              target: {}
            icon: mdi:sync
          - show_name: true
            show_icon: true
            type: button
            tap_action:
              action: call-service
              service: esphome.roomba_control_command
              data:
                command: dock
              target: {}
            icon: mdi:home-circle
      - type: horizontal-stack
        cards:
          - show_name: true
            show_icon: true
            type: button
            tap_action:
              action: call-service
              service: esphome.roomba_control_command
              data:
                command: locate
              target: {}
            icon: mdi:bell-circle
          - show_name: true
            show_icon: true
            type: button
            tap_action:
              action: call-service
              service: esphome.roomba_control_command
              data:
                command: sleep
              target: {}
            icon: mdi:pause-circle
  - type: grid
    title: roomba-drive
    cards:
      - show_name: false
        show_icon: false
        type: button
        tap_action:
          action: none
        icon: ''
        hold_action:
          action: none
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: go_faster
          target: {}
        icon: mdi:chevron-triple-up
        hold_action:
          action: none
      - show_name: false
        show_icon: false
        type: button
        tap_action:
          action: none
        icon: ''
        hold_action:
          action: none
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: go_left
          target: {}
        icon: mdi:chevron-triple-left
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: halt
          target: {}
        icon: mdi:car-brake-hold
        hold_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: drive
          target: {}
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: go_right
          target: {}
        icon: mdi:chevron-triple-right
      - show_name: false
        show_icon: false
        type: button
        tap_action:
          action: none
        hold_action:
          action: none
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: go_slower
          target: {}
        icon: mdi:chevron-triple-down
        hold_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: halt
          target: {}
      - show_name: false
        show_icon: true
        type: button
        tap_action:
          action: call-service
          service: esphome.roomba_control_command
          data:
            command: drive
          target: {}
        hold_action:
          action: none
        icon: mdi:steering

type: entities
entities:
  - entity: sensor.roomba_control_activity
    icon: mdi:robot-vacuum-variant
  - entity: sensor.roomba_control_battery
    icon: mdi:battery-outline
  - entity: sensor.roomba_control_charging_state
    icon: mdi:battery-charging-high
  - entity: sensor.roomba_control_capacity
    icon: mdi:battery
  - entity: sensor.roomba_control_charge
    icon: mdi:battery-charging
  - entity: sensor.roomba_control_current
    icon: mdi:lightning-bolt
  - entity: sensor.roomba_control_voltage
    icon: mdi:sine-wave
  - entity: sensor.roomba_control_temperature
    icon: mdi:thermometer
  - entity: sensor.roomba_control_oi_mode
    icon: mdi:steering
  - entity: sensor.roomba_control_drive_speed
title: Roomba-telemetry
1 Like

Hi,

I did some additional tests
Telemetry is working well
All the commands are working as expected, including the play song

@davidecavestro THANK YOU for this amazing work!!!

I have an additional question regarding the behavior: after the cleaning phase, the “DOCK” button starts to flash; but the activity remains “CLEANING”. Is there any way to intercept the “going to dock” status

regards

regards

I have an additional question regarding the behavior: after the cleaning phase, the “DOCK” button starts to flash; but the activity remains “CLEANING”. Is there any way to intercept the “going to dock” status.

From what I saw in the OI documentation that is not possible :frowning:.
I don’t know if the automatic dock action is timer based. Maybe we can figure that out.
If it is timer based, we could just change the state based on the timer, but I believe there is some more magic involved in the Roomba.

Yep, I have the feeling that time isn’t the only parameter, because if I move Roomba in another room or area, the research of the dock doesn’t start at the same time. I will do more tests here

I noted this behavior:
Cleaning → Cleaning (Dock button flashing) → Lost (Red Alert triangle on roomba) → Lost

From another point of view, I’m wondering if we can do something with automation or in code when we send command “DOCK” to arbitrary set the activity or another sensor to “Going to DOCK”
In this way we can understand what the roomba is doing after it receives a command, same for “SPOT”, we can manage another status that only “CLEANING” status

what do you think?

So far I had no time to check, so I write my thoughts anyway.
As @wburgers said specs rulez.
I’d check specs then try and see how data flows from device, eventually preparing a truth table

I haven’t had much time either to dive into the idea by @bremby.

I’ve mostly tried to figure out what is wrong with my Roomba and pretty much dove into a rabit hole.
So, last time, I figured that the OI port was damaged, probably due to a short circuit.
So naturally I ordered a new motherboard for my Roomba from AliExpress for about €23.
Because what else could be wrong? The OI port is probably a protected part of the motherboard and so that part is probably damaged.

Took a while to get the new motherboard to the Netherlands.
Last weekend I removed the old motherboard from the device and installed the new one only to find out that it had exactly the same behavior for the OI port.
So apparently it was not the motherboard that was broken :thinking:.
It has to be one of the sensors or something else.

A few years back, I ordered myself a new battery as the one that came with the Roomba was getting depleted very fast. I kept the old battery laying around just in case.
I inserted the old battery back into the Roomba after the new motherboard install and guess what…
The ESP could read from the OI port again. Inserting the newer battery again, made it spit out bogus.
So I damaged the battery?

Then I started digging more into the battery. There are no smarts in these older NiMH batteries.
It’s just battery cells and a thermistor. No pcb or anything.
With my multimeter I tested both the battery voltage and the thermistor resistance.
The voltage was around 16V after charging, which should be fine.
The thermistor should be between 8.5 and 15.5kΩ at room temperature according to the Roomba service manual.
The old battery gave a value of around 13.6kΩ, the newer battery around 9kΩ, just removed from the Roomba, which could impact the measurement a little.
It should be fine.

So I’m now considering buying another brand new battery.
Before I do so, I’ll hopefully try out a battery from a friend of mine, to see if that indeed solves my issues.

I am completely baffeled that the battery can cause the OI port to go haywire.
Especially since the measurements are okay.
So I’m still a bit lost on what to do next.
Buy a new battery or give up and buy a new robo vacuum.

Maybe the issue is related to the dynamic behaviour of the battery, i.e. under load the voltage is not stable as when you measured it., leading the romba logic (a FSM) to an inconsistent state?

Unfortunately, I think I’m gonna have to give up on this project :cry:.
For now I’ll keep my Roomba dumb and probably will buy a new one when I get frustrated with the dumb device.

Trying to get it working on my friend’s Roomba didn’t result in anything either.
So it’s not the battery, it’s not the motherboard. I tried my prototype on breadboard as well, to verify it is not my custom pcb, but no dice.
Maybe one of these combinations already fried my new motherboard :man_shrugging:.

If I really want to try again, I can try with an oscilloscope, which I don’t own now.
Eventually when I take this hobby of pcb design further, I’ll probably get one, but not right now to debug this. (I also need a hot air station and a solder hot plate :sweat_smile:).

Wish you guys all the best of luck to take this topic further.

What about this?

Never give up!

I just updated a 630, 615 and 652 with the UART component moving from MQTT from many, many years ago. My 560 will have to wait for me to print some new brush gears before it gets the same treatment. Many thanks to you @wburgers and @davidecavestro as well as @bremby for the nice controls.

My kids I love the drive control. I’m going to set up some obstacle courses for my kids to race each other through :smile:

2 Likes

Unfortunately that doesn’t work anymore either.
It was weird that it worked the first time and not after I tried the newer battery again.
Also it straight away didn’t work in the Roomba of my friend.
(Maybe I killed his Roomba 602’s OI port now :sweat_smile:, but he doesn’t use that anyway…)

So yeah, I am completely back to square one again on the debugging part and without a scope it’s going to be impossible probably.

I agree with @sreknob’s Never give up! mood
You could also try with any way you find to just send commands and see if the device someway reacts.

@sreknob have you tried using an FTDI on the port to see if the boot message shows up? I was with the same thought about my Roomba, but with the FTDI I figured out that the port was fine

Hello @davidecavestro and @bremby.
Thank you for your work on this so far but i’m confused.
I’m trying to get ESPHome to talk to my Roomba 780.
You two seem to have to most complete setups in this topic but all the bit i’ve put together do not work.

The schema on @davidecavestro’s GitHub repo contains no pin numbers, the schema used by @bremby in this topic has the PNP transistor pins mirrored from the official Roomba docks.

Can either of you provide me with the ESP code as well as the schema used so I have a working set together instead of pieced together parts the I don’t fully understand :smiley:

The pin numbers in the docs match the top view of the Roomba, as stated in the docs.
image

What may be confusing is that if you look at your Roomba from above, you probably have the dust collection bin towards you. This diagram has the front of the Roomba towards you.
The Base of the PNP is connected with pin 4 of the Roomba.
The collector is connected to ground and the emitter is connected to your ESP.
You can find my full schema here.

1 Like