import RPi.GPIO as GPIO
import logging
from datetime import datetime
from time import sleep
from requests import get

GPIO.setmode(GPIO.BCM) # GPIO Numbers instead of board numbers
GPIO.setwarnings(False)

RELAIS_1_GPIO = 22

GPIO.setup(RELAIS_1_GPIO, GPIO.OUT) # GPIO Assign mode
GPIO.output(RELAIS_1_GPIO, GPIO.LOW) # out

ip = get('https://api.ipify.org').content.decode('utf8')
ipaddress= '{}'.format(ip)

current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
with open('vv.log', 'a') as file:
    file.write(current_time + ' ' + ipaddress + ' 22on.py\n')