-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Secant Cardio IIè Home Automation Central Unit RS-232 integration #151
Comments
From kai.openhab on November 19, 2012 14:15:50 Have a look at http://code.google.com/p/openhab/wiki/HowToContribute We currently do not have specific documentation on how to implement a binding - for the moment the best way is therefore to have a look at how other bindings work and learn from it. Feel free to ask questions in the forum. |
From [email protected] on November 21, 2012 00:58:16 O.K. P.D. I attached Secant Cardio RS-232 ASCII protocol specs doc. Attachment: Cardio-Communication-Protocol-Secant-2-Rev-1-0-En-2.pdf |
From [email protected] on November 21, 2012 23:36:16 Excuse me. My English is not the good enought. I had a look at openhab code, and I didn't know how to start encoding binding. |
From kai.openhab on November 24, 2012 13:13:54 Thomas is working on a Maven archetype, which creates a binding skeleton as a starting point for a new binding. Furthermore we will work on a wiki page that explains the main points about writing a binding. If you can wait for a few more weeks, these things might help you to get a start. |
From [email protected] on November 25, 2012 23:11:19 That is great! |
From teichsta on April 30, 2013 07:52:39 fyi: the maven archetype is available meanwhile. See http://code.google.com/p/openhab/source/browse/bundles/archetype/org.openhab.archetype.binding/README.txt for details who to use it. |
From [email protected] on May 08, 2013 02:20:55 I can not build the maven archetype. The openHAB version in mercurial repository is 1.3.0-SNAPSHOT, and maven metadata found is for 1.2.0-SNAPSHOT. |
From teichsta on May 21, 2013 14:29:24 Owner: --- |
From [email protected] on June 25, 2013 00:56:21 I can still not build binding. Attachment: mvn archetype generate error log.txt |
From teichsta on June 25, 2013 11:39:56 i updated the version of the pom and removed the hardcoded bundle-version in MANIFEST.MF could you try again? you should also use an capitalised binding name, since this name is used to generate the new classes. The get's lowercased where it's needed. The call should look like this (after installing the artifact to your local mvn repository). mvn archetype:generate -B -DarchetypeGroupId=org.openhab.archetype -DarchetypeArtifactId=org.openhab.archetype.binding -DarchetypeVersion=1.3.0-SNAPSHOT -Dauthor="Manuel Alberto Guerrero Díaz" -Dversion=1.3.0 -DartifactId=org.openhab.binding.cardio2e -Dpackage=org.openhab.binding.cardio2e -Dbinding-name=Cardio2e -X -e Hope this helps, Thomas E.-E. |
From [email protected] on June 26, 2013 05:02:39 Thanks for your answer. Attachment: mvn archetype generate error log 2.txt |
From teichsta on June 26, 2013 05:55:23 hm, that works me. Did you issue an "mvn clean install" in the directory: /openhab/bundles/archetype/org.openhab.archetype.binding |
From [email protected] on July 10, 2013 03:21:57 Sorry. Excuse me, but I still can not to build archetype. I attached last error log. Attachment: mvn archetype generate error log 3..txt |
From teichsta on July 10, 2013 05:43:02 Please follow the following steps:
|
From [email protected] on October 08, 2013 06:04:19 Excuse me. I had a lot of job and can not do a new try before. I exactly did wiki instructions in a clean new OpenSuSE 12.3 x64 virtual machine with Oracle Java 1.7.0u40 JDK, lasted Yoxos 5.6 openHab Eclipse IDE and lastest Maven 3.1.0 installed. I surrender. Can not build archetype. And I cannot attach lastest mvn archetype generate error log: Issue attachment storage quota exceeded. |
From kai.openhab on October 12, 2013 12:39:40 Try now with the very latest version on GitHub and version 1.4.0-SNAPSHOT - I have just pulled a change to fix the archetypes: #37 |
From teichsta on November 05, 2013 14:47:54 Labels: To-Github |
Thank you for reopen te issue. |
Generation sucessfully!!! Thank you at all!! Next step: to write the binding... [INFO] ------------------------------------------------------------------------ |
Whats the state of this binding? Have you made any progress? |
since there were for more than one year i'd like to close this issue soon … |
Sorry. I have had no time to develop the binding. I'm sketched the schema of the class that it should encode / decode the RS-232 stream, but I don't have a finish date. If you must to close... O.K. I will understand. When the main classes will be completed, I will contact you again to resume binding, and then I will ask for you help to complete binding. Thank you very much for your patience. |
On the other hand , if another contributor who has time can program the code , I could collaborate doing necessary testing and final adjustments. |
Some progress... |
More progress... |
Reinstalled everything (OS/openHab2/compatibility/etc) I added the conf elements. Everything seems to load (no habla Espanol ;-) and I'm not getting any errors. How do I know if the binding loads properly, as I believe the binding won't show under Paper UI? |
Sorry for the inconvenience. The demo is based on an extract from my openhab config. The descriptions are in Spanish because I have not had time to translate it. However, it is only a example. Yesterday even, in the hurry, I put part of my message in Spanish, and when I realized, I edited it to translate it. :-D About binding messages: if you change the value of an item assigned to the binding (example off -> on) an error should appear in the log if Cardio is not connected or login failed. And if it is connected, and the installer code setup is correct, "Cardio 2é login suceed" and other messages should be displayed indicating that commands are being sent to Cardio send queue. It seems that the level of detail of the openHab 2 log is reduced by default. In openHab 1, in debug mode, you can see messages from the binding indicating the values read from openhab.cfg and other initialization messages. I would like more time to fine-tune all these details. But everything will come. I intend to finish it as soon as possible. Thanks for your patience. P.D.: You can list binding status typing "bundle:list" in the Karaf console (see http://docs.openhab.org/administration/bundles.html) |
No worries. I can see from your code that you have put a lot of effort into this. I will test this later. Thanks!
… On May 17, 2017, at 2:24 PM, Manuel Alberto Guerrero Díaz ***@***.***> wrote:
Sorry for the inconvenience. The demo is based on an extract from my openhab config. The descriptions are in Spanish because I have not had time to translate it. However, it is only a example. Yesterday even, in the hurry, I put part of my message in Spanish, and when I realized, I edited it to translate it. :-D
About binding messages: if you change the value of an item assigned to the binding (example off -> on) an error should appear in the log if Cardio is not connected or login failed. And if it is connected, and the installer code setup is correct, "Cardio 2é login suceed" and other messages should be displayed indicating that commands are being sent to Cardio send queue.
It seems that the level of detail of the openHab 2 log is reduced by default. In openHab 1, in debug mode, you can see messages from the binding indicating the values read from openhab.cfg and other initialization messages.
I would like more time to fine-tune all these details. But everything will come. I intend to finish it as soon as possible.
Thanks for your patience.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
success. console reports:
|
I have install openHAB2, put the jar in the addon folder then next? |
Hi JP, Install the 1.x compatibility layer by running feature:install openhab-runtime-compat1x in the openHAB console Second step:
the jar goes into /usr/share/openhab2/addons/ and needs ownership to be changed:
you can disregard the other files. download the other zip file in this thread: OH2_demo_conf.zip decompress and (I used) rsync to synchronize the files/folders to /etc/openhab2/ chown the moved files recursively (chown -r …) stop and restart the openhab service go back to the openhab console:
you should now see logs showing up for the binding. If there are no errors related to the binding then you are good to go. Under the BasicUI, you should now have access to magd’s project. you will need to use Eclipse Home designer to edit the config files to match your home setup, serial port setup, cardio installer codes, etc.. |
Success part 2:
I'm in. Now I need to figure out all my phisical devices. |
Hello, Eric. |
Hi, |
Hello, JPCoollink. The only part that is in Spanish is the openHAB config, because the demo is based on an extract from my openhab config. The descriptions are in Spanish because I have not had time to translate it. Inside this demo you can find some examples from lighting control (switch and dimmer), simple relay control, pair of relays shutter control, HVAC, zones detection, security... Postdata: The class responsible for processing the configuration of the items is https://github.com/magd1978/openhab1-addons/blob/cardio2e-binding/bundles/binding/org.openhab.binding.cardio2e/src/main/java/org/openhab/binding/cardio2e/internal/Cardio2eGenericBindingProvider.java |
Manuel, I've got it working. Playing with the sitemap and figuring out all the 60 dimmers. (yes, 60). Thanks for this again! |
Hi, ericc514. I am glad that my contribution has been useful. I would like more time to complete the changes I have pending and to write all the documentation. Sorry for the wait. I'm on it... Here's a Secant manual with the Cardio RS-232 prococol: The manual does not contain references to the new COURTAIN objects used in the latest Cardio firmwares. These COURTAIN objects allow blind height management using specific Secant controllers connected to the Cardio RS-485 bus (like the dimmers). I could determine that its syntax is analogous to LIGHTING objects using a sniffer on the RS-232 port. On the other hand ... wow! 60 dimmers! But if you want to do it with openHAB, you can add all the dimmers to an active group like the "Luces" group of the demo that I uploaded, and send commands to that group. The problem is that the Cardio RS-232 communication is slow (9600 bps.), half duplex, and also has no flow control. For each LIGTHING transaction sent, the Cardio responds with an ACK message and an INFO message (or a NACK if it could not execute the command). And for the duration of the response it does not accept new orders. That is why there is a buffer of transactions to be sent and a minimum delay between each transaction received and a new sending, and a minimum delay between two sendings. All this is designed to await the Cardio's answers before giving it new orders. Still, if you send many orders in a row, you run the risk of colliding with an ACK or INFO response, so the Cardio could ignore some of the orders sent. So I've been thinking about implementing an improvement that checks receiving data at every step of the sending process. These checks would allow postponing (and even repeating) sending if any information is received during execution of this part of the code. Anyway, if you are going to handle so many dimmers, these settings may help you in the binding configuration: To avoid sending values to the dimmers if they match the current values (for example, if dimmer #27 is at 86% and a command is received from the openHAB bus that asks to put this same dimmer at 86%, it will not be sent any transaction to the Cardio, because the dimmer already has that value). To avoid adding to the sending buffer contradictory LIGHTING transactions to those that are pending to be sent (for example, if there is a pending transaction to send to the dimmer #42 with the value 50% and a command is received from the openHAB bus requesting to put to this same dimmer to 100%, the existing transaction with 50% value will be eliminated and the new one with 100% value will be added). |
Hi Manuel, I just remembered that functions like "All lights off" can be programmed directly into the Cardio with scenes (scenarios?), so I'll look into configuring that instead. That way I send only one command and let the box figure it out. |
Hi Manuel,
according to the communication protocol this should send '@s M 2', no? If I'm understanding this correctly, your base scenario state is starting at 0 instead of 1. (there is no state 0 for scenarios on the cardio) Could this be because it's defined as a switch under OH1? Let me know if I'm not clear, it's late here in Montreal. ;-) |
Also, I am assuming this is because my openhab entries don't match the cardio's hard-coded entries. correct? no worries, it works, it just fills up the logs. |
Hi Eric. In Spain we have 6 hours of difference. Now it's 1:00 p.m. here. It is right. To call Cardio scenarios 1 to 42 you must use values 0 to 41. This is to maintain compatibility with the values used on the KNX bus (DPT18.001), where values 0 to 63 are used to call scenes 1 to 64. You see ... When I started working on Cardio IIé binding, my initial goal was to be able to extend the installation with KNX. That is why I have tried to make the values used compatible. As for the message "No state sent to Cardio 2è because item is not configured as 'reverse mode'", you can ignore it. It only appears in debug mode. The Cardio binding can be configured so that certain objects of the Cardio operate in inverse mode (using Cardio as a control instead of actuator). Example: you can control the power on of your openHAB TV by defining an item connected to the appropriate binding, and also add an unused RELAY object from the Cardio in reverse mode (you must write "!RELAY", with the "!" symbol in front, instead). So that when the Cardio binding receives an INFO transaction, a command is sent to the openHAB bus, and when a status is received from the openHAB bus, it is sent to the Cardio as a command. So, the message "No state sent to Cardio 2è because item is not configured as 'reverse mode'" simply tells you that the status of the item will not be forwarded to the Cardio because the configuration of the object has not been defined as reverse mode. In this case it must be the same state sent to the openHAB bus by the Cardio binding which arrives back from the bus and is ignored. |
Got it. Thanks Manuel. |
Hello. Here you are a new JAR compilation of the binding. New anti-collision and verification improvements in communications are implemented. They are still pending some changes requested by the openhab community. I hope you will be useful while I finish the final version. |
Working on a Cardio2e binding config guide. |
Hi, 2017-10-03 04:04:46.434 [INFO ] [ng.cardio2e.internal.Cardio2eBinding] - Serial port set from config file: /dev/ttyS0 |
Hello JPCoollink. As I see it, the binding open the serial port ("Cardio is CONNECTED") but it does not get to do login (there is no "Cardio login succeed" in the log). Please, check wiring and installer program code. I have tested the binding with openHAB1 running on a RaspBerry 1B, and with openHAB1 and openHAB2 running on a PC (Windows and Linux). The RS-232 interface used in testing is a USB adapter with Prolific PL-2303 chip. Can you give me some more information about the hardware you use? Please do not activate the "testmode" option. This option is for internal developer use only. The binding will never communicate with the Cardio with this option enabled. I am writing a binding configuration document, which is not yet finished. I will attach a fragment as an advance to help you with the configuration: |
It is working now, i was able to add slider to control my lights.
thank you |
Hi, JPCoollink. I am glad that you have finally been able to solve the problem of communication with the Cardio. I'm sorry, but I can not help you with the HomeKit setup. I have not had a chance to try it. But there should be no differences with examples with other binding integrations. As I told you yesterday, I am writing a binding configuration document, which is not yet finished. I will attach another fragment as an advance to help you with the configuration of the item: |
Closed via merged PR. |
Hi, I've this binding working very well in a centos7 box, but I'm try'ing to get it to work on a raspberrypi. In the raspberry I've this error: 2018-09-06 22:06:43.561 [INFO ] [ng.cardio2e.internal.Cardio2eBinding] - Serial port set from config file: /dev/ttyAMA0 Can you help? Best Regards, |
Hi, Fernando. I am pleased to inform you that the binding has already been approved, and if everything goes well, it will be officially available in openHAB 2.4. You can check the configuration guide in https://www.openhab.org/addons/bindings/cardio2e1. If 'Cardio login suceed' does not appear in the log, it is that no login confirmation has been received from Cardio. This can occur because of a configuration error, or because of problems with the serial port or wiring. My tests with this binding were done on a Raspberry Pi 1B and also on a Raspberry Pi 3B. And in both cases I connected by a Prolific PL-2303 based USB to RS-232 converter interface. On the other hand I do not see that you have set the 'programcode', so the binding will use the default code that is '00000'. If your Cardio has set a different code, you have to specify it in the binding config file. If with these indications you do not manage to make it work, it would be good to adjust the binding log to the 'DEBUG' level, and thus obtain more information of what is being able to fail. To do this, enter 'log: set DEBUG org.openhab.binding.cardio2e' in the Karaf console (see https://www.openhab.org/docs/administration/logging.html#defining-what-to-log). Best Regards, |
Hi, Thanks a lot for you anwser. I had configured with "dtoverlay=pi3-miniuart-bt", but I managed get it work with: enable_uart=1 I need the core_freq=250, otherwise I had problems in the communication. Best Regards, |
From [email protected] on November 19, 2012 13:30:10
Original issue: http://code.google.com/p/openhab/issues/detail?id=151
The text was updated successfully, but these errors were encountered: