ioBroker / AdapterRequests

This Place is used to track the status of new Adapter-Requests.
248 stars 36 forks source link

OilFox Adapter für ioBroker #91

Closed Meraluna closed 5 years ago

Meraluna commented 5 years ago

Hi ich suche ein Api für den OilFox um ihm mit dem ioBroker auslesen zu können die Oil Fox Herstellerseite : https://www.oilfox.io/ Für OpenHab gibt es schon eine Lösung nur leider kann ich sowas nicht umschreiben bzw. Programmieren und hoffe das jemand von euch eine lösung dafür hat bzw. kennt.

https://github.com/rolandmoser/org.openhab.binding.oilfox

Ich und ich glaube auch viele andere Anwender würde eine riesen last von den schultern fallen.

IP-Symcon Module for OilFox oil meter sensor gibt es auch dafür

https://github.com/CodeKing/de.codeking.symcon.oilfox

Apollon77 commented 5 years ago

Ich und ich glaube auch viele andere Anwender würde eine riesen last von den schultern fallen.

Na dann schau das viele voten :-)

HighControl commented 5 years ago

Habe mir jetzt auch den OilFox gekauft. Hoffe ein Adapter wird erscheinen...

MeisterHoppel commented 5 years ago

Bin auch dabei. Wäre perfekt.

peoples0815 commented 5 years ago

Hat mittlerweile jemand zu dem Thema schon jemand begonnen ? Nachdem backitup recht stabil läuft würde ich hier gerne unterstützen soweit möglich.

MeisterHoppel commented 5 years ago

Hallo, drüben bei SchimmerMedia wurde bereits dieses Skript veröffentlicht: token=curl -d '{"email":"<USER>","password":"<PASSWD>"}' -H "Content-Type: application/json -H "Connection: Keep-Alive" -H "User-Agent: okhttp/3.2.0" -X POST https://api.oilfox.io/v2/backoffice/session | tail -2 | head -1 | cut -d '"' -f4;curl -H "X-Auth-Token: $token" -H "Connection: Keep-Alive" -H "User-Agent: okhttp/3.2.0" -H "Content-Type: application/json" https://api.oilfox.io/v2/user/summary

