Comments (33)
@dirk777 @tikismoke @cellerich @Arduous @esevend : I did a complete rewrite of PyVLX for support of the new Firmware of velux. It would be great if you could try it out. (if you upgrade the firmware, you can no longer use the old lib, it is not backwards compatible.)
@MiSchroe : saw that you wrote an api library for javascript. Were you able to read the current position of windows? My KLF 200 is always answering with "unknown position".
from pyvlx.
@Julius2342 Thanks for updating the library to support the latest firmware. I have installed the firmware and using your updated module now. everything is working as expected. Will do some more testing..
One issue however totally unrelated to your python library, I cannot reach the web interface through LAN after the firmware update, any ideas?
The interface can't be opened via LAN with the new firmware, only WLAN.
from pyvlx.
Yes i have seen it. Will consider implementing it :-)
from pyvlx.
Nice to hear :)
Really interested by some value I saw in doc like current position, but not sure it's really available.
from pyvlx.
I'm installing the new firmware right now. fingers-crossed
from pyvlx.
Problem1: the webinterface is only reachable via wlan, not via LAN. (I can ping the host and i can connect to their management port 51200, but not to the webinterface ...)
Problem 2: their examples dont work :-(
from pyvlx.
@tikismoke : i played around with the new api: https://github.com/Julius2342/pyvlx/tree/master/new_api
The bad news is, that my windows don't propagate the current position :-/
from pyvlx.
Ok and the good news?
Does it works as except opening/closing?
I have to update the firmware first.
Then I can start some test.
from pyvlx.
At least the KLF 200 is talking to me :)
I can read scenes and read devices. At least in an example i was able to trigger a scene, but i did not implement it yet.
from pyvlx.
Still a lot work to do :)
from pyvlx.
Ok I'll wait a bit before start asking lot of things :)
Nice work by the way
from pyvlx.
Cool see the new release. I'll try to test it this weekend.
Still no way to get current position before moving it?
from pyvlx.
@Julius2342 : Have you tried to enable the House Monitor? After that you'll get notifications from time to time and the interface seems to know about the current status, too.
See below a dump of the notification after sending a GW_GET_NODE_INFORMATION_REQ for one of my windows:
2018-11-26 11:34:37: Frame GW_GET_NODE_INFORMATION_NTF
2018-11-26 11:34:37: ActuatorAliases: (2) [[{"AliasType":55298,"AliasValue":25600},{"AliasType":55299,"AliasValue":47616}]]
2018-11-26 11:34:37: NodeID: 4
2018-11-26 11:34:37: Order: 4
2018-11-26 11:34:37: Placement: 4
2018-11-26 11:34:37: Name: Fenster Büro
2018-11-26 11:34:37: Velocity: 0
2018-11-26 11:34:37: ActuatorType: 4
2018-11-26 11:34:37: ActuatorSubType: 1
2018-11-26 11:34:37: ProductType: 54535
2018-11-26 11:34:37: NodeVariation: 0
2018-11-26 11:34:37: PowerSaveMode: 1
2018-11-26 11:34:37: SerialNumber: �S6'&�/
2018-11-26 11:34:37: OperatingState: 5
2018-11-26 11:34:37: CurrentPosition: 51200
2018-11-26 11:34:37: TargetPosition: 51200
2018-11-26 11:34:37: FunctionalPosition1CurrentPosition: 0
2018-11-26 11:34:37: FunctionalPosition2CurrentPosition: 63487
2018-11-26 11:34:37: FunctionalPosition3CurrentPosition: 63487
2018-11-26 11:34:37: FunctionalPosition4CurrentPosition: 63487
2018-11-26 11:34:37: RemainingTime: 0
2018-11-26 11:34:37: TimeStamp: Wed Jan 11 2012 22:05:44 GMT+0100 (Mitteleuropäische Zeit)
BTW: Do you have any idea how to interpret the serial number?
Some other findings I had made:
- GW_GET_LIMITATION_STATUS_REQ doesn't work. I will alway get an invalid frame error. I have tried with several different frame lengths.
- GW_MODE_SEND_NTF and GW_ACTIVATE_PRODUCTGROUP_NTF are in the list of gateway commands but not documented and not received after sending their corresponding request command.
from pyvlx.
hi @MiSchroe !
thank you! I will try out house monitor!
With regards to serial number, i print it out as hex e.g. A1:B2:C3:D4:E5:F6:A6:B8
via ":".join("{:02x}".format(c) for c in self._serial_number)
but i have no idea if this is correct.
Talking about findings, did you notice that other the documentation suggests, the build number is included within GW_GET_NODE_INFORMATION_NTF.
So far, i only implemented the commands i needed to control my windows :-). Will proceed with the others asap.
from pyvlx.
Hi @Julius2342 ,
I think, that the documentation for GW_GET_ALL_NODES_INFORMATION is wrong and that there is no BuildNumber at all. Maybe, this could be your issue.
Here is what I get for both message type for the same window (raw):
2018-11-26 11:34:36: Data received: c0:00:7f:02:04:04:00:04:04:46:65:6e:73:74:65:72:20:42:c3:bc:72:6f:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01:01:d5:07:00:01:1e:53:36:27:26:10:2f:00:81:05:c8:00:c8:00:00:00:f7:ff:f7:ff:f7:ff:00:00:4f:0d:f9:a7:02:d8:02:64:00:d8:03:ba:00:00:00:00:00:00:00:00:00:00:00:00:00:fb:c0
2018-11-26 11:34:36: Frame GW_GET_ALL_NODES_INFORMATION_NTF
2018-11-26 11:34:37: Data received: c0:00:7f:02:10:04:00:04:04:46:65:6e:73:74:65:72:20:42:c3:bc:72:6f:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01:01:d5:07:00:01:1e:53:36:27:26:10:2f:00:81:05:c8:00:c8:00:00:00:f7:ff:f7:ff:f7:ff:00:00:4f:0d:f9:a8:02:d8:02:64:00:d8:03:ba:00:00:00:00:00:00:00:00:00:00:00:00:00:e0:c0
2018-11-26 11:34:37: Frame GW_GET_NODE_INFORMATION_NTF
The only difference is the message type, the time stamp and the CRC byte. Both message come with a length of 0x7F = 127 bytes.
from pyvlx.
Hi @MiSchroe
I added a unit test with your packets and it at least looks sane. While doing so i found several bugs, so thank you very much! :-)
So, what else then the build number should be this byte at position 75? (I start counting within the payload).
Thank you very much for your help!
Julius
from pyvlx.
As you can see at my code I have omitted the build number completely. The structure of the frame seems to be exactly the same like for GW_GET_ALL_NODES_INFORMATION_NTF.
from pyvlx.
Hello @Julius2342 et all. Many thanks for your work and heads up! Not sure when I'll be able to upgrade the FW of the KLF, but I will definitely feedback.
from pyvlx.
@Julius2342 Thanks for updating the library to support the latest firmware. I have installed the firmware and using your updated module now. everything is working as expected. Will do some more testing..
One issue however totally unrelated to your python library, I cannot reach the web interface through LAN after the firmware update, any ideas?
from pyvlx.
The interface can't be opened via LAN with the new firmware, only WLAN.
i think Velux wanted to force me to implement the new API :-)
from pyvlx.
short update on the progress:
the PyVLX is now switching on house-monitor-mode (which is needed to monitor positions of windows). It is also transmitting the current (unix) time (the KLF 200 seems to forget the time after reboot). The missing piece is the updating the internal position within windows, to allow asycronous access e.g. from within HASS.
from pyvlx.
Works like a charm, thanks for the excellent work!
from pyvlx.
Hi,
Regarding maintaining the actual position within the class:
After an operation has been performed a GW_COMMAND_RUN_STATUS_NTF should be sent with the byte "StatusReply = COMMAND_COMPLETED_OK".
When this is OK - you can then request the GW_GET_NODE_INFORMATION_REQ which will return with a GW_NODE_INFORMATION_CHANGED_NTF containing the actual position.
This will update to the latest position when reached, instead of using the status update from the house monitor. Where the node still has to be asked for it's state.
As a sidenote you might want to add the following node type, which is a wall power socket thing:
class OnOffSwitch(OpeningDevice):
if frame.node_type == NodeTypeWithSubtype.ON_OFF_SWITCH:
return OnOffSwitch(pyvlx=pyvlx,node_id=frame.node_id, name=frame.name)
from pyvlx.
First asking and still not find a way to implement and test it :( shame on me @julius.
Pretty sure it will be perfect when I'll find time to test it.
from pyvlx.
@WoodsterDK : my system sends automatically a FrameNodeStatePositionChangedNotification after the nodes have reached a new position. I dont have to request an additional GW_GET_NODE_INFORMATION_REQ. May you verify if this is the case on your system? (I also updated the HASS module, may you also test?).
An On-Off switch would be a different device, not derived from OpeningDevice but from Node. May I ask which product you have in use?
from pyvlx.
Here is the Pull Request within HASS
from pyvlx.
@WoodsterDK : my system sends automatically a FrameNodeStatePositionChangedNotification after the nodes have reached a new position. I dont have to request an additional GW_GET_NODE_INFORMATION_REQ. May you verify if this is the case on your system? (I also updated the HASS module, may you also test?).
An On-Off switch would be a different device, not derived from OpeningDevice but from Node. May I ask which product you have in use?
@Julius2342 Super - I will give it a go - I didn't see you used the notification from the House Status Monitor.
The ON/OFF switch is a VELUX ADAPTER (KRD 100) - 0% equals off -> 100% equals on.
from pyvlx.
I tested the PR branch in HASS, works perfectly. Thanks for the great work! Can't wait to have it merged :)
from pyvlx.
@apeeters : May I ask you to comment this within the PR? :)
from pyvlx.
@Julius2342 done :)
from pyvlx.
Does someone have screenshots/examples on operation in Home Assistant? If I want to test this in a non-HASS install (manual install on Haspbian), what should I do?
from pyvlx.
@pilehave : Follow the steps to set up a dev environment: https://developers.home-assistant.io/docs/en/development_environment.html with this small modification:
git clone https://github.com/Julius2342/home-assistant.git
cd home-assistant
git checkout new-velux-api
python3 -m venv venv
source venv/bin/activate
./script/setup
hass
But i hope my branch gets merged soon fingerscrossed
from pyvlx.
Let's close the issue. If any problems arise with the new API, please open a new issue.
from pyvlx.
Related Issues (20)
- Different venetian blinds are 'open' at different orientation values HOT 2
- Get position while moving a cover HOT 4
- Current position doesn't work HOT 15
- Add outdoor heater functionality?
- Python 3.10: DeprecationWarning: There is no current event loop
- Velux shutter in Home Assistant does not report state "opening" and "closing"
- Incorrect Current Orientation with Somfy Venetian Blind HOT 70
- Pyvlx broken when garage door is in KLF200 HOT 5
- Window opening % reported as 1 instead of 0 when closed (new vasistas) HOT 18
- Controlling ON/Off switches HOT 2
- Release 0.2.17 HOT 2
- Velux component in Home Assistant does not set-up due to timeout. HOT 5
- PYPI release 0.2.17 is not really 0.2.17 HOT 3
- Velux component: asynchronous startup HOT 4
- DEXXO SMART io not working HOT 5
- [Feature request] Support silent mode HOT 4
- Build failure with Python 3.10 HOT 2
- Rain Sensor HOT 55
- pyvlx ssl handshake error 2021.6.0 & 2021.6.1 HOT 10
- Inverted status for awnings HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvlx.