Hi, i have 2 python command line sensors, but i somtimes have issues, that they cross each other, when pyhton is running, the other one cant runt, because it creates a TCP connection, only connection allowed
so basicly i only want python script, that receives it back in to 1 or 2 sensors
this is config now, you see i excecute 2 different pythons, the 2 pythons scrips are actual the same, its just the hex value thats different, so the result of the 2 “messages” i want to have it from 1 python script
doesnt mather if the end resuls is in 1 of 2 sensors, just want to fire only 1 python script
i also tried playing with the scan intervals, so that dont interfear with other, but doesnt help either
sensor:
- platform: command_line
command: python3 /config/dobissreceive1.py
name: prog1
scan_interval: 10
- platform: command_line
command: python3 /config/dobissreceive2.py
name: prog2
scan_interval: 10
#python script
#!/usr/bin/python3
import socket
import codecs
import binascii
host = '192.168.0.10'
port = 1001
message = binascii.a2b_hex ("ED63300000000000000000000000AFAF4205420a410041014102410341044105410B42024304430A430B4408440943074306440A4500450145024503410A4106")
mySocket = socket.socket()
mySocket.connect((host,port))
mySocket.send(message)
data = mySocket.recv(1024)
data = binascii.hexlify(data).decode()
print (data)
mySocket.close()