Bekomme es aber leider nicht zum laufen: -bash: command substitution: line 1: unexpected EOF while looking for matching `'' -bash: command substitution: line 2: syntax error: unexpected end of file

Aber das wäre doch ein guter Ansatz....

Grüße

jogibear9988 commented 5 years ago

I've started a Oilfox Adapter:

https://github.com/iobroker-community-adapters/ioBroker.oilfox

I'll finish it next week, but it works atm.

Todos:

DutchmanNL commented 5 years ago

Cool thank you! I adjust the status of this request if you need any assistance not help during development let us know here or in the forum

jogibear9988 commented 5 years ago

@DutchmanNL maybe when I'm finished I need a code review. (but not now, because I know that there is work to do)

DutchmanNL commented 5 years ago

Sure, we have some skilled people who love Todo code police :-)

Apollon77 commented 5 years ago

@jogibear9988 i need to start with „police“. There are some automatisms that Use the GitHub repo user and assume it is a reference to the user somehow. Only assumption are the Adapters owner bz the iobroker org. „Iobroker-Adapters“ as user is too generic and people could think it is an official iobroker repository which is not and it would also break the semantic of some automatisms.

Could you please change the GitHub repo user (same would be for npm just in case). Is that ok for you?

peoples0815 commented 5 years ago

Nice to hear that someone has started with the adapter. If there are ways to support, just let me know.

jogibear9988 commented 5 years ago

@Apollon77 i don't understand directly what you mean! maybe in german? (maybe I shouldn't have switched to english in the issue, shame on me). I created an organization, because I want that other people could join and also work on the adapters (I'm planing atm. to work on 3). Maybe if they are good enough at one time it's also possible to join them into the iobrokers account

jogibear9988 commented 5 years ago

@peoples0815 the adapter works atm, but I need to beautify the code, create tests, clean package.json, create npm,... but you can use it already.

Apollon77 commented 5 years ago

@jogibear9988 ich verstehe die Idee mit der Organisation, bist quasi der erste der es macht. Aktuell haben Adapter über den GitHub Namen immer den „Initialen Author“ des Adapters auch wenn ggf weitere Entwickler dann unterstützen.

Die einzige Orga die es im Moment gibt ist die „ioBroker“ mit allen Adapter die Core sind bzw von Bluefox geowned werden.

Mein Thema ist gerade eher das der Name deiner Organisation „iobroker-adapters“ sehr (zu) generisch ist und man leicht mit der ioBroker orga verwechseln kann. Ich kläre aber auch nochmal intern die genauen Probleme.

peoples0815 commented 5 years ago

@jogibear9988 Habe deinen Adapter mal bei mir in die Testumgebung installiert, ich kann zwar meine Daten (Email/PW) eintragen aber der Button zum Speichern funktioniert nicht. Da du ja aber sagtest dass der Adapter erst im neuen Jahr fertig wird, ist das nur als Hinweis gedacht.

GermanBluefox commented 5 years ago

@Apollon77 i don't understand directly what you mean! maybe in german? (maybe I shouldn't have switched to english in the issue, shame on me). I created an organization, because I want that other people could join and also work on the adapters (I'm planing atm. to work on 3). Maybe if they are good enough at one time it's also possible to join them into the iobrokers account

@jogibear9988 ich verstehe die Idee mit der Organisation, bist quasi der erste der es macht. Aktuell haben Adapter über den GitHub Namen immer den „Initialen Author“ des Adapters auch wenn ggf weitere Entwickler dann unterstützen.

Die einzige Orga die es im Moment gibt ist die „ioBroker“ mit allen Adapter die Core sind bzw von Bluefox geowned werden.

Mein Thema ist gerade eher das der Name deiner Organisation „iobroker-adapters“ sehr (zu) generisch ist und man leicht mit der ioBroker orga verwechseln kann. Ich kläre aber auch nochmal intern die genauen Probleme.

I checked the js-controller code and could not find any place where the github path will be assembled. I thought that it should be somewhere. So I see no problem to make it with organisation.

jogibear9988 commented 5 years ago

@peoples0815 kann ich nicht nachvollziehen, bei mir geht er ja. gibts einen fehler in der console wenn du im browser die developer tools öffnest?

Apollon77 commented 5 years ago

@jogibear9988 So an orga basically is completely ok ... only the current name is too generic for me. Users will do assumptions based on the name and "ioBroker adapters" sounds too near on the original orga and the "official orga adapters". If it happens (what noone hopes!!) that you give access to more developers of the community and one is "bad" and do bad things with these adapters then it is important in my eyes to have a clear distinction between the official repos and community ones.

So an orga name like "CommunityAdapter" or something like that would be completely fine for me.

Do you understand the reasoning?

jogibear9988 commented 5 years ago

@Apollon77 I understand you completely, i think about a good name and change it.

what are the requirments for a Adapter to be a official one?

GermanBluefox commented 5 years ago

what are the requirments for a Adapter to be a official one?

https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository

peoples0815 commented 5 years ago

@jogibear9988 Hab dir mal ein Bild angehängt das zeigt dass ich schon einen Fehler habe wenn ich die Adaptereinstellungen öffne.

oilfox

Und hier ein Log Auszug wenn ich ihn starte. Da sich die Daten nicht speichern lassen, kommt eben dieses Undefined.

Log Auszug:

host.iobroker-test-system 2018-12-29 13:45:35.644 error instance system.adapter.oilfox.0 terminated with code 0 (OK)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at Manager. (/opt/iobroker/node_modules/component-bind/index.js:21:15)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:244:12)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at Socket.onack (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:319:9)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:787:25)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at createInstancesObjects (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:748:13)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at /opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:788:29
Caught 2018-12-29 13:45:35.644 error by controller[0]: at initAdapter (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4990:18)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at Adapter.emit (events.js:208:7)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at emitNone (events.js:106:13)
Caught 2018-12-29 13:45:35.644 error by controller[0]: at Adapter. (/opt/iobroker/node_modules/iobroker.oilfox/main.js:22:21)
Caught 2018-12-29 13:45:35.643 error by controller[0]: TypeError: Cannot read property 'email' of undefined
oilfox.0 2018-12-29 13:45:35.636 info terminating
oilfox.0 2018-12-29 13:45:35.134 debug adapter.on-unload: << UNLOAD >>
oilfox.0 2018-12-29 13:45:35.133 error at Manager. (/opt/iobroker/node_modules/component-bind/index.js:21:15)
oilfox.0 2018-12-29 13:45:35.133 error at Socket.onpacket (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:244:12)
oilfox.0 2018-12-29 13:45:35.133 error at Socket.onack (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/socket.io-client/lib/socket.js:319:9)
oilfox.0 2018-12-29 13:45:35.133 error at Socket. (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:787:25)
oilfox.0 2018-12-29 13:45:35.133 error at createInstancesObjects (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:748:13)
oilfox.0 2018-12-29 13:45:35.133 error at /opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:788:29
oilfox.0 2018-12-29 13:45:35.133 error at initAdapter (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4990:18)
oilfox.0 2018-12-29 13:45:35.133 error at Adapter.emit (events.js:208:7)
oilfox.0 2018-12-29 13:45:35.133 error at emitNone (events.js:106:13)
oilfox.0 2018-12-29 13:45:35.133 error at Adapter. (/opt/iobroker/node_modules/iobroker.oilfox/main.js:22:21)
oilfox.0 2018-12-29 13:45:35.133 error TypeError: Cannot read property 'email' of undefined
oilfox.0 2018-12-29 13:45:35.133 error uncaught exception: Cannot read property 'email' of undefined
oilfox.0 2018-12-29 13:45:35.130 debug adapter.on-ready: << READY >>
oilfox.0 2018-12-29 13:45:35.128 info starting. Version 0.0.1 in /opt/iobroker/node_modules/iobroker.oilfox, node: v8.12.0
oilfox.0 2018-12-29 13:45:35.030 debug statesDB connected
oilfox.0 2018-12-29 13:45:35.005 debug objectDB connected
DutchmanNL commented 5 years ago

@jogibear9988 Hab dir mal ein Bild angehängt das zeigt dass ich schon einen Fehler habe wenn ich die Adaptereinstellungen öffne.

lasst uns issues bezueglich der functionalitaet in der betreffenden repository buendeln :)

https://github.com/iobroker-community-adapters/ioBroker.oilfox/issues

Meraluna commented 5 years ago

Also wow danke Danke Danke jogibear9988 ist klasse das du dich dahintersteckst echt klasse bin gespannt wenn es geht und endlich eine Visualisierung beim IoBroker dann geht freue mich riesig Darüber und ich glaube nicht nur ich sondern viele OilFox Besitzer und IoBrokeruser.

LG Meraluna

Apollon77 commented 5 years ago

@jogibear9988 Thank you very much!

Apollon77 commented 5 years ago

@jogibear9988 Just a note: Please make sure to encrypt the password!! YOu could check e.g. meross Adapter or others how to do it. Some stuff in the index_m.html and some stuff in the main adapter file

jogibear9988 commented 5 years ago

@Apollon77 why should the password be encrypted? I need to send it unencrypted, so there is always a way to get it

Apollon77 commented 5 years ago

Because it would be stored in iobroker objects unencrypted. Is sthe connection to the device not encrypted (HTTPS)? So yes it could be sniffed in the network, but I do not know if it needs to be stored unencrypted ;-) but up to you. I personally consider it as best practice to encrypt potential sensitive data

jogibear9988 commented 5 years ago

I call adapter.setObjectNotExistsAsync every-time I receive data. Is this a problem? Should I only do it once?

DutchmanNL commented 5 years ago

Its five to do it every time, I prefer to do it only during initialisation.

Why do you use async for it ? For getbi understand to handle the asycronis handling of function bit to set an object?

Apollon77 commented 5 years ago

Hm ... it is better do donut only once. When you know that the object exists it is only overhead because it tries to read the object to check for existence. So it is one call more that reads the Object Definition.

Meraluna commented 5 years ago

Adapter geht zu 100 % zeigt states super an genau das was ich gesucht habe MEGA !!!!!

vielen lieben dank jogibear9988 bist mein Held dies Jahr hast vielen usern mit dem Adapter nen wunsch erfüllt 1000 Dank dir und morgen allen einen Guten Rutsch.

lg MeraLuna :)

jogibear9988 commented 5 years ago

kein problem.

muss mich jetzt nur noch mit npm befassen und tests realisieren.

HighControl commented 5 years ago

@jogibear9988 recht herzlichen Dank für Deine tolle Arbeit!

@ll einen guten Rutsch ins Jahr 2019

jogibear9988 commented 5 years ago

Hab den Adapter nun noch auf einen Scheduled umgestellt. Da Oilfox sowieso nur 1mal am Tag gelesen wird, braucht da nicht die ganze Zeit eine Instanz laufen.

Dazu den Adapter bitte nochmal komplett entfernen (nicht nur die Instanz)

jogibear9988 commented 5 years ago

@DutchmanNL kann nun geschlossen werden

DutchmanNL commented 5 years ago

@DutchmanNL kann nun geschlossen werden

danke fur die release 👍