Montioneye motion notifications to mqtt

Anyone has an idea how to solve this?

I have this as config in configuration.yaml

binary_sensor:
  - platform: mqtt
    name: "Motion"
    state_topic: "home/motiondetection/camera"
    payload_on: "ON"
    payload_off: "OFF"
    device_class: "motion"

I have this in motioneye under Run A Command:

mosquitto_pub -h 192.168.1.201 -u *user* -P *password* -t home/motiondetection/camera -m '{"state":"ON"}

But the binary sensor never changes status. Should the mqtt ip be the same as the HA IP or does it have an internal ip?
What could be wrong?

That IP would be the address of your MQTT broker, and you’ll need to add the -p (port) parameter, 1883 is typical.

In addition, in your binary sensor config, you’re telling it to respond to “ON” for on, but your command is sending “'{“state”:“ON”}”.

Here’s my command in MotionEye:
mosquitto_pub -h 192.168.1.200 -p 1883 -u user -P password -t motion/patio -m "ON"

HTH,

You are my hero, i added the port and change the -m “ON”. I installed mqtt as add on on the HA. so this should be the same IP. Thanks i’m learning.

@terryhonn, 1 more question. How would you define the trigger for the app notification? The phone notification part is working i only need the right input for the trigger.

SOLVED, i got it working by adding encoding utf-8