Thanks- that solves the problem!
NEWS
Best posts made by Taragorm
Latest posts made by Taragorm
-
RE: using iobroker.socket-client in a NodeJs project
@bluefox The API seems straightforwards enough; a couple of questions though:
- How do I unsubscribe? - I didn't see a command for that
- Can I do a "Bulk" subscribe - i.e. ask for a list of states?
-
RE: using iobroker.socket-client in a NodeJs project
@bluefox So you suggest the REST interface? - I'll go with that then. The app will likely be running on the same machine as ioBroker, anyhow.
-
RE: using iobroker.socket-client in a NodeJs project
@alcalzone That was my assumption.
Is there a NodeJs version?
I can always use the basic REST interface, but it wouldn't be my first choice here...
-
using iobroker.socket-client in a NodeJs project
Hi, I'm in the process of writng a NodeJs project that will talk to IOBroker.
According to npm:
@iobroker/socket-client@1.1.14
when I try to create a connection, I get:
ReferenceError: window is not defined at P:\Projects\Vue\logik\logik-backend\node_modules\@iobroker\socket-client\dist\cjs\Connection.js:123:7 at new Promise (<anonymous>) at Connection.waitForSocketLib (P:\Projects\Vue\logik\logik-backend\node_modules\@iobroker\socket-client\dist\cjs\Connection.js:122:34) at new Connection (P:\Projects\Vue\logik\logik-backend\node_modules\@iobroker\socket-client\dist\cjs\Connection.js:87:10)
As I understand it, this happens because "window" is not defined in NodeJS projects [I am by no means an expert JS programmer, btw]
So.
Is this the right library for the job?
Does it in fact support Node?
Am I missing some bit of initialisation to create a suitable "window" object under node.Hints appreciated.
-
Visualisation setup logic
Hi, I'm contemplating including webhosting hub gylphs in a visualisation, see:
https://www.webhostinghub.com/glyphs/
But their license doesn't allow redistribution, so I was contemplating running some JS at startup to download the font, and (re-)install as required.
Can I just add this code to main.js?
Or is there some better way to do it?
-
RE: getting started with visualisations
In case it's not obvious, I'd like a widget to be able to generate oids based on, or relative to, an oid in an attribute, and have the object correctly added to the widget/view so I can get data from it.
Surely there must be a way to do this?
-
RE: getting started with visualisations
That works nicely, thanks.
Out of curiosity, is there any way to force subscription?
I have a case where I have mutiple values on a sensor, and I'd like to be able to just specify the sensor oid for the widget, and have the implementation figure out the values.
e.g. I have
foo.bah.x
foo.bah.y
foo.bah.z.. I'd like to only have to supply an oid of
foo.bah
- the widget can add.x
,.y
etc as those are fixed.or does supplying an oid = "foo.bah" create a subscription for changes of all children too?
-
RE: getting started with visualisations
Ah, that would be it then - I may have missed it.
I assumed that the /id type in the attr declaration was what did it.