[eBUS 2.0] Configuration support/contribution

Hello @mikulaos,

I checked the sources and found some bugs. I’ve attached a new version, again as zip file. And here a bit modfied version of your configuration.

{
    "id": "custom-vrc700",
    "vendor": "Vaillant",
    "label": "Vaillant VRC 700",
    "description": "Vaillant weather compensating regulation VRC 700",
	
    "authors":      ["Sinisa Mikulandra, mikulandra@inet.hr"],
    "identification": ["37 30 30 30 30"],
	
	"templates": [    
    	{"name":"tempv", "template": [
				{"name": "_unknown", "type": "bytes", "length": "4"},
				{"name": "temp", "type": "float", "label": "%s temperature", "format": "%.1f°C"}
			]
		}
	],	

    "commands":
    [
		{
            "label":    "HWC",
            "id":       "hwc.setpoint",
            "command":  "B5 24",

            "get": {
                "master": [
                    {"type": "static", "default": "02 00 01 00"},
					{"type": "static", "default": "04 00"}
				],
                "slave": [
                 {"type": "template-block", "id":"tempv", "label":"HWC setpoint"}	
				
				]
            }
        }
    ]
}

So you where very close to the correct json file, but your unknown byte must be bytes. And you can’t set a namefor a template block. It is not clear for what value the name is, so the given name will be used.

Download: https://drive.google.com/open?id=1OTga5j0VxOlG8avRJsinWq4TGO8ekaX9


I also added two now console commands to make developers live easier.

Reload all json configuration files

smarthome:ebus reload

Update all Things to reflect the changes to the json configuration files.

smarthome:ebus update

Together with the resolvecommand you can check all on the console

smarthome:ebus resolve "FF 15 B5 24 06 02 00 01 00 04 00 C2 00 08 03 01 04 00 00 00 44 42 DC 00"


Check and unescape telegram
***************************

Original data : FF 15 B5 24 06 02 00 01 00 04 00 C2 00 08 03 01 04 00 00 00 44 42 DC 00
Unescaped data: FF 15 B5 24 06 02 00 01 00 04 00 C2 00 08 03 01 04 00 00 00 44 42 DC 00

Analyse the telegram
********************

FF 15 B5 24 06 02 00 01 00 04 00 C2 00 08 03 01 04 00 00 00 44 42 DC 00
^^--------------------------------------------------------------------- Source address       | Type: Master         | FF
   ^^------------------------------------------------------------------ Destination address  | Type: Slave          | 15
      ^^ ^^------------------------------------------------------------ Command              |                      | B5 24
            ^^--------------------------------------------------------- Master Data Length   | Length: 6            | 06
               ^^ ^^ ^^ ^^ ^^ ^^--------------------------------------- Master Data          |                      | 02 00 01 00 04 00
                                 ^^------------------------------------ Master CRC           |                      | C2
                                    ^^--------------------------------- Slave ACK            |                      | 00
                                       ^^------------------------------ Slave Data Length    | Length: 8            | 08
                                          ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^------ Slave Data           |                      | 03 01 04 00 00 00 44 42
                                                                  ^^--- Slave CRC            |                      | DC
                                                                     ^^ Master ACK           |                      | 00

Resolve the telegram
********************

Found 1 command method(s) for this telegram.

Values from command 'hwc.setpoint' with method 'GET' from collection 'custom-vrc700'
  dummy                = 03 01 04 00
  temp                 = 49.0


Thank you for tools, it will make me live longer :smile:
Have you provided some kind of file inclusion for vendor specific templates or we have to insert templates into every configuration file?

Yes, it called configuration bundle, you can define up to three single json configurations or on configuration bundle in PaperUI. The binding internally use the configuration bundle already. See here

You can see the first entry is the vaillant template json file. The order of the files is important!
Later on you can use it with a template or template-block in another file. In this case you need the global id with following format collectionId.commandId for template-block and collectionId.commandId.valueName for template.
In the example above this is vtempl.temp_sensor for a template-block.

