Daily Automated Testing for Milk-V Duo S RISC-V SBC (IKEA Tretakt, Apache NuttX)
lupyuen.codeberg.page
lupyuen.codeberg.page
But it's using ZigBee; you just need a USB/ZigBee bridge to run it locally.
But even the suggestion to bypass Google Assistant still look so unnecessarily complex, especially if you didn't already happen to have a Home Assistant and a Zigbee adapter at hand.
This Milk-V duo seems to have a reset button (sadly not exposed on the GPIO pins, but that's not the end of the world). Find how it works (drive a certain line high or low, just see if one side is permanently 0V or 3.3V), wire it to your USB-UART adapter's DTR or CTS one, and toggle it when you need a reboot.
Done.
It does require soldering 1 wire, and not every USB-UART adapter has a DTR or CTS line (but a majority do), but it's so beautifully simple compared to this.
(Speaking as someone who _does_ have a suitable homeassistant (with zigbee2mqtt and slae.sh's excellent CC2652 stick, deserves a plug on HN: https://slae.sh/projects/cc2652/ ))
An alternative solution that’s less roundabout could be to use a uhubctl (https://github.com/mvp/uhubctl) compatible USB hub and directly switch the power of the usb port.
$ python3
Python 3.12.4 (main, Jun 6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywemo
>>> d = pywemo.discover_devices()
>>> d
[<WeMo Switch "Guest">, <WeMo Switch "Fireplace">, <WeMo Switch "Bedroom Dresser">]
>>> d[0].model
'Belkin Plugin Socket 1.0'
>>> d[0].toggle()
>>>