How to connect a Shelly motion directly to an ESPHome driven shelly 1PM

Actual I’m using a shelly motion connected via MQTT to HA.
HA automation sends via ESPHome-API the state of shelly motion to an ESPHome driven
Shelly 1PM.
Now I want to find a way that shelly motion sends the state directly to ESPHome driven Shelly 1PM.
Any advice?
Thanks

The ESPHome Web Server API might do the trick.

According to the Shelly Motion User Guide the Actions menu can perform URL actions on the following:

• Motion detected
• Motion detected in dark
• Motion detected in twilight
• Motion detected in bright
• End of motion detected
• Tamper alarm detected
• End of tamper alarm

What I don’t know for sure if those actions are “GET” or “POST” operations and that matters.

Eg. Motion detected URL = http://$1PM_IP/switch/kitchen_lights/turn_on

Thanks for the tip.
Unfortunately it doesn’t work :frowning:
On linux: curl -v -X POST http://192.168.178.140/switch/ubs/turn_on works fine

In shelly’s action
http://192.168.178.140/switch/ubs/turn_on
does not.
So I think it’s not a POST operation

I was afraid of that. Unfortunate.

Can the Shelly Motion be flashed with ESPHome?

No!
They are using the latest controller for saving energy and connecting fast to WiFi.
And U can guess: it’s not an ESP :frowning:

New idea:
The ESPHome answers on
http://192.168.178.141/switch/motion/
with
{"id":"switch-motion","value":false,"state":"OFF"}
So it is detecting that message.

Can I get an event before or after ESPHome sends that answer message?
If so I can set that or an corresponding switch.