The documentation/wiki are a little short on providing info how to run SaT as a background service without logging in.
I did the following, but this is probably not ideal. I don't know whether the system dbus could be used as well and this custom dbus-session service is necessary at all.
Anyhow, here goes:
cat > /etc/systemd/system/dbus-session.service << EOF
Description=D-Bus session bus for SaT
ExecStart=dbus-daemon --session --address=unix:abstract=sat-dbus
cat > /etc/systemd/system/saluteatoi.service << EOF
Description=Salute a toi backend
Finally set up a wrapper around jp to sudo to user sat and use the session bus. I could not make this work with adapting dbus session bus policies alone - it seems they don't have anything preventing anyone from using session buses anyway, but I always got errors without sudo:
Failed to open connection to session bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Therefore, I use this:
cat > /usr/local/bin/send_xmpp_omemo << 'EOF'
echo $@ | nice -n19 sudo -u sat DBUS_SESSION_BUS_ADDRESS=unix:abstract=sat-dbus /usr/bin/jp message send -c -e OMEMO $rcpt
(sudoers has to be setup to allow the calling user to sudo as sat)
(group messages with OMEMO are not supported yet (0.7.0), but that would be more elegant instead of sending to just one receiver)
This can be easily integrated into domoticz for example by using
script:///usr/local/bin/send_xmpp_omemo #TO #MESSAGE
and your jid as #TO as "Custom HTTP/Action".
I think it would be best to provide a working .service file with the distribution and probably use the system bus if that is possible. I am not very knowledgeable about D-Bus however, I only thought other services also use the system bus, and their setup seems a lot easier.
I hope the provided info is complete!