Global template system is working fine on my system.
New datatype works ok, on both getter and setter comamnds.
smarthome:ebus reload works
smarthome::ebus update doesn’t work for me. It says true for Refreshed?, but I still need to delete and add thing manually
If I run smarthome::ebus update again, then all Resreshed? are false.

Vaillant templates and VRC 700 configuration are in progress. I’m short of time right now but it could be finished next week.

Cheers

1 Like

Thank you for your feedback and that you want to improve the binding for vaillant.
I must ask some oh2 experts how to refresh things.

Hello @lukics,

I moved your configuration file for Wolf CWL to this thread. I hope you can see the system, simply replace the values.
You should have a look in the ebusd mapping table https://github.com/csowada/ebus/blob/master/de.csdev.ebus/doc/ebusd-mapping.md

{
    "id":           "cwl",
    "vendor":       "Wolf",
    "label":        "Wolf CWL",
    "description":  "Wolf CWL 300/400",
    
    "authors":      ["Christian Sowada, opensource@cs-dev.de"],
    "identification": ["08 16 00 22 03"],
    
    "commands":
    [
        {
            "label":    "Temperature Inside",
            "id":       "ac.temp_inside",
            "command":  "40 22",

            "get": {
                "master": [
                    {"type": "static", "default": "07"}
                ],
                "slave": [
                    {"name": "temp_inside", "type": "int", "label":"Temperature Inside", "reverseByteOrder": true, "factor": 0.1, "min": 1, "max": 60, "format":"%.1f°C"}   
                ]
            }
        },
        
        {
            "label":    "Temperature Outside",
            "id":       "ac.temp_ouside",
            "command":  "40 22",

            "get": {
                "master": [
                    {"type": "static", "default": "08"}
                ],
                "slave": [
                    {"name": "temp_ouside", "type": "int", "label":"Temperature Outside", "reverseByteOrder": true, "factor": 0.1, "min": -60, "max": 100, "format":"%.1f°C"}   
                ]
            }
        }
    ]
}

Hello all, here I am with some update for @csowada.
I translated all templates needed for vrc700 and most of commands. Unfortunately, huge amount of time was spent on reloading binding and recreating thing for testing configuration.
Your reload and update tools are awesome, but don’t work every time (please, please fix it :slight_smile: ) so I decided to restart openhab after every couple of commands. After reloading binding only, sometimes new added thing is not visible in paperui.
I will try to finish it tommorow.
Is it ok to drop “label” in set method? Is it used anywhere?

Today I have noticed the following:

In my template name for dummy is “_unknown”, but in generated channel id-s there is “-unknown”. Is it a bug?
Binding is also polling all #-unknown channels, linked and unlinked!?!

00:48:36.474 [INFO ] [nhab.binding.ebus.handler.EBusHandler] - Poll command "ebus:vrc700:e833775c:vrc700_gen_frost-override-time#-unknown" with "FF 15 B5 24 06 02 00 00 00 03 00 6B" ...
00:48:36.475 [INFO ] [nhab.binding.ebus.handler.EBusHandler] - Poll command "ebus:vrc700:e833775c:vrc700_gen_frost-override-time#value" with "FF 15 B5 24 06 02 00 00 00 03 00 6B" ...

Hello @mikulaos,

I quickly checked the refresh in my develop environment and it looks good so far. Do you use both commands after each other? The first one reloads the configuration and the second one updates the things.

smarthome:ebus reload
smarthome:ebus update 

The other bugs are easier to fix if I know your configuration files. Could you send me your log when the refresh/update fails.

Ok, I’ll finish and send you files. Please tell me is “label” in setter optional?. Thank you.

Never tried, but I think it is not required.

After placing a new json file in the config directory which in defined in paper ui binding configuration:
image

How do I refresh/restart in order to see new channels in the thing(s).

