This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Homey Tokens.
nklerk
Member
in Developers
Hi All,
I'm struggling with tokens. I found out how to register and unregister tokens but i could not find a way to read or set a token.
I'm now setting a token by unregistering and registering a token. is this the way to go?
I'm struggling with tokens. I found out how to register and unregister tokens but i could not find a way to read or set a token.
I'm now setting a token by unregistering and registering a token. is this the way to go?
function settoken(token_id, token_name, token_type, token_value){ Homey.manager('flow').unregisterToken(token_id); Homey.manager('flow').registerToken(token_id, { type: token_type, title: token_name }, function (err, token) { if (err) return console.error('registerToken error:', err); token.setValue(token_value, function (err) { if (err) return console.error('setValue error:', err); }); });}
Thanks in advance
Comments
I hope it at least gives you an smile