2024-11-14 12:40:33.360 Eldat_Easywave: Local context:
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'Devices' '{1: <Domoticz.Device object at 0x7f982ce8d0>, 2: <Domoticz.Device object at 0x7f98208210>, 3: <Domoticz.Device object at 0x7f98208170>, 4: <Domoticz.Device object at 0x7f982080d0>, 5: <Domoticz.Device object at 0x7f98208030>, 6: <Domoticz.Device object at 0x7f9820b0f0>, 7: <Domoticz.Device object at 0x7f983c2a10>, 8: <Domoticz.Device object at 0x7f9820b050>, 9: <Domoticz.Device object at 0x7f9820afb0>, 10: <Domoticz.Device object at 0x7f9820af10>, 11: <Domoticz.Device object at 0x7f9820ae70>, 12: <Domoticz.Device object at 0x7f9820add0>, 13: <Domoticz.Device object at 0x7f9820ad30>, 14: <Domoticz.Device object at 0x7f9820ac90>, 15: <Domoticz.Device object at 0x7f9820abf0>, 16: <Domoticz.Device object at 0x7f9820ab50>, 17: <Domoticz.Device object at 0x7f9820aab0>, 18: <Domoticz.Device object at 0x7f9820aa10>, 19: <Domoticz.Device object at 0x7f9820a970>, 20: <Domoticz.Device object at 0x7f9820a8d0>, 21: <Domoticz.Device object at 0x7f9820a830>, 22: <Domoticz.Device object at 0x7f9820a790>, 23: <Domoticz.Device object at 0x7f9820a6f0>, 24: <Domoticz.Device object at 0x7f9820a650>, 25: <Domoticz.Device object at 0x7f9820a5b0>, 26: <Domoticz.Device object at 0x7f9820a510>, 27: <Domoticz.Device object at 0x7f9820a470>, 28: <Domoticz.Device object at 0x7f9820a3d0>, 29: <Domoticz.Device object at 0x7f9820a330>, 30: <Domoticz.Device object at 0x7f9820a290>, 31: <Domoticz.Device object at 0x7f9820a1f0>, 32: <Domoticz.Device object at 0x7f9820a150>, 33: <Domoticz.Device object at 0x7f9820a0b0>, 34: <Domoticz.Device object at 0x7f9820a010>, 35: <Domoticz.Device object at 0x7f98209f70>, 36: <Domoticz.Device object at 0x7f98209ed0>, 37: <Domoticz.Device object at 0x7f98209e30>, 38: <Domoticz.Device object at 0x7f98209d90>, 39: <Domoticz.Device object at 0x7f98209cf0>, 40: <Domoticz.Device object at 0x7f98209c50>, 41: <Domoticz.Device object at 0x7f98209bb0>, 42: <Domoticz.Device object at 0x7f98209b10>, 43: <Domoticz.Device object at 0x7f98209a70>, 44: <Domoticz.Device object at 0x7f982099d0>, 45: <Domoticz.Device object at 0x7f98209930>, 46: <Domoticz.Device object at 0x7f98209890>, 47: <Domoticz.Device object at 0x7f982097f0>, 48: <Domoticz.Device object at 0x7f98209750>, 49: <Domoticz.Device object at 0x7f982096b0>, 50: <Domoticz.Device object at 0x7f98209610>, 51: <Domoticz.Device object at 0x7f98209570>, 52: <Domoticz.Device object at 0x7f982094d0>, 53: <Domoticz.Device object at 0x7f98209430>, 54: <Domoticz.Device object at 0x7f98209390>, 55: <Domoticz.Device object at 0x7f982092f0>, 56: <Domoticz.Device object at 0x7f98209250>, 57: <Domoticz.Device object at 0x7f982091b0>, 58: <Domoticz.Device object at 0x7f98209110>, 59: <Domoticz.Device object at 0x7f98209070>, 60: <Domoticz.Device object at 0x7f98208fd0>, 61: <Domoticz.Device object at 0x7f98208f30>, 62: <Domoticz.Device object at 0x7f98208e90>, 63: <Domoticz.Device object at 0x7f98208df0>, 64: <Domoticz.Device object at 0x7f98208d50>}'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'Domoticz' '<module 'Domoticz' (built-in)>'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'Images' '{}'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'Parameters' '{'HardwareID': 2, 'HomeFolder': '/home/aeisenhuth/domoticz/plugins/Eldat_Easywave/', 'StartupFolder': '/home/aeisenhuth/domoticz/', 'UserDataFolder': '/home/aeisenhuth/domoticz/', 'WebRoot': '', 'Database': '/home/aeisenhuth/domoticz/domoticz.db', 'Language': 'en', 'Version': '0.4.0', 'Author': 'WimR', 'Name': 'Eldat_Easywave', 'Address': '', 'Port': '0', 'SerialPort': '', 'Username': '', 'Password': '', 'Key': 'Easywave', 'Mode1': '64', 'Mode2': '127.0.0.1', 'Mode3': '5331', 'Mode4': '', 'Mode5': '', 'Mode6': 'Debug', 'DomoticzVersion': '2024.7', 'DomoticzHash': 'b317cfab1', 'DomoticzBuildTime': '2024-07-13 16:59:31'}'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'Settings' '{'DB_Version': '169', 'Title': 'Domoticz', 'Unique_ID': '98d50795-3dfc-4995-9e32-547ab9e732f3', 'LightHistoryDays': '30', 'MeterDividerEnergy': '1000', 'MeterDividerGas': '100', 'MeterDividerWater': '100', 'RandomTimerFrame': '15', 'ElectricVoltage': '230', 'CM113DisplayType': '0', '5MinuteHistoryDays': '1', 'SensorTimeout': '60', 'SensorTimeoutNotification': '0', 'UseAutoUpdate': '1', 'UseAutoBackup': '0', 'CostEnergy': '2149', 'CostEnergyT2': '2149', 'CostEnergyR1': '800', 'CostEnergyR2': '800', 'CostGas': '6218', 'CostWater': '16473', 'UseEmailInNotifications': '1', 'SendErrorNotifications': '0', 'EmailPort': '25', 'EmailAsAttachment': '0', 'DoorbellCommand': '0', 'NotificationSensorInterval': '43200', 'NotificationSwitchInterval': '0', 'RemoteSharedPort': '6144', 'Language': 'en', 'DashboardType': '0', 'MobileType': '0', 'WindUnit': '0', 'TempUnit': '0', 'WeightUnit': '0', 'SecStatus': '0', 'SecOnDelay': '30', 'ReleaseChannel': '0', 'RaspCamParams': '-w 800 -h 600 -t 1', 'UVCParams': '-S80 -B128 -C128 -G80 -x800 -y600 -q100', 'AcceptNewHardware': '1', 'BatteryLowNotification': '0', 'AllowWidgetOrdering': '1', 'ActiveTimerPlan': '0', 'HideDisabledHardwareSensors': '1', 'EnableEventScriptSystem': '1', 'EventSystemLogFullURL': '1', 'DisableDzVentsSystem': '0', 'DzVentsLogLevel': '3', 'LogEventScriptTrigger': '1', 'WebTheme': 'default', 'FloorplanPopupDelay': '750', 'FloorplanFullscreenMode': '0', 'FloorplanAnimateZoom': '1', 'FloorplanShowSensorValues': '1', 'FloorplanShowSwitchValues': '0', 'FloorplanShowSceneNames': '1', 'FloorplanRoomColour': 'Blue', 'FloorplanActiveOpacity': '25', 'FloorplanInactiveOpacity': '5', 'TempHome': '20', 'TempAway': '15', 'TempComfort': '22.0', 'DegreeDaysBaseTemperature': '18.0', 'HTTPURL': 'aHR0cHM6Ly93d3cuc29tZWdhdGV3YXkuY29tL3B1c2h1cmwucGhwP3VzZXJuYW1lPSNGSUVMRDEmcGFzc3dvcmQ9I0ZJRUxEMiZhcGlrZXk9I0ZJRUxEMyZmcm9tPSNGSUVMRDQmdG89I1RPJm1lc3NhZ2U9I01FU1NBR0U=', 'HTTPPostContentType': 'YXBwbGljYXRpb24vanNvbg==', 'ShowUpdateEffect': '0', 'ShortLogInterval': '5', 'ShortLogAddOnlyNewValues': '0', 'SendErrorsAsNotification': '0', 'IFTTTEnabled': '0', 'EmailEnabled': '1', 'MaxElectricPower': '6000', 'HourIdxElectricityDevice': '0', 'HourIdxGasDevice': '0', 'Currency': '€', 'P1DisplayType': '0', 'Domoticz_Version': '2024.7'}'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'socket' '<module 'socket' from '/usr/lib/python3.11/socket.py'>'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'sys' '<module 'sys' (built-in)>'
2024-11-14 12:40:33.360 Eldat_Easywave: ----> 'time' '<module 'time' (built-in)>'
2024-11-14 12:40:33.360 Eldat_Easywave: Acquiring GIL for 'onCommandCallback'
2024-11-14 12:40:36.014 Eldat_Easywave: Pushing 'onHeartbeatCallback' on to queue
2024-11-14 12:40:36.064 Eldat_Easywave: Processing 'onHeartbeatCallback' message
2024-11-14 12:40:36.064 Eldat_Easywave: Acquiring GIL for 'onHeartbeatCallback'
2024-11-14 12:40:36.064 Eldat_Easywave: Calling message handler 'onHeartbeat' on 'module' type object.
2024-11-14 12:40:36.064 Eldat_Easywave: Acquiring GIL for 'onHeartbeatCallback'
Eldat Easywave RXR09 Script
Moderator: leecollings
-
- Posts: 46
- Joined: Thursday 26 January 2017 21:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Homberg, Hessen, Germany
- Contact:
Re: Eldat Easywave RXR09 Script
RaspberryPI Home Assistant with -> AppleHome, HUE, Osram, Ikea, Aqara, Xiaomi, Worx, SmartLife, AlphaESS, Meross, Viessmann, PhillipsTV, Shelly
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
-
- Posts: 46
- Joined: Saturday 03 February 2018 17:18
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: Belgium
- Contact:
Re: Eldat Easywave RXR09 Script
Hi
Question did you close the sessio. On the pi before using domoticz? Just asking since the test python .... line doesn't t have the & char at the end to force the process to continue running even if you close your session.
Also check the content of /tmp/SerProxy.Log
Currently at work in office.
Will look further tonight
Regards
Question did you close the sessio. On the pi before using domoticz? Just asking since the test python .... line doesn't t have the & char at the end to force the process to continue running even if you close your session.
Also check the content of /tmp/SerProxy.Log
Currently at work in office.
Will look further tonight
Regards
-
- Posts: 46
- Joined: Thursday 26 January 2017 21:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Homberg, Hessen, Germany
- Contact:
Re: Eldat Easywave RXR09 Script
Yes, I closed the session. Unfortunately, I don't have /tmp/serproxy.log on my system, nor did I have it on my old Pi. I also have no idea what else could be the reason. I took the latest Raspian OS version, the system is also up to date.
Best regards
Best regards
RaspberryPI Home Assistant with -> AppleHome, HUE, Osram, Ikea, Aqara, Xiaomi, Worx, SmartLife, AlphaESS, Meross, Viessmann, PhillipsTV, Shelly
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
-
- Posts: 46
- Joined: Saturday 03 February 2018 17:18
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: Belgium
- Contact:
Re: Eldat Easywave RXR09 Script
I'll post tonight code that also allows you to choose where to put the SerProxy.Log.
That should give us more insight if the proxy is running and what is does
regards
That should give us more insight if the proxy is running and what is does
regards
-
- Posts: 46
- Joined: Thursday 26 January 2017 21:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Homberg, Hessen, Germany
- Contact:
Re: Eldat Easywave RXR09 Script
Tank you very much.
RaspberryPI Home Assistant with -> AppleHome, HUE, Osram, Ikea, Aqara, Xiaomi, Worx, SmartLife, AlphaESS, Meross, Viessmann, PhillipsTV, Shelly
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
-
- Posts: 46
- Joined: Saturday 03 February 2018 17:18
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: Belgium
- Contact:
Re: Eldat Easywave RXR09 Script
Hi,
/etc/rc.local
python /home/pi/project/python_programs/rx09v20241116.py -p /tmp/SerialPid /dev/ttyUSB0 5331 192.168.1.54 28080 /home/pi/project/python_programs/devices.csv /tmp/serLog.txt &
Usage:
-p file that will contain the process number of the program
device location
port program will listen on
Domoticz IP adress used in http call
Domoticz port number used for accepting http calls
file that may contain the link table between Easywave switches (like Eldat RT34, ...) and Domoticz switches
File that will hold the logging of the program
when you adapt the line in your /etc/rc.local make sure to adapt the locations for the python script, SerialPID, devices.csv and serLog.txt to directories you have write access
rx09v20241116.py
After startup the log file should contain:
adding in devices.csv:
201a6c;115
would link the TXP message from an Easywave enabled switch with ID 201a6c to the Domotic switch with idx 115
regards
/etc/rc.local
python /home/pi/project/python_programs/rx09v20241116.py -p /tmp/SerialPid /dev/ttyUSB0 5331 192.168.1.54 28080 /home/pi/project/python_programs/devices.csv /tmp/serLog.txt &
Usage:
-p file that will contain the process number of the program
device location
port program will listen on
Domoticz IP adress used in http call
Domoticz port number used for accepting http calls
file that may contain the link table between Easywave switches (like Eldat RT34, ...) and Domoticz switches
File that will hold the logging of the program
when you adapt the line in your /etc/rc.local make sure to adapt the locations for the python script, SerialPID, devices.csv and serLog.txt to directories you have write access
rx09v20241116.py
Code: Select all
# based upon: https://github.com/richardkchapman/serproxy/blob/master/serproxy.py
#
# Python version of serproxy for Easywave (RX09) v20180407
#
# Python 3.5.1
# Windows 10, Pi 4.59. V7+
#
# Accept requests by socket (TCP/IP Raw) and forward to Serial Port
# Return Serial response to socket
#
# Original Author: Richard K Chapman
# Adaptations: WimR
#
# Date: 2018 01 12 Original version
# 2018 02 28 Added read csv with link: switch id TO domoticz idx
# Read serial line and add to log as 'respons'
# 2018 03 16 Added 'C' telegram mapped to 'Stop' (for devices Venitian Blinds EU)
# 19 Added Dict for Commands
# Made path to devices.csv relative
# Added counter for devices table
# 30 Added different behaviour for Blinds. SwitchType will be checked first
# 04 07 transferred full handling of formatting Easywave Telegram to RX09.py, plugin.py only transfers commands, unit ids and switchtype over socket
# format: Command;Unit Id;SwitchType
# 2024 11 13 Adapted skip usage urllib2 replaced by urllib3
#
from socket import *
from threading import Thread
from collections import defaultdict
import logging
import serial
import time
import sys
import os
import csv
import json, urllib3
from urllib3.exceptions import HTTPError, MaxRetryError, TimeoutError
ser = None
allClients = []
BUFSIZ = 1024
serialDevice = None
CommandMap = {'A':'On','B':'Off','C':'Stop','D':'Off'}
BasicType = {'On':'A','Off':'B','Stop':'C'}
CommandMapBlind = {'A':'Off','B':'On','C':'Stop','D':'Off'}
BlindType = {'On':'B','Off':'A','Stop':'C'}
def serialReader():
global ser
global allClients
global serialDevice
global domoticzIP
global domoticzPort
global pairingFile
global allDevices
global CommandMap
global CommandMapBlind
line = []
oldLine = ''
oldTime = time.time()
#allDevices = {}
http = urllib3.PoolManager()
while 1:
try:
# configure the serial connections (the parameters differs on the device you are connecting to)
ser = serial.Serial(
port=serialDevice,
baudrate=57600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS
)
ser.isOpen()
logging.info('Serial port opened %s', ser)
# main listener loop
while 1:
out = ser.read(1)
line.append(out)
# wait till '\r' as end of line char
if out == '\r':
# handle message received
myLine = ''.join(line)
logging.info('Serial respons : %s', myLine)
# if myLine starts with REC :split line use second part as key in dict and lauch json call
if myLine[0:3] == 'REC':
EasywaveID = myLine[4:10]
logging.info('Check device table for link to idx: %s', EasywaveID)
if allDevices[EasywaveID] is None:
# transmitter not in devices.csv
logging.info('Warning : unknown physical RF transmitter: %s Please add to device table with corresponding idx', myLine[4:10])
else:
# switch may be paired to multiple idx's
if True:
#for idx in allDevices[EasywaveID]:
idx = allDevices[EasywaveID][0]
oldTime = time.time() -1
myTime = time.time()
logging.info('Check domiticz device with idx: ' + idx)
# Check with Domoticz what kind of switch we are dealing with
domoticzUrl = ("http://%s:%s/json.htm?type=devices&rid=%s" % ( domoticzIP, domoticzPort, idx))
logging.info('Domiticz url: ' + domoticzUrl)
try:
response = http.request('GET', domoticzUrl)
result_data = response.data.decode('utf-8')
result_load = json.loads(result_data)
response_status = result_load["status"]
logging.info('Respons domoticz : %s', response_status)
if result_load["result"][0]["SubType"] != 'Switch':
logging.info("Warning : Key : %s is linked to idx: %s but its not a Switch "% (EasywaveID, idx ))
else:
# known physical RF transmitter linked to switch
if result_load["result"][0]["SwitchTypeVal"] == 15:
myCommand = CommandMapBlind.get(myLine[11])
else:
myCommand = CommandMap.get(myLine[11])
if myCommand is None:
logging.info('Warning : unknown Command from physical transmitter: ' + myLine[11])
else:
logging.info('Key : ' + EasywaveID + ' Mapped to : ' + str(idx) + ' Telegram : ' + myLine[11] + ' mapped to Command : ' + myCommand)
# switches may bounce and emit rapidly 2 to 5 times the same command: debounce by comparing content and time lapse (more than 1 sec apart)
#print('-->'+ oldline + '<-->' +myLine + '<--')
#print('-->'+ str(oldTime) + '<-->' + str(myTime) + '<--')
if myLine <> oldLine or myTime - oldTime > 1:
# transfer received command to Domoticz
# response = http.request('GET', url)
domoticzUrl = ("http://%s:%s/json.htm?type=command¶m=switchlight&idx=%s&switchcmd=%s&level=0" % (domoticzIP, domoticzPort ,idx, myCommand))
logging.info('Domiticz url: ' + domoticzUrl)
try:
response = http.request('GET', domoticzUrl)
result_data = response.data.decode('utf-8')
result_load = json.loads(result_data)
response_status = result_load["status"]
logging.info('Respons domoticz : %s', response_status)
except HTTPError as e:
logging.info('HTTP error occurred:', e)
except MaxRetryError as e:
logging.info('Max retries exceeded:', e)
except TimeoutError as e:
logging.info('Request timed out:', e)
# arm debounce mechanism
oldTime = myTime
oldLine = myLine
except HTTPError as e:
logging.info('HTTP error occurred:', e)
except MaxRetryError as e:
logging.info('Max retries exceeded:', e)
except TimeoutError as e:
logging.info('Request timed out:', e)
else:
# respons is not from a switch telegram captured (OK, ERROR)
# write line to all clients
for elem in line:
for client in allClients:
client.send(elem)
# Clear line
line = []
except:
# Wait a while then try again
logging.debug('Error on serial port')
if ser is not None:
ser.close()
ser = None
time.sleep(10)
def handler(clientsock,addr):
global ser
global allClients
global BasicType
global BlindType
logging.info('Connected from: %s', addr)
allClients.append(clientsock)
while 1:
data = clientsock.recv(BUFSIZ)
if not data:
break
if not (ser is None):
logging.info('Message received: %s ', data)
logging.info('Message received 3 chars: %s ', data[:3])
print('Received: ' + data)
# keep version compatible with old plugin versions
if data[:3] == 'TXP':
print('Classic: ' + data)
logging.info('Message received old style: %s ', data)
ser.write(data)
else:
# build Easywave Telegram ( TXP,FF,A\r ) from new plugin format: Command;Unit Id;SwitchType
# get hex number: str(format( Unit -1 , '02X'))
# translate command: BasicType.get(Command)
# if SwithType == 15 -> BlindType.get(Command)
print('New: ' + data)
logging.info('Message received NEW style: %s ', data)
logging.info('Message new format Switchtype received: %s ', data.split(';')[2])
logging.info('Message new format SwitchNumber received: %s ', data.split(';')[1])
logging.info('Message new format SwitchCommand received: %s ', data.split(';')[0])
if data.split(';')[2] == 15:
Telegram = 'TXP,' + str(format( data.split(';')[1] -1, '02X')) + ',' + BlindType.get(data.split(';')[0]) +'\r'
else:
Telegram = 'TXP,' + str(format( data.split(';')[1] -1, '02X')) + ',' + BasicType.get(data.split(';')[0]) +'\r'
logging.info('Telegram written: %s ', Telegram)
ser.write(Telegram)
logging.info('Disconnected from: %s', addr)
allClients.remove(clientsock)
clientsock.close()
def mainProgram():
global serialDevice
global port
global domoticzIP
global domoticzPort
global pairingFile
global allDevices
global PidFile
global LogFile
PidFile = '/tmp/serPID.txt'
if len(sys.argv)>=8 and sys.argv[1] == '-p':
writePidFile(sys.argv[2])
PidFile = sys.argv[2]
del sys.argv[2]
del sys.argv[1]
if len(sys.argv) != 7:
print ('usage: ' + sys.argv[0] + ' device port domoticzIP domoticzPort pairingFile LogFile')
exit()
serialDevice=sys.argv[1]
port=int(sys.argv[2])
domoticzIP=sys.argv[3]
domoticzPort=sys.argv[4]
pairingFile=sys.argv[5]
LogFile=sys.argv[6]
print ('\nLogfile: ' + LogFile)
logging.basicConfig(filename=LogFile, filemode='w', format='%(asctime)s %(levelname)s:%(message)s', level=logging.DEBUG)
print ('Version Serial Proxy: RX09v20241113')
print ('Serial Device: ' + sys.argv[1])
print ('Serial Port: ' + sys.argv[2])
print ('Domoticz IP: ' + sys.argv[3])
print ('Domoticz Port: ' + sys.argv[4])
print ('Pairing File: ' + sys.argv[5])
print ('Logging File: ' + sys.argv[6])
logging.info('Version Serial Proxy: RX09v20241116')
logging.info('Serial Device: ' + sys.argv[1])
logging.info('Serial Port: ' + sys.argv[2])
logging.info('Domoticz IP: ' + sys.argv[3])
logging.info('Domoticz Port: ' + sys.argv[4])
logging.info('Pairing File: ' + sys.argv[5])
logging.info('Logging File: ' + sys.argv[6])
# check if pairing file exists. Try to create otherwise
if os.path.exists(pairingFile):
if not os.path.isfile(pairingFile):
print ("Pairing File is not a File")
logging.info("Pairing File is not a File")
os._exit(0)
else:
# create pairingFile
createPairingFile(pairingFile)
# load device table from csv file
allDevices = defaultdict(list)
logging.info('Device table being loaded in dictionnary.')
ifile = open(pairingFile, "rU")
logging.info('Device table being opened.')
reader = csv.reader(ifile, delimiter=";")
# built dict of lists
for row in reader:
logging.info('Device: ' + row[0] + ' Linked to ' + row[1])
allDevices[row[0]].append(row[1])
ifile.close()
logging.info('Device table being closed.')
logging.info('Device table loaded in dictionnary. Number of devices loaded: %d ' % (len(allDevices)-1))
Thread(target=serialReader).start()
ser = None
allClients = []
listenAddr = ('', port)
try:
serversock = socket(AF_INET, SOCK_STREAM)
serversock.bind(listenAddr)
serversock.listen(2)
logging.info('waiting for connection')
while 1:
clientsock, addr = serversock.accept()
Thread(target=handler, args=(clientsock, addr)).start()
except KeyboardInterrupt:
if not ser is None:
ser.close()
os._exit(0)
def writePidFile(pidfile):
pid = str(os.getpid())
f = open(pidfile, 'w')
f.write(pid)
f.close()
def createPairingFile(pairingFile):
f = open(pairingFile, 'w')
f.write("Key;idx")
f.close()
print ("Pairing File created:" + pairingFile)
logging.info("Pairing File created: " + pairingFile)
if __name__=='__main__':
mainProgram()
Code: Select all
cat /tmp/serLog.txt
2024-11-16 17:12:57,052 INFO:Version Serial Proxy: RX09v20241116
2024-11-16 17:12:57,053 INFO:Serial Device: /dev/ttyUSB0
2024-11-16 17:12:57,053 INFO:Serial Port: 5331
2024-11-16 17:12:57,053 INFO:Domoticz IP: 192.168.1.54
2024-11-16 17:12:57,054 INFO:Domoticz Port: 28080
2024-11-16 17:12:57,054 INFO:Pairing File: /home/pi/project/python_programs/devices.csv
2024-11-16 17:12:57,054 INFO:Logging File: /tmp/serLog.txt
2024-11-16 17:12:57,054 INFO:Device table being loaded in dictionnary.
2024-11-16 17:12:57,055 INFO:Device table being opened.
2024-11-16 17:12:57,055 INFO:Device: Key Linked to idx
2024-11-16 17:12:57,055 INFO:Device: 2eae2d Linked to 103
2024-11-16 17:12:57,055 INFO:Device: 201a6c Linked to 104
2024-11-16 17:12:57,056 INFO:Device: 2eae67 Linked to 107
2024-11-16 17:12:57,056 INFO:Device: 2eae95 Linked to 102
2024-11-16 17:12:57,056 INFO:Device: 2eae9d Linked to 101
2024-11-16 17:12:57,056 INFO:Device: 2eaea4 Linked to 106
2024-11-16 17:12:57,057 INFO:Device: 167f2a Linked to 724
2024-11-16 17:12:57,057 INFO:Device: 167f2a Linked to 725
2024-11-16 17:12:57,057 INFO:Device: 167f2b Linked to 725
2024-11-16 17:12:57,057 INFO:Device: 167f2c Linked to 726
2024-11-16 17:12:57,058 INFO:Device: 167f2d Linked to 727
2024-11-16 17:12:57,058 INFO:Device: 167f2e Linked to 728
2024-11-16 17:12:57,058 INFO:Device: 167f2f Linked to 729
2024-11-16 17:12:57,059 INFO:Device: 167f30 Linked to 730
2024-11-16 17:12:57,059 INFO:Device: 167f31 Linked to 731
2024-11-16 17:12:57,059 INFO:Device: 167f32 Linked to 732
2024-11-16 17:12:57,059 INFO:Device: 167f33 Linked to 733
2024-11-16 17:12:57,060 INFO:Device table being closed.
2024-11-16 17:12:57,060 INFO:Device table loaded in dictionnary. Number of devices loaded: 16
2024-11-16 17:12:57,061 INFO:waiting for connection
2024-11-16 17:12:57,065 INFO:Serial port opened Serial<id=0x764c4e10, open=True>(port='/dev/ttyUS B0', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=Fals e, dsrdtr=False)
2024-11-16 17:14:58,904 INFO:Connected from: ('192.168.1.54', 60013)
2024-11-16 17:14:58,906 INFO:Message received: TXP,05,B
2024-11-16 17:14:58,908 INFO:Message received 3 chars: TXP
2024-11-16 17:14:58,909 INFO:Message received old style: TXP,05,B
2024-11-16 17:14:58,913 INFO:Serial respons : OK
2024-11-16 17:14:59,993 INFO:Disconnected from: ('192.168.1.54', 60013)
2024-11-16 17:15:03,665 INFO:Connected from: ('192.168.1.54', 60014)
2024-11-16 17:15:03,677 INFO:Message received: TXP,05,A
2024-11-16 17:15:03,678 INFO:Message received 3 chars: TXP
2024-11-16 17:15:03,678 INFO:Message received old style: TXP,05,A
2024-11-16 17:15:03,684 INFO:Serial respons : OK
2024-11-16 17:15:04,694 INFO:Disconnected from: ('192.168.1.54', 60014)
2024-11-16 17:15:11,772 INFO:Serial respons : REC,167f33,A
2024-11-16 17:15:11,773 INFO:Check device table for link to idx: 167f33
2024-11-16 17:15:11,774 INFO:Check domiticz device with idx: 733
2024-11-16 17:15:11,774 INFO:Domiticz url: http://192.168.1.54:28080/json.htm?type=devices&rid=73 3
2024-11-16 17:15:11,776 DEBUG:Starting new HTTP connection (1): 192.168.1.54
2024-11-16 17:15:11,792 DEBUG:http://192.168.1.54:28080 "GET /json.htm?type=devices&rid=733 HTTP/ 1.1" 200 1610
2024-11-16 17:15:11,796 INFO:Respons domoticz : OK
2024-11-16 17:15:11,799 INFO:Key : 167f33 Mapped to : 733 Telegram : A mapped to Command : On
2024-11-16 17:15:11,799 INFO:Domiticz url: http://192.168.1.54:28080/json.htm?type=command¶m= switchlight&idx=733&switchcmd=On&level=0
2024-11-16 17:15:11,801 DEBUG:Resetting dropped connection: 192.168.1.54
2024-11-16 17:15:11,859 DEBUG:http://192.168.1.54:28080 "GET /json.htm?type=command¶m=switchl ight&idx=733&switchcmd=On&level=0 HTTP/1.1" 200 47
2024-11-16 17:15:11,862 INFO:Respons domoticz : OK
2024-11-16 17:15:11,864 INFO:Serial respons : REC,167f33,A
2024-11-16 17:15:11,864 INFO:Check device table for link to idx: 167f33
2024-11-16 17:15:11,865 INFO:Check domiticz device with idx: 733
2024-11-16 17:15:11,865 INFO:Domiticz url: http://192.168.1.54:28080/json.htm?type=devices&rid=73 3
2024-11-16 17:15:11,867 DEBUG:Resetting dropped connection: 192.168.1.54
2024-11-16 17:15:11,878 DEBUG:http://192.168.1.54:28080 "GET /json.htm?type=devices&rid=733 HTTP/ 1.1" 200 1608
2024-11-16 17:15:11,882 INFO:Respons domoticz : OK
2024-11-16 17:15:11,882 INFO:Key : 167f33 Mapped to : 733 Telegram : A mapped to Command : On
2024-11-16 17:15:11,883 INFO:Domiticz url: http://192.168.1.54:28080/json.htm?type=command¶m= switchlight&idx=733&switchcmd=On&level=0
2024-11-16 17:15:11,884 DEBUG:Resetting dropped connection: 192.168.1.54
2024-11-16 17:15:11,910 DEBUG:http://192.168.1.54:28080 "GET /json.htm?type=command¶m=switchl ight&idx=733&switchcmd=On&level=0 HTTP/1.1" 200 47
2024-11-16 17:15:11,913 INFO:Respons domoticz : OK
201a6c;115
would link the TXP message from an Easywave enabled switch with ID 201a6c to the Domotic switch with idx 115
regards
-
- Posts: 46
- Joined: Thursday 26 January 2017 21:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Homberg, Hessen, Germany
- Contact:
Re: Eldat Easywave RXR09 Script
2024-11-19 09:47:33.032 Status: Domoticz V2024.7 (c)2012-2024 GizMoCuz
2024-11-19 09:47:33.032 Status: Build Hash: b317cfab1, Date: 2024-07-13 16:59:31
2024-11-19 09:47:33.032 Status: Startup Path: /home/aeisenhuth/domoticz/
2024-11-19 09:47:33.368 Status: PluginSystem: Started, Python version '3.11.2', 2 plugin definitions loaded.
2024-11-19 09:47:33.381 Status: WebServer(HTTP) started on address: :: with port 8088
2024-11-19 09:47:33.446 Status: WebServer(SSL) started on address: :: with port 4438
2024-11-19 09:47:33.449 Status: TCPServer: shared server started...
2024-11-19 09:47:33.450 Status: RxQueue: queue worker started...
2024-11-19 09:47:35.452 Status: Eldat_Easywave: Entering work loop.
2024-11-19 09:47:35.452 Status: Eldat_Easywave: Started.
2024-11-19 09:47:35.452 Status: NotificationSystem: thread started...
2024-11-19 09:47:35.454 Status: EventSystem: reset all events...
2024-11-19 09:47:35.455 Status: EventSystem: reset all device statuses...
2024-11-19 09:47:35.527 Status: Python EventSystem: Initializing event module.
2024-11-19 09:47:35.528 Status: EventSystem: Started
2024-11-19 09:47:35.528 Status: EventSystem: Queue thread started...
2024-11-19 09:47:35.638 Status: Eldat_Easywave: Initialized version 0.4.0, author 'WimR'
2024-11-19 09:47:35.688 Status: PluginSystem: 1 plugins started.
2024-11-19 09:49:27.906 Status: Login successful from 192.168.178.134 for user 'aeisenhuth'
2024-11-19 09:49:27.907 Status: [web:8088] Incoming connection from: 192.168.178.134
2024-11-19 09:49:52.290 Status: User: aeisenhuth (IP: 192.168.178.134) initiated a switch command (1/Beschattung_Arbeitszimmer_gr_EG/Close)
I replaced the file and adjusted the rc.local. However, my status in DOmoticz looks different. Could it be that I'm using a wrong Raspberry OS, I'll take the 64bit as the latest image with graphical desktop.
Thank you very much for your intensive help. Evetl. could you create an image for me with Raspian and domoticzs where the plugin works. Would even pay you that via PayPal. I'm now desperate that the shutters don't work anymore. Best regards aeisenhuth
2024-11-19 09:47:33.032 Status: Build Hash: b317cfab1, Date: 2024-07-13 16:59:31
2024-11-19 09:47:33.032 Status: Startup Path: /home/aeisenhuth/domoticz/
2024-11-19 09:47:33.368 Status: PluginSystem: Started, Python version '3.11.2', 2 plugin definitions loaded.
2024-11-19 09:47:33.381 Status: WebServer(HTTP) started on address: :: with port 8088
2024-11-19 09:47:33.446 Status: WebServer(SSL) started on address: :: with port 4438
2024-11-19 09:47:33.449 Status: TCPServer: shared server started...
2024-11-19 09:47:33.450 Status: RxQueue: queue worker started...
2024-11-19 09:47:35.452 Status: Eldat_Easywave: Entering work loop.
2024-11-19 09:47:35.452 Status: Eldat_Easywave: Started.
2024-11-19 09:47:35.452 Status: NotificationSystem: thread started...
2024-11-19 09:47:35.454 Status: EventSystem: reset all events...
2024-11-19 09:47:35.455 Status: EventSystem: reset all device statuses...
2024-11-19 09:47:35.527 Status: Python EventSystem: Initializing event module.
2024-11-19 09:47:35.528 Status: EventSystem: Started
2024-11-19 09:47:35.528 Status: EventSystem: Queue thread started...
2024-11-19 09:47:35.638 Status: Eldat_Easywave: Initialized version 0.4.0, author 'WimR'
2024-11-19 09:47:35.688 Status: PluginSystem: 1 plugins started.
2024-11-19 09:49:27.906 Status: Login successful from 192.168.178.134 for user 'aeisenhuth'
2024-11-19 09:49:27.907 Status: [web:8088] Incoming connection from: 192.168.178.134
2024-11-19 09:49:52.290 Status: User: aeisenhuth (IP: 192.168.178.134) initiated a switch command (1/Beschattung_Arbeitszimmer_gr_EG/Close)
I replaced the file and adjusted the rc.local. However, my status in DOmoticz looks different. Could it be that I'm using a wrong Raspberry OS, I'll take the 64bit as the latest image with graphical desktop.
Thank you very much for your intensive help. Evetl. could you create an image for me with Raspian and domoticzs where the plugin works. Would even pay you that via PayPal. I'm now desperate that the shutters don't work anymore. Best regards aeisenhuth
RaspberryPI Home Assistant with -> AppleHome, HUE, Osram, Ikea, Aqara, Xiaomi, Worx, SmartLife, AlphaESS, Meross, Viessmann, PhillipsTV, Shelly
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
RaspberryPI3 Domoticz -> EldatEasywave, Wunderground, MagicLight
-
- Posts: 46
- Joined: Saturday 03 February 2018 17:18
- Target OS: NAS (Synology & others)
- Domoticz version: 2020.2
- Location: Belgium
- Contact:
Re: Eldat Easywave RXR09 Script
Hi
it seems on the domoticz side the plugin starts ok
Could you include the log from the Rx09 ?
regards
it seems on the domoticz side the plugin starts ok
Could you include the log from the Rx09 ?
regards
Who is online
Users browsing this forum: No registered users and 0 guests