Hi,
I have a working setup of roller shutters via serial port. There are 3 commands: UP, DOWN, STOP. But I want to have another one which moves the shutter to desired percentage openness. I’ve tried to do this many ways using rules but nothing works. So, can you help me?
shutters.items
Rollershutter Kitchen_shutter "Kitchen [%d %%]" { serial="/dev/ttyUSB1@19200,REGEX(POS.*11 04 (\\d*)\\d FFFF FF),UP(CMD 11 04 05\r),DOWN(CMD 11 04 04\r),STOP(CMD 11 04 03\r)" }
The REGEX gives me the percentage position of the shutter (11 is the number/address of the Kitchen shutter) and the answer from the controller looks like this (for 100% open):
POS * 11 04 1000 FFFF FF
What I want to achieve:
- check the current shutter position, the command for it:
POS < 11 04 FFFF FFFF FF\r
With bash it works like:
echo -ne ‘POS < 11 04 FFFF FFFF FF\r’ > /dev/ttyUSB1
- set the shutter to desired percentage position (70% for example):
POS > 11 04 0700 FFFF FF\r
With bash it works like:
echo -ne ‘POS > 11 04 0700 FFFF FF\r’ > /dev/ttyUSB1
Any suggestions are welcome
PS. Another thing regarding items file with serial binding is that, every time I change something i’ve got an error:
Binding configuration of type ‘serial’ of item ‘Kitchen_shutter’ could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Could not open serial port /dev/ttyUSB1: Serial port ‘/dev/ttyUSB1’ could not be found. Available ports are:
/dev/ttyUSB0
And I have to restart entire VM. Then it works just fine. It’s really pain in the ass with this. Regular OH restart does not work - the same error. Anyone?