1. Go to the email where it is requested to complete the configuration process, click on the link
CA Issuers - URI:http://secure.globalsign.
openssl verify -untrusted fullchain.crt server.crt
1. Go to the email where it is requested to complete the configuration process, click on the link
root@server:/volume1/docker/
root@server:/usr/syno/etc/
total 20
drwx------ 2 root root 4096 Mar 18 16:12 dCjJGL
-rwx------ 1 root root 1904 May 11 09:38 SERVICES
drwx------ 2 root root 4096 May 18 10:20 uE4Pkn
-rw------- 1 root root 7 May 18 10:21 DEFAULT
-rw------- 1 root root 2552 May 18 10:28 INFO
root@server:/usr/syno/etc/
root@server:/usr/syno/etc/
total 52
-r-------- 1 root root 1890 Mar 18 16:12 cert.pem
-r-------- 1 root root 1801 Mar 18 16:12 chain.pem
-r-------- 1 root root 1390 Mar 18 16:12 ECC-cert.pem
-r-------- 1 root root 1566 Mar 18 16:12 ECC-chain.pem
-r-------- 1 root root 2958 Mar 18 16:12 ECC-fullchain.pem
-r-------- 1 root root 241 Mar 18 16:12 ECC-privkey.pem
-r-------- 1 root root 3693 Mar 18 16:12 fullchain.pem
-r-------- 1 root root 1704 Mar 18 16:12 privkey.pem
-r-------- 1 root root 262 Mar 18 16:12 renew.json
-r-------- 1 root root 1890 Mar 18 16:12 RSA-cert.pem
-r-------- 1 root root 1801 Mar 18 16:12 RSA-chain.pem
-r-------- 1 root root 3693 Mar 18 16:12 RSA-fullchain.pem
-r-------- 1 root root 1704 Mar 18 16:12 RSA-privkey.pem
root@server:/usr/syno/etc/
DNS:*.domain.com, DNS:domain.com
root@server:/usr/syno/etc/
> -in cert.pem \
> -inkey privkey.pem \
> -certfile chain.pem \
> -out unifi.p12 \
> -name unifi \
> ls -lrt^C
root@server:/usr/syno/etc/
total 60
-r-------- 1 root root 1890 Mar 18 16:12 cert.pem
-r-------- 1 root root 1801 Mar 18 16:12 chain.pem
-r-------- 1 root root 1390 Mar 18 16:12 ECC-cert.pem
-r-------- 1 root root 1566 Mar 18 16:12 ECC-chain.pem
-r-------- 1 root root 2958 Mar 18 16:12 ECC-fullchain.pem
-r-------- 1 root root 241 Mar 18 16:12 ECC-privkey.pem
-r-------- 1 root root 3693 Mar 18 16:12 fullchain.pem
-r-------- 1 root root 1704 Mar 18 16:12 privkey.pem
-r-------- 1 root root 262 Mar 18 16:12 renew.json
-r-------- 1 root root 1890 Mar 18 16:12 RSA-cert.pem
-r-------- 1 root root 1801 Mar 18 16:12 RSA-chain.pem
-r-------- 1 root root 3693 Mar 18 16:12 RSA-fullchain.pem
-r-------- 1 root root 1704 Mar 18 16:12 RSA-privkey.pem
-rw------- 1 root root 4344 May 18 22:01 unifi.p12
root@server:/usr/syno/etc/
root@server:/volume1/docker/
total 228
drwxr-xr-x+ 3 admin users 4096 Mar 6 15:53 backup
drwxr-xr-x+ 4 admin users 40960 May 18 22:01 db
-rwxr-xr-x+ 1 root root 35879 May 18 09:41 firmware.json
-rwxr-xr-x+ 1 admin users 6502 May 11 09:39 keystore
-rwxr-xr-x+ 1 admin users 2742 Aug 28 2023 keystore-2023-08-28.bak
-rwxr-xr-x+ 1 root root 6502 May 18 21:57 keystore-2026-05-18.bak
-rwxr-xr-x+ 1 admin users 1424 May 18 21:40 model_lifecycles.json
-rwxr-xr-x+ 1 admin users 0 Oct 17 2023 system_env
-rwxr-xr-x+ 1 root root 1394 May 11 09:40 system.properties
-rwxr-xr-x+ 1 root root 1394 May 11 09:40 system.properties.bk
-rwxr-xr-x+ 1 root root 110245 May 15 17:41 uidb.json
-rw------- 1 root root 4344 May 18 22:01 unifi.p12
root@server:/volume1/docker/
> -srckeystore /unifi/data/unifi.p12 \
> -srcstoretype PKCS12 \
> -srcstorepass aircontrolenterprise \
> -destkeystore /unifi/data/keystore \
> -deststoretype JKS \
> -deststorepass aircontrolenterprise \
> -alias unifi
Importing keystore /unifi/data/unifi.p12 to /unifi/data/keystore...
Existing entry alias unifi exists, overwrite? [no]: yes
root@server:/volume1/docker/
root@server:/usr/syno/etc/
> -inkey privkey.pem \
> -in cert.pem \
> -certfile chain.pem \
> -certpbe AES-256-CBC \
> -keypbe AES-256-CBC \
> -macalg SHA256
Enter Export Password:
Verifying - Enter Export Password:
In order to safely update your docker container in a Synology NAS. I assume you manage your docker containers via docker-compose
docker ps
cd /volume1/docker
cp -rp ha /volume2/backups/ha-bak.25.x
docker stop homeassistant
docker commit homeassistant homeassistant-backup:version-25.x
docker pull ghcr.io/home-assistant/home-assistant:stable
docker pull ghcr.io/home-assistant/home-assistant:2024.11.3
docker rm homeassistant
vi docker-compose.yaml
docker-compose --verbose up -d homeassistant
Checklist afterwards:
docker exec homeassistant python -m homeassistant --script check_config --config /config
docker stop homeassistant
docker rm homeassistant
docker run -d --name homeassistant \ --restart=unless-stopped \ -v /volume1/docker/ha:/config \ -e TZ=Europe/Paris \ --net=host \ homeassistant-backup:version-24.11
If you want to add a button to your dashboard that will trigger an automation once clicked, but you don't like the fact that by default the state will be always on, you can add an additional input_boolean. Below are the steps how to do this.
To define an input_boolean in Home Assistant, you can add it to your configuration.yaml file. Here’s how to do it:
Open your configuration.yaml file in Home Assistant.
Add the Input Boolean definition under the input_boolean section. If the section doesn’t exist yet, you can create it.
yamlinput_boolean:
rain_water_pump_button:
name: Rain Water Pump Button
initial: off
rain_water_pump_button: This is the entity ID for your input boolean.name: This is the name that will appear in the UI.initial: Setting this to off means the button will be off each time Home Assistant restarts.Save the Configuration and Restart Home Assistant:
Create a Combined Automation: This automation will:
rain_water_pump_button “on” for 2 seconds to confirm the button press.switch.rain_water_pump for 3 minutes, then turn it off.yamlalias: Enable Rain Water Pump for 3 Minutes
trigger:
- platform: state
entity_id: input_boolean.rain_water_pump_button
to: 'on'
action:
- delay: "00:00:02" # Keep button "on" for 2 seconds
- service: input_boolean.turn_off
target:
entity_id: input_boolean.rain_water_pump_button
- service: switch.turn_on
target:
entity_id: switch.rain_water_pump
- delay: "00:03:00" # 3 minutes delay for the pump
- service: switch.turn_off
target:
entity_id: switch.rain_water_pump
mode: single
Update the Dashboard Button:
Here’s the updated configuration for the dashboard button to trigger the input_boolean instead of the automation directly. This way, pressing the button will activate the whole process:
yamltype: entity-button
entity: input_boolean.rain_water_pump_button
icon: mdi:av-timer
show_name: true
show_icon: true
show_state: true
icon_height: 25px
tap_action:
action: toggle
With this setup:
input_boolean state change triggers the switch.rain_water_pump to turn on for 3 minutes and then turn off automatically.I created a python script that runs as a service to read out the Fluvius energy meter via the P1 port to USB on a Raspberry Pi. See installation notes here: https://github.com/smartathome/fluvius2mqtt/tree/main
The output into Home Assistant looks like this:
I want to read out a SMA Sunny Boy data and make it available via MQTT to Home Assistant. Installation of SBFSpot on a Rasberry Pi is really easy. The tool to be used for this is SBFSpot. The SMA procotol used is proprietary and happens over 502/tcp.
curl -s https://raw.githubusercontent.com/sbfspot/sbfspot-config/master/sbfspot-config | sudo bash
sudo vi cd /usr/local/bin/sbfspot.3/SBFspot.cfgto change the MQTT configuration and set the following MQTT_Data:
MQTT_Data=Timestamp,SunRise,SunSet,InvSerial,InvName,InvSwVer,InvTime,InvStatus,InvTemperature,InvGridRelay,EToday,ETotal,PACTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,GridFreq
/usr/local/bin/sbfspot.3/SBFspot -v -finq -nocsv -mqtt
sudo raspi-config
ssh-keygen -o -a 100 -t ed25519
sudo passwd root
sudo vi /etc/network/interfacesAdd at the end of the file the following:
# Added by user on 2023-XX-XX
auto eth0
iface eth0 inet static
address 192.168.0.240/24
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
dns-nameservers 192.168.0.1 8.8.8.8
# End of Additionsudo systemctl restart networking.serviceAnd test with
ip add showReboot your RPi again (or do it later if you plan to reboot anyway)
sudo -i apt-get update -y && apt-get upgrade -y
sudo sed -i '/# The named pipe \/dev\/xconsole/,$d' /etc/rsyslog.conf sudo service rsyslog restart
sudo apt-get install -y syslog-ng
sudo apt-get install -y git dirmngr
cd /home/pi git clone https://github.com/azlux/log2ram.git cd log2ram chmod +x install.sh sudo ./install.sh Change the log size value to 128M sudo vi /etc/log2ram.confReboot
sudo apt-get install -y sendmail mailutils sendmail-bin sudo mkdir -m 700 /etc/mail/authinfo/ sudo cd /etc/mail/authinfo/Create a Sendmail authentication file:
sudo vi sendmail-authAnd paste the following info:
AuthInfo: "U:root" "I:YOUR LOGIN" "P:YOUR PASSWORD"Save and exit vi. Next do the makemap:
sudo makemap hash sendmail-auth < sendmail-auth sudo chmod 400 sendmail-authChange the Sendmail configuration now
sudo vi /etc/mail/sendmail.mc Add the following below right above first "MAILER_DEFINITIONS" line: # Added by yourname on 2018-XX-XX define(`SMART_HOST',`[192.168.Y.XX]')dnl define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl define(`confAUTH_OPTIONS', `A p')dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash -o /etc/mail/authinfo/sendmail-auth.db')dnl # End of AdditionApply the changes to the configuration and restart Sendmail:
sudo make -C /etc/mail sudo /etc/init.d/sendmail reloadTest if you can send an email to yourself:
echo "Just testing my Sendmail email relay" | mail -s "Sendmail email relay" you@here.com
sudo apt-get install -y ntp ntpdate sudo vi /etc/ntp.confAnd replace the XX with your country code
0.XX.pool.ntp.org sudo /etc/init.d/ntp stopAnd query to see NTP being in sync
sudo ntpd -gq sudo /etc/init.d/ntp start sudo ntpd -pn
sudo apt-get install snmp snmpd sudo vi /etc/snmp/snmpd.confAnd put the following configuration lines
agentAddress udp:161 rocommunity public 192.168.X.0/24Restart your SNMP daemon
sudo /etc/init.d/snmpd restartAnd test on your local machine
snmpwalk -Os -c public -v 1 localhost
su - cat >/etc/systemd/system/nfs-common.service <<\EOF [Unit] Description=NFS Common daemons Wants=remote-fs-pre.target DefaultDependencies=no [Service] Type=oneshot RemainAfterExit=yes ExecStart=/etc/init.d/nfs-common start ExecStop=/etc/init.d/nfs-common stop [Install] WantedBy=sysinit.target EOF
cat >/etc/systemd/system/rpcbind.service <<\EOF [Unit] Description=RPC bind portmap service After=systemd-tmpfiles-setup.service Wants=remote-fs-pre.target Before=remote-fs-pre.target DefaultDependencies=no [Service] ExecStart=/sbin/rpcbind -f -w KillMode=process Restart=on-failure [Install] WantedBy=sysinit.target Alias=portmap EOF
cat >/etc/tmpfiles.d/rpcbind.conf <<\EOF #Type Path Mode UID GID Age Argument d /run/rpcbind 0755 root root - - f /run/rpcbind/rpcbind.xdr 0600 root root - - f /run/rpcbind/portmap.xdr 0600 root root - - EOF systemctl enable rpcbind.service systemctl enable nfs-commonInstall raspiBackup (from this website)
sudo mkdir -p /backupAvoid accidental file storage, when folder is not mounted
sudo chattr +i /backup sudo vi /etc/fstabAnd add
server.yourdomain.com:/volume1/backups/host.yourdomain.com/backup nfs rsize=8912,wsize=8912,timeo=14 0 0 sudo mount /backupNow install the raspiBackup tool
curl -s https://raw.githubusercontent.com/framps/raspiBackup/master/installation/install.sh | sudo bash
Go through the configuration tool, later on you can go back to it via: raspiBackupInstallUI.sh-Backup versions: smart strategy-Backup to tar-No compression-Backup mode standard-Email notification set
Uncomment the crontab (backup will run every Sunday at 5am):sudo vi /etc/cron.d/raspiBackupAnd finally testsudo raspiBackup
Generate an SSH keypair for easy loginssh-keygen ssh-copy-id -p 22 admin@server.yourdomain.comLog into your server, make yourself root and copy the public key into the raspberry
cat /root/.ssh/id_rsa.pub | ssh user@hhost.yourdomain.com "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"Test if it's working by using:
ssh user@host.yourdomain.com
Setup unattended upgrade based on this tutorialsudo apt update sudo apt install unattended-upgradesConfigure unattended upgrades and uncomment:
sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
"origin=Debian,codename=${distro_codename}-updates";
"origin=Debian,codename=${distro_codename}-proposed-updates";
"origin=Debian,codename=${distro_codename},label=Debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security"; And uncomment:Unattended-Upgrade::Remove-Unused-Dependencies "false";Now enable Automatic Updates (and press Yes)
sudo dpkg-reconfigure --priority=low unattended-upgrades
To view the unattended upgrades:sudo systemctl status unattended-upgrades.service-