I tried:

  • deleting bridge+thing
  • restarting the binding in karaf
  • restarting and deleting bridge+thing

no success

@lukics

You should use both commands on the karaf console, the first one reloads all files and the second one should refresh your things. But @mikulaos wrote that this is maybe not working well. If this is not working, could you attach your log.

But this works only with the latest snapshot from here, there is currently no new alpha available.
https://drive.google.com/open?id=1OTga5j0VxOlG8avRJsinWq4TGO8ekaX9

dropping the 3 files into addon folder?
after removing the original binding.

Yes, that is right right

Works perfect, thanks

Hello @csowada
template file for vaillant and configuration file for VRC700 are done. There is more work to do, but here is what have been done so far:
https://drive.google.com/open?id=1_26-NMtESby3t8sFwKz6KVU5bY6r45Ia
Now I need you to help me finish it.

Configuration file is very large .There is 180 command blocks, and it loads more than 10 seconds on my Pi. That’s why I had a problem with the update tool.
Rarely who will use all the commands, so it would not be bad to make one more file for the most commonly used setup (one heating circuit, one zone, hot water and circulation) or split the configuration into multiple files, so can be used in bundle only as needed.If a large file is to be used, maybe it can be better arranged because it has a lot of repetition (9 groups for 7 days of timer, 2 zones, 2 heating circuits).
Which would be the best choice? And is bundle limited by number of files?

My Vaillant template file contains only the templates that were needed to complete the vrc700 configuration. When everything is done, I will be happy to add the rest.

Around this things I need help:

For channels that use templates b5.hfrom and b5.hto the telegram is resolved and the method is found, but an error occurred. The example below is an error when the date is 30.04.17

12:05:28.970 [INFO ] [nhab.binding.ebus.handler.EBusHandler] - Poll command "ebus:vrc700:8e673baf:vrc700_gen_holiday-start#value" with "FF 15 B5 24 06 02 00 00 00 71 00 58" ...
12:05:29.027 [DEBUG] [de.csdev.ebus.core.EBusController    ] - Send: FF 15 B5 24 06 02 00 00 00 71 00 58 @ 0. attempt
12:05:29.168 [DEBUG] [de.csdev.ebus.core.EBusController    ] - Succesful send: FF 15 B5 24 06 02 00 00 00 71 00 58 00 07 03 00 71 00 1E 04 11 41 00
12:05:29.172 [ERROR] [de.csdev.ebus.core.EBusControllerBase] - Error while firing onTelegramReceived events!
java.lang.ArrayIndexOutOfBoundsException: 3
        at de.csdev.ebus.command.datatypes.ext.EBusTypeDate.decodeInt(EBusTypeDate.java:110) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.datatypes.ext.EBusTypeDate.decodeInt(EBusTypeDate.java:1) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.datatypes.EBusAbstractType.decode(EBusAbstractType.java:100) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.EBusCommandUtils.decodeValueList(EBusCommandUtils.java:374) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.EBusCommandUtils.decodeTelegram(EBusCommandUtils.java:426) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.service.parser.EBusParserService.onTelegramReceived(EBusParserService.java:94) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.core.EBusControllerBase$2.run(EBusControllerBase.java:102) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

And telegram for 01.05.17. also fires same error:

FF 15 B5 24 06 02 00 00 00 71 00 58 00 07 03 00 71 00 01 05 11 F3 00

Next error I get using b5.from and to (TTM). In case the time slot for timer is not set, vrc700 sends a value of 90 90 90 90 representing the next midnight. Binding does not want to use this value or I am missing something. Here is example:

