Unfortunately I’m not that familiar with Python. How do I use the package homeassistant.remote on another Raspberry Pi that doesn’t have HASS installed? Looking at the home-assistant/homeassistant/remote.py code, it looks like a number of other HASS modules are used, so I guess I would need to git clone everything onto the eInk Pi?
If I did that, would I need to copy PaPiRus/bin/papirus-buttons.py into the home assistant folder to be able to refer to the necessary modules?
Hope that makes sense (I’m struggling to get my head around this so apologies if not).
My aim is to toggle switches and turn on/off lights from those buttons via HASS.
Thank you @robmarkcole, I can now trigger HA events using MQTT and Python! I’ve included my testing code below in case it helps others (seeing as this includes authentication details which the link Rob sent doesn’t have)
On my RPi with Papirus I can run the publish command with success: sudo mosquitto_pub -h 192.168.0.1 -u mqttuser -P my_pass -t "home-assistant/my/mood" -m "good"
I can also trigger the sensor via Python. The publish.single command works by itself, but if I comment that out and uncomment the client lines, that also works.
#!/usr/bin/python3
#
import time
import random
import paho.mqtt.client as mqtt
import paho.mqtt.publish as publish