[eBUS 2.0] Configuration support/contribution

Okay, here a unsupported test release in the new kar format, I hope it works on your systems.
My current work is focused on the release preparation. I’m working on an automatic deployment for the ebus core lib.

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

If it works you should try the new global template system. You could try to adapt the ebusd templates. Here an example that is part of the last version.

https://github.com/csowada/ebus/blob/master/de.csdev.ebus/src/main/resources/commands/vaillant-templates.json

Yes, it works with my current config! I will start adapting templates. Thank you!

What is name (key) of new datatype?

The Name for the new data type is
float

Today I tried to load simple configuration file to test is it possible to read new data type in my setup. It failed. After that I stopped opehnab service, cleared /var/lib/openhab2/cache and /var/lib/openhab2/tmp and started service again.
After that ebus binding is no longer visible in openhab.
Openhab is 2.2.0 running on Ubuntu 16.04. ebus-distro-0.9.16-SNAPSHOT.kar is in /opt/openhab2/addons and kar:list says it is installed.
What am I doing wrong?

Here is test 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"],

    "commands":
    [
		{
            "label":    "DHW",
            "id":       "dhw.setpoint",
            "command":  "B5 24",

            "get": {
                "master": [
                    {"type": "static", "default": "02 00 01 00"},
					{"type": "static", "default": "04 00"}
				],
                "slave": [
                    {"name": "unknown", "type": "float", "label": "unknown", "format":"%.1f°C"},
					{"name": "dhw.setpoint1", "type": "float", "label": "dhw setpoint", "format":"%.1f°C"}
				]
            }
        }
    ]
}

You could try

feature:install openhab-binding-ebus

But I’m also new to kar format. I have the same problem here.
I have attached a zip file with all required files, extract the three files to addons dir. It is the same version as the kar file.

https://drive.google.com/open?id=10dSxb0hl-3LQV2-6PzEcmUJJKRNKfIig

If you have installed your custom configuration you can use the console command

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"

to check you configuration file. If you re-save the eBUS binding configuration in Paper UI it should reload the configuration files.

And in general you configuration file looks good, but I’ve not time to test it today.

After placing those three .jar into addons, binding works.
It can resolve test telegram and data conversion is OK. After loading test configuration (2 posts before) and creating thing in paperUI it is visible and reading correct value for new data type!

Problems started when I tried to adopt test configuration to use template.
This is test configuration with template:

{
    "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":"b5.tempv", "template": [
				{"type": "byte", "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":"b5.tempv", "name":"hwc_setpoint", "label":"HWC setpoint"}	
				
				]
            }
        }
    ]
}

After restarting of binding, configuration is listed in new things page, but can’t be configured and added.
This is from openhab.log:

2018-01-11 12:07:36.901 [WARN ] [ebus.cfg.std.EBusConfigurationReader] - Property 'name' is not allowed for type 'template-block', ignore property !
2018-01-11 12:07:36.908 [ERROR] [dev.ebus.command.EBusCommandRegistry] - error!
de.csdev.ebus.cfg.EBusConfigurationReaderException: Unable to find a template-block with id b5.tempv!

I could make configuration file without using templates, but it would be wrong approach so please help.

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