TawfikDaim / home_automation

home automation user stories
0 stars 0 forks source link

Moving the setup from one server to another server #92

Open TawfikDaim opened 1 month ago

TawfikDaim commented 1 month ago

This is a complex process but is repeatable and hence documenting the steps I did today,

Before I started I have 2 different servers: 1) 10.195.1.51 is an ubuntu bare metal server that has docker installed on it with containers for:

2) 192.168.1.14, is a QNAP hardware without any containers

Steps:

  1. install container station on QNAP server
  2. copy all directory structure from
  3. make sure to fix the environment links to the directory
  4. make sure you know the port for Zigbee coordinator to update this is config files (details in comment below)
  5. make sure to change IP address wherever is applicable (e.g. MQTT Ip address in configuration.yaml in z2mqtt config folder)
  6. revie and edit as appropriate the docker-compose.yaml and the confirguration files for each container
  7. set the Last Seen timestamp type to ISO_8601 in the Settings -> Advanced area of Zigbee2MQTT.
  8. keep Zigbee channel as 25 (hopefully this is less conflicting with WiFi channels)
TawfikDaim commented 1 month ago

create file: find_usb.sh

for sysdevpath in $(find /sys/bus/usb/devices/usb/ -name dev); do ( syspath="${sysdevpath%/dev}" devname="$(udevadm info -q name -p $syspath)" [[ "$devname" == "bus/" ]] && exit eval "$(udevadm info -q property --export -p $syspath)" [[ -z "$ID_SERIAL" ]] && exit echo "/dev/$devname - $ID_SERIAL" ) done

sudo chmod +x find_usb.sh

run the file by typing: ./find_usb.sh

results: /dev/ttyUSB0 - Silicon_Labs_Sonoff_Zigbee_3.0_USB_Dongle_Plus_0001 /dev/sdb1 - Generic_Flash_Disk_0745592A-0:0 /dev/ttyACM0 - ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20230221134927 /dev/sda2 - AI_Mass_Storage-0:0