Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the same capability more than once #41

Open
rnldnkp opened this Issue Jan 19, 2018 · 15 comments

Comments

Projects
None yet
9 participants
@rnldnkp
Copy link

rnldnkp commented Jan 19, 2018

For a normal app you state:

Using the same capability more than once

In certain cases it might occur that a device should use a capability more than once. An example would be a device with an outside and inside temperature sensor. Simply append a dot followed by an identifier after the capability string during in your driver, e.g. measure_temperature.inside & measure_temperature.outside.

https://apps.developer.athom.com/tutorial-Drivers-Capabilities.html

However, this does not seem to work with this library. the ".name" gets ignored and just overwrites the first capability type.

As far as I can see in the documentation there is no other way to name a capability on the Arduino. The example codes do not have this challenge since all of them are unique.

Could you explain if it should work with this library or would this be a feature request?

Thanks

@gn0st1c

This comment has been minimized.

Copy link

gn0st1c commented Mar 17, 2018

any news on this issue?

(i just run into this problem when i was coding for my sonoff dual, which has two onoff capability)

@renzenicolai

This comment has been minimized.

Copy link
Contributor

renzenicolai commented Mar 23, 2018

I am currently busy with my graduation internship, because of this I do not have time to look any further into the issue you are experiencing.

(My internship at Athom has ended over a month ago...)

@renzenicolai renzenicolai removed their assignment Mar 23, 2018

@magtimmermans

This comment has been minimized.

Copy link

magtimmermans commented Apr 2, 2018

Same here,
Homey.addCapability("measure_temperature.outside");

is not working. Could someone from Athom fix this?

@taligentx

This comment has been minimized.

Copy link

taligentx commented Jul 9, 2018

This would be a useful feature for better integration with home security systems. For example, DSC security systems support multiple partitions, each of which has its own set of status states (armed/disarmed/triggered, etc) that would need to be mapped to the homealarm_state capability.

At the moment, it seems that only one partition can be exposed to Homey using this library.

@prj84

This comment has been minimized.

Copy link

prj84 commented Aug 4, 2018

This needs a fix! I have it all working in SmartThings and this is one og two issues stopping me from a 100% conversion. I have four relays needed to be controlled as four different switches. It is controlling a ventilation system.

@rnldnkp

This comment has been minimized.

Copy link
Author

rnldnkp commented Aug 4, 2018

@jeroenvollenbrock could you assign someone who currently works for Athom? Renze is no longer available he says and he removed his assignment.

Thanks

@gn0st1c

This comment has been minimized.

Copy link

gn0st1c commented Aug 6, 2018

the problem is when you define a capability/action it creates a function and web endpoint with that name. since identifier can only consist of letters, digits or underscore, using anything else (dot or space etc) causes the issue.

my simply/fast hack solution was use the upper case X instead of . (dot).
then when needed replace it back;

	s->print(",\"api\":[");
	HomeyFunction *item = firstHomeyFunction;
	while (item != NULL) {
		s->print("{\"name\":\"");
		String fooname = item->name;
		fooname.replace("X", ".");
		s->print(fooname);

...

		for (;position<_request.endpoint.length();position++) {
			if (_request.endpoint.charAt(position) == '/') break;
		}
		String type = _request.endpoint.substring(0, position);
		String name = _request.endpoint.substring(position+1);
		name.replace(".","X");

...

	/* Execute request */
	CLIENT_TYPE client;
	if (client.connect(_master_host, _master_port)) {
		String fooname = name;
		fooname.replace("X", ".");

		client.print("POST /emit/");
		client.print(evType);
		client.print('/');
		client.print(fooname);
@konradwalsh

This comment has been minimized.

Copy link

konradwalsh commented Aug 10, 2018

@gn0st1c can you confirm where you made these changes so I can copy?

@gn0st1c

This comment has been minimized.

Copy link

gn0st1c commented Aug 11, 2018

@konradwalsh: sorry, i didn't get notice for the mention. (maybe because you edited the comment).
i'll fork these repos and apply my patches. i'll let you know when i'm done.

cheers,

@gn0st1c

This comment has been minimized.

Copy link

gn0st1c commented Aug 11, 2018

@konradwalsh

This comment has been minimized.

Copy link

konradwalsh commented Aug 11, 2018

@gn0st1c very kind of you.. thanks

@prj84

This comment has been minimized.

Copy link

prj84 commented Oct 3, 2018

Hi!
I tried @gn0st1c fork, but is still not able to add multiple capabillities. Has anyone else had success?

@Swiftnesses

This comment has been minimized.

Copy link

Swiftnesses commented Nov 25, 2018

Would love to get this working, has anyone had any luck?

@Swiftnesses

This comment has been minimized.

Copy link

Swiftnesses commented Nov 25, 2018

@gn0st1c I tried your changes to the homey.cpp file but had no luck? Any advice, I noticed your fork is no longer there?

@Swiftnesses

This comment has been minimized.

Copy link

Swiftnesses commented Feb 12, 2019

Earth to @WeeJeWel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.