Yay! I got something to work!
I replaced MotionEyeOS with Ubuntu Mate 16.04 and MotionEye (plus mosquitto). I set up my camera to look at the door of my studio.
This is the command I’m using in MotionEye under the “Motion Notifications” tab:
mosquitto_pub -h 192.168.1.xxx -u <username> -P <password> -t cameras/StudioCam/motion -m "ON"
This is what goes in my configuration.yaml:
mqtt:
broker: 192.168.1.xxx
port: 1883
username: <username>
password: <password>
binary_sensor:
- platform: mqtt
name: "Studio Motion"
state_topic: "cameras/StudioCam/motion"
device_class: motion
I did sort of get the Curl command to work as well. The important lesson for me was that you don’t have to add anything to configuration.yaml when using HTTP components.
This is the Curl command I entered in MotionEye under the “Motion Notifications” tab:
curl -X POST -H "Content-Type: application/json" -d '{"state": "on", "attributes": {"friendly_name: "studiomotion"}}' http://192.168.1.xxx:8123/api/states/binary_sensor.studiomotion
The problem with both of these approaches (MQTT and Curl), as @robconnolly said, is that the sensors just stay at “ON” forever after motion is detected. So I either have to figure out how to use that Python script that @DrJeff linked to, or find some other solution if there is one.