MQTT binary sensor not working

I have this response in the mqtt topic:
{"state":"charging","docked":true,"battery_level":58,"battery_voltage":14.96,"cleaning":false,"charging":true,"uptime":660022}

My configuration is this:

binary_sensor:
- platform: mqtt
  name: ILIFE docked
  state_topic: "ILIFERobot/state"
  value_template: '{{ value_json.docked }}'
  device_class: occupancy

For some reason, it is not working. What is wrong? The vacuum mqtt component does say it’s docked…

1 Like

The value of the “docked” item is true, which HA probably isn’t matching to “ON” or “OFF”, which are the default values expected for the payload. Try adding

  payload_on: true
  payload_off: false

There is a complication in that the value in the json is actually representing a json boolean, rather than a string, but I think that will work provided you don’t put quotes around true and false.

2 Likes

Hello. What kind of iLIfe robot do You have? I have iLife A4, and looking how to convert it to smart vacuum robot. Does your iLIfe have wifi capabilities? It would be great if you could share the project?

1 Like

I have a ilife V5s which I have modded myself by building in a nodemcu module to give it wifi capabilities. I basically read out the led signals on top for the status, hijack the IR inputs to emulate the remote and give it signals, read out the battery voltage using a voltage divider and detect a voltage on the docking input to check whether it is docked.

I can share the project if interested, but it is not really polished.

I was hoping to find some serial input or other debug port, but I could not find it. If someone knows is these robots have this, I would like to know to improve it!

Considering the amount of time it took, it is better to juist buy one with WiFi capabilities built in.

I’m very much interested, please do share

I have uploaded the project here: https://github.com/ksya/ILIFERobot

I do have this model

ILIFE V5 Pro Smart Robotic Vacuum Cleaner

I did do other ESP projects, although I am not a “hardware guy”, how much time you think is needed to do this one? Is it very difficult (soldering involved, dismount totally the vacuum), or just “normal” difficulties?

Trying to understand if I am able enough to do this project or not :smiley:

mmhhh yes this was exactly my worries/thinking

Yes, you need to solder some wires from the ESP module to certain parts of the robot. Still, it’s doable within a few hours depending on your expertise.

is the “certain parts” that worries me lol, have no clue which. Will wait if someone can help, or as you said, probably just get a wifi model

Hello, any chance to get more info about your work?

What do you want to know? Have you seen this? https://github.com/ksya/ILIFERobot