12:49:17.299 [INFO ] [nhab.binding.ebus.handler.EBusHandler] - Poll command "ebus:vrc700:8e673baf:vrc700_hwc_timer-mon#from2" with "FF 15 B5 24 05 03 01 00 01 00 4E" ...
12:49:17.370 [DEBUG] [de.csdev.ebus.core.EBusController    ] - Send: FF 15 B5 24 05 03 01 00 01 00 4E @ 0. attempt
12:49:17.526 [DEBUG] [de.csdev.ebus.core.EBusController    ] - Succesful send: FF 15 B5 24 05 03 01 00 01 00 4E 00 07 01 21 8A 90 90 90 90 13 00
12:49:17.532 [ERROR] [ebus.service.parser.EBusParserService] - error!
de.csdev.ebus.command.datatypes.EBusTypeException: Value 'minutes since midnight' to large!
        at de.csdev.ebus.command.datatypes.ext.EBusTypeTime.decodeInt(EBusTypeTime.java:111) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.datatypes.ext.EBusTypeTime.decodeInt(EBusTypeTime.java:1) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.datatypes.EBusAbstractType.decode(EBusAbstractType.java:100) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.EBusCommandUtils.decodeValueList(EBusCommandUtils.java:374) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.command.EBusCommandUtils.decodeTelegram(EBusCommandUtils.java:426) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.service.parser.EBusParserService.onTelegramReceived(EBusParserService.java:94) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at de.csdev.ebus.core.EBusControllerBase$2.run(EBusControllerBase.java:102) [213:de.csdev.ebus.ebus-core:0.9.16.SNAPSHOT]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]

The next thing to look at is that the binding always do polling of all the channels, regardless of whether they are linked or not and so clog the bus. Channels used for “dummy” values are being polled also. Can “_unknown” poll and unlinked poll be omitted? Here is example: two identical telegrams to retrieve one value

00:45:45.795 [INFO ] [nhab.binding.ebus.handler.EBusHandler] - Poll command "ebus:vrc700:8e673baf:vrc700_gen_time#-unknown" with "FF 15 B5 24 06 02 00 00 00 35 00 51" ...
00:45:45.801 [INFO ] [nhab.binding.ebus.handler.EBusHandler] - Poll command "ebus:vrc700:8e673baf:vrc700_gen_time#value" with "FF 15 B5 24 06 02 00 00 00 35 00 51" ...

Next, please look at hwc.timer_mon for example. Currently, the command creates 6 channels with the same label. Is it possible for each of the channels to get a value name from the template in their label ?

It’s all for now. I will continue after the response. Thank you.

1 Like

Wow, great work. That is awsome that you have translated the commands.

I’m busy on saturday, but I will try to check you issues in the evening.

Hello @mikulaos,

I’ve checked the sources and fixed two issues, see list below. I thing you should split the configuration into heating, aircondition, solar etc. I will also add a new flag to mark advanced configurations, so Paper UI would only link non-advanced commands. I hope I find time this weekend to fix your other issue.

Download: https://drive.google.com/open?id=1-jdPlqaesrC7kgSaNmNlWHtnh0RExrKT

Sorry, no more time this evening!


Should be fixed with this version.

Should be fixed with this version. Please use variant -> minutes_short for ebusd TTM, TTH and TTQ datatype.

@mikulaos,

the new time variant minutes_short is not working with 0x90 values at the moment! So many special cases for vaillant!

No more errors on TTM, that’s progress :slight_smile:

For this telegram, representing 05:30-23:00 and two empty slots

FF 15 B5 24 05 03 01 00 01 00 4E 00 07 01 21 8A 90 90 90 90 13 00

this is output in my paperui (without formatting)

01.01.1970 00:33:00

31.12.1969 22:02:00

31.12.1969 22:08:00
31.12.1969 22:08:00
31.12.1969 22:08:00
31.12.1969 22:08:00

using this kind of templates

{"name": "from1", "type": "time", "variant": "minutes_short", "minuteMultiplier": "10"}

Changing multiplier also don’t change value!

On the other hand, b5.hfrom and b5.hto (HDA:3) is now working fine.

I’m currently working on separating configuration files and waiting for your update. I hope you will soon find time to review other issues. Most disturbing is polling of unlinked channels. Thank you