Open TobsA13 opened 2 years ago
Do you get sensible responses when querying scenes that have values other than MASK?
Yes other values are working correct. It's only the MASK value.
Hm. What's the value of c.raw_value.as_integer
?
Also 0
Ok it seems that I have to query the value twice to get the right data. So you are right, the issue is also on non "MASK" values.
# Scene0 = 0, Scene1 = MASK, Scene2 = 246, Scene3 = MASK
dali_driver = SyncHassebDALIUSBDriver()
a = address.Short(8)
print(dali_driver.send(gear.QuerySceneLevel(a, 0)).value) # MASK
print(dali_driver.send(gear.QuerySceneLevel(a, 0)).value) # 0
print(dali_driver.send(gear.QuerySceneLevel(a, 1)).value) # 0
print(dali_driver.send(gear.QuerySceneLevel(a, 1)).value) # MASK
print(dali_driver.send(gear.QuerySceneLevel(a, 2)).value) # MASK
print(dali_driver.send(gear.QuerySceneLevel(a, 2)).value) # 246
print(dali_driver.send(gear.QuerySceneLevel(a, 3)).value) # 246
print(dali_driver.send(gear.QuerySceneLevel(a, 3)).value) # MASK
Ok the issue seems to occur when I have sniffing enabled. As soon I have sniffing disabled I get the right values.
I don't know if this is a bug, or you should not use sniffing and querying commands at the same time.
What's your setup? You have a Hasseb device that you are controlling with your script, and a Lunatone DALI-USB also connected to the same bus for sniffing, running their software?
HI sorry for the delay, wasn't home the last days. Yes correct. The Hasseb device is my main device for the iot integration. The Lunatone device was for setting up some of their DALI hardware.
Do you use the sniffing of the Hasseb device? I also get many errors during the sniffing, so I can't use the output of the sniffing.
('ERROR', bytearray(b'\xaa\x07\x00\x06\x00\x00\x00\x00\x00\x00'))
('ERROR', bytearray(b'\xaa\x07\x01\x06\x01\x00\x00\x00\x00\x00'))
('ERROR', bytearray(b'\xaa\x07\x00\x06\x00\x00\x00\x00\x00\x00'))
Which should be:
My code for the sniffing, it does not matter if I use the Sync or the Async driver:
from pprint import pprint
from threading import Thread
from dali.driver.hasseb import AsyncHassebDALIUSBDriver
dali_driver = AsyncHassebDALIUSBDriver()
dali_driver.enableSniffing()
def ref(driver):
while True:
data = driver.receive()
if data is not None and len(data) > 0:
text = ""
if data[3] == 0x05:
text += 'SNIFF'
elif data[3] == 0x06:
text += 'ERROR'
else:
text += 'OTHER'
pprint((text, data))
thread = Thread(target = ref, args = (dali_driver, ))
thread.start()
I don't use the Hasseb device. I think you're going to have to talk to @hasseb directly about this; they wrote the firmware and supplied the driver.
Hi, I get a 0 as response when I querying a scene with has the value 255.
This is a log from a Lunatone interface.![image](https://user-images.githubusercontent.com/6277036/151437347-18afa506-8df6-46b1-93e9-a9033f33f18b.png)
I tried to search the bug in the code, but I could not find it.